Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usable variable TARGET doesn't change after a fail test #69

Open
geoffrey-guiramand opened this issue Aug 2, 2024 · 0 comments
Open

Comments

@geoffrey-guiramand
Copy link

Hello,

we tried to use TARGET variable in delegate mode but when a node failed the service before, the TARGET used doesn't change.

an exemple, this is the yaml we used:

---
services:        
  test_failed: 
    desc: "test for tags failed on pm9-nod66"   
    target: "@compute" 
    actions:
      test:  
        cmd: 'hostnamectl | grep pm9-nod66'  
  test_TARGET:  
    desc: "test for TARGET"
    target: "@compute"
    mode: delegate   
    require_filter: [test_failed] 
    actions:
    test:   
    cmd: { printf "Target value [%%s]\n" "%TARGET"; exit 1; }

the milkcheck response :

[root@mngt0-1 step0]# milkcheck test --report=full -c /home/gguiramand/milkcheck/conf/ -n $nodeset --verbose

test test_failed on pm8-nod01,pm9-nod66
  > hostnamectl | grep pm9-nod66 
test test_failed ran in 0.20 s
  > pm9-nod66: Transient hostname: pm9-nod66 
  > pm9-nod66 exited with 0 
  > pm8-nod01 exited with 1
test_failed - test for tags failed on pm9-nod66                                                            [  ERROR  ] 
test test_TARGET on pm9-nod66 
  > { printf "Target value [%s]\n" "pm8-nod01,pm9-nod66"; exit 1; } 
test test_TARGET ran in 0.01 s
  > localhost: Target value [pm8-nod01,pm9-nod66] 
  > localhost exited with 1
test_TARGET - test for TARGET                                                                              [  ERROR  ] 

 SUMMARY - 2 actions (2 failed) 
 + test_failed.test - test for tags failed on pm9-nod66   
  Target: pm8-nod01
  Command: hostnamectl | grep pm9-nod66 
 + test_TARGET.test - test for TARGET 
  Target: localhost 
  Command: { printf "Target value [%s]\n" "pm8-nod01,pm9-nod66"; exit 1; } 

we can see here that the TARGET usable variable does not change when a node has failed a previous test.

[17:59:29] INFO     - Variable content '#[[ %MILKCHECK_AUTOMATE_CLARY == 1 ]] || exit 0
{ printf "Target value [%%s]\n" "%TARGET"; exit 1; }
#clary_statuses=(%CLARY_STATUSES)
#%CLARY_STATE_EXECBIN -c "MilkCheck Step 2: PASSED" -n "%TARGET" -s "${clary_statuses[3]}"
' replaced by '#[[ 1 == 1 ]] || exit 0
{ printf "Target value [%s]\n" "pm8-nod01,pm9-nod66"; exit 1; }
#clary_statuses=(step0 step1 step2 step3.1 step3.2 step3.3 prod)
#/usr/sbin/clary-state -c "MilkCheck Step 2: PASSED" -n "pm8-nod01,pm9-nod66" -s "${clary_statuses[3]}"
'

with the verbose option we can see the Variable was changed only once before services and not durring. That's Normal ?

Regards,
Geoffrey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant