-
Notifications
You must be signed in to change notification settings - Fork 303
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
BackendService naming for NEG backend services & healthchecks #262
Conversation
pkg/loadbalancers/l7.go
Outdated
@@ -137,7 +137,7 @@ func (l *L7) checkUrlMap() (err error) { | |||
if l.runtimeInfo.UrlMap == nil { | |||
return fmt.Errorf("cannot create urlmap without internal representation") | |||
} | |||
defaultBackendName := l.namer.Backend(l.runtimeInfo.UrlMap.DefaultBackend.NodePort) | |||
defaultBackendName := l.namer.IGBackend(l.runtimeInfo.UrlMap.DefaultBackend.NodePort) |
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.
How come you use IGBackend() directly here instead of ServicePort.BackendName()?
7571409
to
5c1b13d
Compare
Manual test looked good. Nice job @agau4779 |
Looks fine to me. Will leave @freehan to give LGTM. |
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.
just nits. LGTM
pkg/utils/namer.go
Outdated
@@ -239,13 +247,13 @@ func (n *Namer) NameBelongsToCluster(name string) bool { | |||
return components.ClusterName == clusterName || n.negBelongsToCluster(name) | |||
} | |||
|
|||
// BeName constructs the name for a backend. | |||
func (n *Namer) Backend(port int64) string { | |||
// IGBackend constructs the name for a backend. |
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.
comment: IGBackend constructs the name for a backend service targeting instance groups.
pkg/utils/namer.go
Outdated
// negBelongsToCluster checks that the uid is present and a substring of the | ||
// cluster uid, since the NEG naming schema truncates it to 8 characters. | ||
// This is only valid for NEGs and Backends on NEG. | ||
func (n *Namer) negBelongsToCluster(name string) bool { |
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.
nit: negNameBelongsToCluster?
comment: This is only valid for NEGs, BackendServices and Healthchecks for NEG
5c1b13d
to
06db5a4
Compare
Thanks for both of your reviews. Fixed comments. |
Continuation of #239
More changes:
namer.Backend
is renamed tonamer.IGBackend
to prevent confusion between IG/NEG.TODO in another PR:
Rewrite unit tests to not care what kind of serviceport their given.