-
Notifications
You must be signed in to change notification settings - Fork 127
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
Update security group cannot remove all rules #378
Comments
That seems likely. Let me take a took. |
Thinking more about this: it might be worth to consider another case.
In such situtations a SDK user might define a struct with field name set, but rules undefined. noRules, _ := c.Update(ctx, "guid-A", &resource.SecurityGroupUpdate{
Name: "newName",
})
newName, _ := c.Update(ctx, "guid-B", &resource.SecurityGroupUpdate{
Rules: []*resource.SecurityGroupRule{},
}) |
results in the following error:
results in a rename and all rules removed
results in a rename and all rules stay the same The relevant options are either 2 or 3. Option 3 - renaming a security group without specifying all the rules seems more useful than the ability to remove all rules from a security group. It seems like a security group with no rules isn't useful and in those cases the caller should just delete it. If so, then leaving the |
Reading through the linked cf-mgmt issue, there is an issue here. SecurityGroupGloballyEnabled should be optionally transmitted, so change it to:
@freudl Does that address your concern? |
Globally enabled running and staging flags should be optional for security groups allowing only the security group name or rule definitions to be updated.
The v3 client enables me to update security groups.
However, the action as no effect.
As far as I understand, during the request the parameter is marshalled with option
omitempty
so the empty rule set never leaves the SDK.The text was updated successfully, but these errors were encountered: