-
Notifications
You must be signed in to change notification settings - Fork 302
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
examine nil pointer before applying backend protocol configurations #678
Conversation
pkg/healthchecks/healthchecks.go
Outdated
@@ -62,6 +62,10 @@ const ( | |||
// backends, the port or named port specified in the Backend Service is | |||
// used for health checking. | |||
UseServingPortSpecification = "USE_SERVING_PORT" | |||
|
|||
newHealthCheckErrorMessageTemplate = "the %v health check configuration on the exiting health check %v is nil. " + | |||
"This is usually caused by application protocol changed. " + |
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.
what do you mean by exiting?
pkg/healthchecks/healthchecks.go
Outdated
@@ -62,6 +62,10 @@ const ( | |||
// backends, the port or named port specified in the Backend Service is | |||
// used for health checking. | |||
UseServingPortSpecification = "USE_SERVING_PORT" | |||
|
|||
newHealthCheckErrorMessageTemplate = "the %v health check configuration on the exiting health check %v is nil. " + | |||
"This is usually caused by application protocol changed. " + |
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.
"..caused by an application..."
|
||
newHealthCheckErrorMessageTemplate = "the %v health check configuration on the exiting health check %v is nil. " + | ||
"This is usually caused by application protocol changed. " + | ||
"Please revert the change on application protocol to avoid this error message." |
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.
"...revert the change on the application..."
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.
"Please revert the change on application protocol to avoid this error message." | |
"Please revert the change on the application's protocol to avoid this error message." |
I don't have a lot of insight into how the ingress-gce works internally, but I think a TODO on handling this type of change would be helpful. I think progressing from HTTP-1.1 to HTTP-2 (soon HTTP-3) or introducing changes on the protocol to adopt a service mesh will be a common occurrence.
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.
yeah. Agreed. In the long run we want to support this. But currently, due to GCE api changes, it was broken. So we need to put this short term fix in place so that it can be cherry picked.
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 add the TODO just so we remember to do it?
pkg/healthchecks/healthchecks.go
Outdated
@@ -62,6 +62,10 @@ const ( | |||
// backends, the port or named port specified in the Backend Service is | |||
// used for health checking. | |||
UseServingPortSpecification = "USE_SERVING_PORT" | |||
|
|||
newHealthCheckErrorMessageTemplate = "the %v health check configuration on the exiting health check %v is nil. " + | |||
"This is usually caused by application protocol changed. " + |
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.
"This is usually caused by application protocol changed. " + | |
"This is usually caused by a change of the application's protocol." + |
|
||
newHealthCheckErrorMessageTemplate = "the %v health check configuration on the exiting health check %v is nil. " + | ||
"This is usually caused by application protocol changed. " + | ||
"Please revert the change on application protocol to avoid this error message." |
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.
"Please revert the change on application protocol to avoid this error message." | |
"Please revert the change on the application's protocol to avoid this error message." |
I don't have a lot of insight into how the ingress-gce works internally, but I think a TODO on handling this type of change would be helpful. I think progressing from HTTP-1.1 to HTTP-2 (soon HTTP-3) or introducing changes on the protocol to adopt a service mesh will be a common occurrence.
fixed. |
Assigning for |
This LGTM, but will defer to @rramkumar1 to make the final call. |
pkg/healthchecks/healthchecks.go
Outdated
@@ -62,6 +62,10 @@ const ( | |||
// backends, the port or named port specified in the Backend Service is | |||
// used for health checking. | |||
UseServingPortSpecification = "USE_SERVING_PORT" | |||
|
|||
newHealthCheckErrorMessageTemplate = "the %v health check configuration on the existing health check %v is nil. " + | |||
"This is usually caused by an application protocol changed. " + |
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 give the name of the actual field involved, this error is a bit vague sounding. are we talking about the GCP object, the protocol used by the app itself, etc
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.
HealthCheck object contains HTTPHealthCheck configurations. It has bunch of fields.
In this case, the controller thinks that HTTP2HealthCheck configuration is nil because it was not vendored.
v.HTTPHealthCheck = computealpha.HTTPHealthCheck(*hc.HttpsHealthCheck) | ||
case annotations.ProtocolHTTP2: | ||
if hc.Http2HealthCheck == nil { | ||
err = fmt.Errorf(newHealthCheckErrorMessageTemplate, annotations.ProtocolHTTP2, hc.Name) |
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 not return immediately (same in all case above)
Ready for next round |
pkg/healthchecks/healthchecks.go
Outdated
@@ -62,6 +62,10 @@ const ( | |||
// backends, the port or named port specified in the Backend Service is | |||
// used for health checking. | |||
UseServingPortSpecification = "USE_SERVING_PORT" | |||
|
|||
newHealthCheckErrorMessageTemplate = "the %v health check configurations on the existing health check %v is nil. " + |
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.
"the %v health check configuration..."
|
||
newHealthCheckErrorMessageTemplate = "the %v health check configuration on the exiting health check %v is nil. " + | ||
"This is usually caused by application protocol changed. " + | ||
"Please revert the change on application protocol to avoid this error message." |
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 add the TODO just so we remember to do it?
Done |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: freehan, rramkumar1 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 |
Cherrypick #678 into release-1.5
Mitigates #675