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

rmk cluster capi create should be idempotent and always exit with 0 #52

Open
1 task done
anovikov-el opened this issue Nov 20, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@anovikov-el
Copy link
Contributor

anovikov-el commented Nov 20, 2024

Description

rmk cluster capi create should be idempotent and always exit with 0, even when a k3d cluster already created.
E.g., the command can be executed multiple times in a row on a CI/CD machine.

At the same time, currently, the logic rmk cluster capi delete is idempotent and works consistent, always exits with 0.
It is because the inconsistencies inside the k3d tool itself.

Steps to reproduce

Run rmk cluster capi create multiple times.

Expected behaviour

The first time:

rmk cluster capi create
INFO[0000] Using config file /tmp/capi-config.1372334668.yaml (k3d.io/v1alpha5#simple)
INFO[0000] Prep: Network
INFO[0000] Created network 'k3d-capi'
INFO[0000] Created image volume k3d-capi-images
INFO[0000] Starting new tools node...

The next times:

rmk cluster capi create
INFO[0000] Using config file /tmp/capi-config.4236823231.yaml (k3d.io/v1alpha5#simple)
INFO[0000] Cluster 'capi' already exists

Actual behaviour

The first time:

rmk cluster capi create
INFO[0000] Using config file /tmp/capi-config.1372334668.yaml (k3d.io/v1alpha5#simple)
INFO[0000] Prep: Network
INFO[0000] Created network 'k3d-capi'
INFO[0000] Created image volume k3d-capi-images
INFO[0000] Starting new tools node...

The next times:

rmk cluster capi create
INFO[0000] Using config file /tmp/capi-config.4236823231.yaml (k3d.io/v1alpha5#simple)
FATA[0000] Failed to create cluster 'capi' because a cluster with that name already exists
exit status 1

Environment info

RMK: v0.45.0+ (with the Cluster API support)
OS: any
Shell: any
Terminal: any

Agree to the Code of Conduct

  • I agree to follow this project's Code of Conduct
@anovikov-el anovikov-el added the bug Something isn't working label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant