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

bug: command --locked false to unlock the server doesn't work, however --locked true to lock the server does work. #484

Open
waltribeiro opened this issue Aug 26, 2024 · 2 comments · May be fixed by #485
Labels
bug Something isn't working

Comments

@waltribeiro
Copy link
Contributor

What happened?

The --locked false and -l false commands do not work. According to the Docs, a boolean can lock or unlock the server from being updated.

However, only --locked true and -l true seem to work. This is seen in the video below.

How can we reproduce it?

  1. Deploy server.
  2. Get server ID.
  3. Run command metal device update --id <server-id> --locked true to lock the server.
  4. Confirm that it is locked on console.equinix.com.
image-locked
  1. Run command metal device update --id <server-id> --locked false to unlock the server.
  2. Confirm that it is unlocked on console.equinix.com. However, it is not.
image-unlocked

Note

CLI ==version== (metal --version): metal version 0.24.0

Important

video-locked-hb.mp4
@waltribeiro waltribeiro added the bug Something isn't working label Aug 26, 2024
@waltribeiro
Copy link
Contributor Author

Update: logs confirm that the --locked false command is not being sent at all.

image-unlocked-not-sent

@displague displague linked a pull request Aug 26, 2024 that will close this issue
@displague
Copy link
Member

https://github.com/equinix/metal-cli/blob/main/internal/devices/update.go#L82-L85 will only apply locked changes when the variable is set to true.

The code should look at wether or not the parameter was sent and set locked based on the specified setting. false should not be the default.

I don't see other examples in this project of an optional boolean variable whose value must be explicitly false or true when specified.

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

Successfully merging a pull request may close this issue.

2 participants