-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Consistent naming of security group rules #10179
Consistent naming of security group rules #10179
Conversation
/cc @rifelpet |
pkg/model/firewall.go
Outdated
} | ||
|
||
if o.Protocol == nil || fi.StringValue(o.Protocol) == "" { | ||
proto = "AllProtos" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be enough to say "all".
proto = "AllProtos" | |
proto = "all" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all what? :) I used allprotos because for descriptiveness when one reads the names in tasks, logs etc.
But I don't have a strong opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it could be replaced with a -
or something else, but the location will be used for protocol everywhere.
pkg/model/firewall.go
Outdated
return fmt.Sprintf("%v-%v-from-%v-to-%v-%v-%v", direction, | ||
proto, src, dst, fi.Int64Value(o.FromPort), fi.Int64Value(o.ToPort)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any special reason for using "%v"?
return fmt.Sprintf("%v-%v-from-%v-to-%v-%v-%v", direction, | |
proto, src, dst, fi.Int64Value(o.FromPort), fi.Int64Value(o.ToPort)) | |
return fmt.Sprintf("%s-%s-%d-%d-from-%s-to-%s", direction, | |
proto, fi.Int64Value(o.FromPort), fi.Int64Value(o.ToPort), src, dst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we have Ingress
, do we still need To
, or is it intended that it refers to current SG?
Same for Egress
and From
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to mention both src and dst to avoid duplications. or are you referring to the word "from" itself?
29fc434
to
cda413b
Compare
In order to let kops fully control the rules for each security group we need to be able to generate names from the info in AWS. This is similar to the approach we used for openstack Update pkg/model/firewall.go Co-authored-by: Ciprian Hacman <ciprianhacman@gmail.com>
cda413b
to
fab694d
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hakman, olemarkus The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I think this renaming could result in short periods of connectivity loss. We could add another release note with the 'terraform state mv' commands to make terraform report a no-op. |
In order to let kops fully control the rules for each security group we need to be able to generate names from the info in AWS. This is similar to the approach we used for openstack.
This only converts the naming of some of the rules. Since this affects CF/TF resource names, I want to make sure this doesn't cause any concerns.