-
Notifications
You must be signed in to change notification settings - Fork 115
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
Fix Ingress awaiter for ExternalName Services #320
Conversation
The await logic was incorrectly waiting for active Pods for all Service types. However, Services with type: ExternalName do not have associated Pods and should succeed as long as the Service exists.
pkg/await/extensions_ingress.go
Outdated
@@ -50,6 +51,7 @@ type ingressInitAwaiter struct { | |||
endpointsReady bool | |||
endpointsSettled bool | |||
endpointExists map[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.
A better name for this is now probably something like serviceReady
, as Service
s with type ExternalName
don't have endpoints.
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.
Arg, dammit. I'm testing out the GH extension and it apparently doesn't let you batch up review comments?
pkg/await/extensions_ingress.go
Outdated
@@ -195,6 +234,7 @@ func (iia *ingressInitAwaiter) await( | |||
} | |||
case <-timeout: | |||
// On timeout, check one last time if the ingress is ready. | |||
iia.endpointsReady = iia.checkIfEndpointsReady() |
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.
It seems like we have to do this also for case <-iia.config.ctx.Done():
?
return | ||
} | ||
|
||
name := service.GetName() |
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.
if event.Type == watch.Deleted {
, don't we want to delete this from iia.externalServices
? And now that I think about it, is there a reason we don't do this for iia.endpointExists
as well?
pkg/await/extensions_ingress.go
Outdated
@@ -158,6 +198,7 @@ func (iia *ingressInitAwaiter) read( | |||
glog.V(3).Infof("Error iterating over endpoint list for ingress %q: %v", ingress.GetName(), err) | |||
} | |||
|
|||
iia.endpointsReady = iia.checkIfEndpointsReady() |
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 think I'm missing something -- seems like it would be better to just get rid of iia.endpointsReady
and simply call iia.checkIfEndpointsReady()
wherever you would check iia.endpointsReady
? Seems redundant to have the function and the variable.
cc911f2
to
220c000
Compare
220c000
to
e32c939
Compare
Because @lblackstone is not currently here, I've gone ahead and "addressed" my comments. To my eye, this is semantically equivalent, but with the (small) changes noted in the following list. I'd like to turn this sort of thing around pretty quick, so I'll file a follow-up issue to have @lblackstone do a post-commit review to make sure I didn't do anything silly.
|
The await logic was incorrectly waiting for active Pods for all Service
types. However, Services with type: ExternalName do not have
associated Pods and should succeed as long as the Service exists.
Fixes #317