Skip to content

Commit

Permalink
consider support of logout when user is not logged in
Browse files Browse the repository at this point in the history
Co-authored-by: Bikouo Aubin <[email protected]>
  • Loading branch information
yurnov and abikouo authored Dec 11, 2024
1 parent 50e47b5 commit 8d2ddf2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions plugins/modules/helm_registry_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,15 @@ def main():
rc, out, err = module.run_helm_command(helm_cmd, data=password)

if rc != 0:
module.fail_json(
msg="Failure when executing Helm command. Exited {0}.\nstdout: {1}\nstderr: {2}".format(
if state == "absent" and "Error: not logged in" in err:
changed = False
else:
module.fail_json(
msg="Failure when executing Helm command. Exited {0}.\nstdout: {1}\nstderr: {2}".format(
rc, out, err
),
command=helm_cmd,
)
),
command=helm_cmd,
)

module.exit_json(changed=changed, stdout=out, stderr=err, command=helm_cmd)

Expand Down

0 comments on commit 8d2ddf2

Please sign in to comment.