-
Notifications
You must be signed in to change notification settings - Fork 301
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
Pass service/port tuple separate from ServicePort #270
Conversation
return nil | ||
} | ||
negName := b.namer.NEG(port.SvcName.Namespace, port.SvcName.Name, port.SvcTargetPort) | ||
negName := b.namer.NEG(sp.ID.Service.Namespace, sp.ID.Service.Name, sp.SvcTargetPort) |
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.
Can we use the new BackendName function here?
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.
So this name is used for both the NEG and the BackendService. I'll be redundantly clear and use BackendName
for when we get the backendservice; however, I think this line is still appropriate for the NEG.
urlMap := lbc.Translator.TranslateIngress(ing, lbc.CloudClusterManager.defaultBackendSvcPort) | ||
urlMap, err := lbc.Translator.TranslateIngress(ing, lbc.CloudClusterManager.defaultBackendSvcPortID) | ||
if err != nil { | ||
return fmt.Errorf("error while evaluating the ingress spec: %v", err) |
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.
Nice!
pkg/flags/flags.go
Outdated
@@ -103,8 +104,10 @@ controller only works with default zones.`) | |||
must serve a 200 page on this path.`) |
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 would maybe add one line that says that default-backend-service and default-backend-service-port are mandatory.
pkg/utils/serviceport.go
Outdated
return namer.NEG(sp.ID.Service.Namespace, sp.ID.Service.Name, sp.SvcTargetPort) | ||
} | ||
|
||
// BackendToServicePortID creates a ServicePortID struct from an IngressBackend struct and namespace. |
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: Remove the word struct from the comment.
@@ -62,6 +63,18 @@ func IsHTTPErrorCode(err error, code int) bool { | |||
return ok && apiErr.Code == code | |||
} | |||
|
|||
// ToNamespacedName returns a types.NamespacedName struct parsed from namespace/name. | |||
func ToNamespacedName(s string) (r types.NamespacedName, err error) { |
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.
Tiny test for this?
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.
Done
/lgtm |
New changes are detected. LGTM label has been removed. |
Fixed a small typo in the test. |
Changes: