Skip to content

Conversation

@joaopalet
Copy link
Contributor

Allow users to specify an empty CIDR slice by setting the flag to "".
E.g. stackit <service> instance update <instance ID> --acl "" sets the ACLs of the instance to the empty list.

This makes the custom flag CIDRSliceFlag have the same behaviour for empty values as the more generic and default StringSlice flag type

Copy link
Contributor

@vicentepinto98 vicentepinto98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this will work for all services that have the --acl flag? I think some of them do not accept empty list

@joaopalet
Copy link
Contributor Author

As discussed, the flag logic should always allow setting an empty slice

I tested with all services that use this flag and the ones that do not accept an empty list validate it in the API and the error response is clear enough, so I think we don't need to validate it in the CLI

@joaopalet joaopalet merged commit 6f6eb6a into main Mar 21, 2024
@joaopalet joaopalet deleted the jp/allow-empty-cidr-slice-flag branch March 21, 2024 13:15
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

Successfully merging this pull request may close these issues.

3 participants