Repository navigation
Bug 1686117: pkg/controller: re-sync on pull secret change - #632
Conversation
|
I'm having an hard time spinning up a new cluster to test this out, if someone could help me testing this I'd appreciate, I'm holding this for now. /hold @deads2k can you check this one which is related to the BZ you opened please |
|
/hold |
|
/hold |
|
wtf, no hold 😄 ? |
ad13569 to
a6bc5a8
Compare
kikisdeliveryservice
left a comment
There was a problem hiding this comment.
added some comments
There was a problem hiding this comment.
do we want all of these logs in the v4 logs? Since this doesn't happen often I'm fine with it being in the main logs
There was a problem hiding this comment.
I'm fine changing this although I'll be more confident doing it in another PR and probably after 4.1 to avoid some weird logs flooding before we get there (we can discuss this in an issue maybe if we really want it for 4.1?)
There was a problem hiding this comment.
sure. i just figured since this is something user initiated, we'd want to expose some sort of log. all of the MC based updates for ex result in a log line exposed
cgwalters
left a comment
There was a problem hiding this comment.
LGTM pending collective nits
|
taken care of comments thanks! |
|
all of the comments seem to be addressed. /lgtm |
|
/retest |
1 similar comment
|
/retest |
|
flakes mainly /retest |
|
/retest |
|
we need #640 in order to merge this now |
rebased to bring the other PR, I'm now testing it to remove the hold |
|
alright, this worked just fine according to my testing, e.g. follow the docs I've added here, edited the secret and I can see 2 new rendered- with the updated pull-secret /hold cancel |
|
/hold seeing something happening which I don't like but it doesn't look related to this anyway, I'm going to check |
I0417 18:47:11.232819 1 kubelet_config_features.go:31] FeatureWorker I0417 18:47:11.237594 1 kubelet_config_features.go:31] FeatureWorker Doesn't really say anything so let's behave like the ImageWorker in CR controller. Signed-off-by: Antonio Murdaca <[email protected]>
|
/retest |
|
:/ /retest |
|
Finally figured this out finally...
So, the solution would be to just have a namespaced infomer just for the Let's see if it works, I'm testing it out locally. |
|
@runcom great!!!! |
Signed-off-by: Antonio Murdaca <[email protected]>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1686117 I've noticed, from code, that we don't trigger a resync when the pull-secret changes. That leaves us with just a "oc delete pod controller" to actually trigger a resync with a changed pull-secret. Added an event handler for that particular secret to trigger a re-sync. Also added a new doc explaining how to change the pull-secret (taking care of the referenced BZ). Signed-off-by: Antonio Murdaca <[email protected]>
|
Should be ready to go now, I've tested locally and I can now restart the controller w/o it being oom'ed when it starts up again, let's see if tests complain (This PR also contains 2 other trivial fixes, see individual commits) /hold cancel |
kikisdeliveryservice
left a comment
There was a problem hiding this comment.
One comment below - am I misunderstanding?
| @@ -0,0 +1,17 @@ | |||
| # Changing the payload pull secret | |||
| ctrl.filterSecret(secret) | ||
| } | ||
|
|
||
| func (ctrl *Controller) updateSecret(old, new interface{}) { |
There was a problem hiding this comment.
updateSecret only seems to call filterSecret and only uses 1 of its args (just new not old)?
There was a problem hiding this comment.
yup, we don't really care about old and we filter the correct one in filterSecret anyway so old can be discarded and we don't have logic around old vs new now. We can't really use filterSecret in the event handler for the informer cause it's not type casted to secret automatically (which is what this method does eventually).
There was a problem hiding this comment.
gotcha on the filterSecret vs updateSecret part 👍 but not understanding why old is an arg for updateSecret if we don't need it or have the logic? shouldn't unused args throw some kind of golang linting error? won't it do that in my vscode?
There was a problem hiding this comment.
that's a signature for the event handler for update. The interface for the informer callbacks are as follows:
type ResourceEventHandlerFuncs struct {
AddFunc func(obj interface{})
UpdateFunc func(oldObj, newObj interface{})
DeleteFunc func(obj interface{})
}
You can see UpdateFunc has old and new (as an update action should have). updateSecret is using the UpdateFunc signature so we must have old and new or we won't even compile.
Anyway, for linting golang doesn't care and vscode either (at least not mine). Golang has the don't care underscore for not used args/variable but that generally sucks, i.e. the updateSecret func becomes
func updateSecret(_, new interface{}) {
and that super sucks as it won't tell you anything about the first argument. Instead, since nothing complains, having old there doesn't matter and the signature is self-explanatory
There was a problem hiding this comment.
thank you for explaining, i didn't quite get it the first two times around 😃
|
LGTM the two tiny fixes are good as well. /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kikisdeliveryservice, runcom The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Bug 1686117: pkg/controller: re-sync on pull secret change
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1686117
I've noticed, from code, that we don't trigger a resync when the
pull-secret changes. That leaves us with just a "oc delete pod
controller" to actually trigger a resync with a changed pull-secret.
Added an event handler for that particular secret to trigger a re-sync.
Also added a new doc explaining how to change the pull-secret (taking
care of the referenced BZ).
Signed-off-by: Antonio Murdaca [email protected]