mudler / yip

:pushpin: Yaml Instructions Processor - Simply applies a cloud-init style yaml file to the system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yip 1.0 is broken

Itxaka opened this issue · comments

commented

yip from master

example.yaml

name: "Test config"
stages:
  default:
    - name: "Step 1"
      commands:
        - echo "1"
    - name: "step 2"
      commands:
        - echo "2"

Analyze its correct:

$ ./yip  -a .
INFO[0000] yip version -gdf15862ad09468b92056d2d25526639925cb4bc2 2023-03-09 08:58:08 UTC 
INFO[0000] 1.                                           
INFO[0000]  <init> (background: false) (weak: false)    
INFO[0000] 2.                                           
INFO[0000]  <Test config.Step 1> (background: false) (weak: true) 
INFO[0000] 3.                                           
INFO[0000]  <Test config.step 2> (background: false) (weak: true) 

But run its incorrect, it runs the last step twice:

$ ./yip .    
INFO[0000] yip version -gdf15862ad09468b92056d2d25526639925cb4bc2 2023-03-09 08:58:08 UTC 
INFO[0000] Running stage: default                       
INFO[0000] Processing stage step 'step 2'. ( commands: 1, files: 0, ... ) 
INFO[0000] Command output: 2                            
INFO[0000] Processing stage step 'step 2'. ( commands: 1, files: 0, ... ) 
INFO[0000] Command output: 2                            
INFO[0000] Done executing stage 'default'  

If you add more steps it will keep repeating the latest one as many times as there are steps, so 5 steps means it will run the last step 5 times.

seems there is still something not right

commented

I found about this running kairos master in the recovery.

Exactly this config file did not run properly: https://github.com/kairos-io/kairos/blob/master/overlay/files/system/oem/00_rootfs.yaml

It was on recovery so the second step in the rootfs stage should have run and created the layout file but it didnt. Unfortunately as the whole recovery was broken I could not extract the full logs, but it looked like the check for the first step was run properly (if: '[ ! -f "/run/cos/recovery_mode" ]')

Maybe its the same issue as the op being overwirtten? That the if fields are overwritten, so the second step run the IF from the first step? Just thinking out loud