-
Notifications
You must be signed in to change notification settings - Fork 117
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: do not build OIDC config unless enabled #4021
fix: do not build OIDC config unless enabled #4021
Conversation
Signed-off-by: Calum Murray <[email protected]>
/cc @pierDipi |
/cherry-pick release-1.15 |
@Cali0707: once the present PR merges, I will cherry-pick it on top of release-1.15 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/cherry-pick release-1.14 |
@Cali0707: once the present PR merges, I will cherry-pick it on top of release-1.14 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/retest-required |
Signed-off-by: Calum Murray <[email protected]>
When config-features changes, the control plane sets a annotation on the receiver pods so that the configmap update is reconciled by k8s Signed-off-by: Calum Murray <[email protected]>
Signed-off-by: Calum Murray <[email protected]>
TODO (as a follow up): refactor the |
Signed-off-by: Calum Murray <[email protected]>
/retest-required |
/cc @pierDipi This should be good to go now, I updated it to not redeploy the verticles (like we had discussed offline). Now, we are using a listener + callback pattern for the OIDC Discovery stuff |
Signed-off-by: Calum Murray <[email protected]>
dcede6d
to
123e6c1
Compare
/retest-required |
1 similar comment
/retest-required |
Signed-off-by: Calum Murray <[email protected]>
@Cali0707 can you run it? |
} | ||
|
||
this.callbacks.add(callback); | ||
return this.callbacks.size(); |
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.
IIUC you are using this return value as some "id", which you later pass to "deregisterCallback()". This uses .set(id, null)
to remove it.
So you do the following on an initial empty arraylist
- add a callback
- return as "callbackId"
1
- later want to deregister the callbackId
1
, but actually you would need to callderegisterCallback(0)
sry, but I didn't find a way to explain it more complicated 🤦
tl;dr; is, that IIUC, you should return here this.callbacks.size() - 1
, if you want to use this as the "callbackId"
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.
Thanks for working on this 💪 . Did a first round. But I probably need to run it locally too :D
TokenVerifier tokenVerifier = new TokenVerifierImpl(vertx, oidcDiscoveryConfig); | ||
this.authenticationHandler = new AuthenticationHandler(tokenVerifier); | ||
this.buildAuthHandler(oidcDiscoveryConfigListener.getOidcDiscoveryConfig()); | ||
this.oidcDiscoveryCallbackId = this.oidcDiscoveryConfigListener.registerCallback(this::buildAuthHandler); |
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.
Maybe we can add a quick note somewhere, that the FileWatcher runs the callbacks, when it gets started (in it's .run() ), that way we can be "sure", that this.authenticationHandler
is not null (which is used in line 243)
Signed-off-by: Calum Murray <[email protected]>
/cc @creydr Thanks for taking a first look! |
/test integration-tests |
/unhold Seems like things are passing now, thanks for finding that off by one error @creydr !! |
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.
Thanks a lot for fixing this @Cali0707
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707, creydr 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 |
/test upgrade-tests |
/test upgrade-tests Last failure looks like a flake, cert-manager failed to come ready |
073bcd2
into
knative-extensions:main
@Cali0707: #4021 failed to apply on top of branch "release-1.15":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@Cali0707: #4021 failed to apply on top of branch "release-1.14":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
* fix: do not build OIDC config unless enabled Signed-off-by: Calum Murray <[email protected]> * feat: receiver redeploys verticles when oidc feature changes Signed-off-by: Calum Murray <[email protected]> * feat: the control plane ensures receiver restarts When config-features changes, the control plane sets a annotation on the receiver pods so that the configmap update is reconciled by k8s Signed-off-by: Calum Murray <[email protected]> * mvn spotless:apply Signed-off-by: Calum Murray <[email protected]> * cleanup: goimports Signed-off-by: Calum Murray <[email protected]> * fix: do not re-deploy verticles Signed-off-by: Calum Murray <[email protected]> * fix: features config paths are now correct Signed-off-by: Calum Murray <[email protected]> * fix java unit tests Signed-off-by: Calum Murray <[email protected]> * mvn spotless:apply Signed-off-by: Calum Murray <[email protected]> * address review comments Signed-off-by: Calum Murray <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]>
* fix: do not build OIDC config unless enabled Signed-off-by: Calum Murray <[email protected]> * feat: receiver redeploys verticles when oidc feature changes Signed-off-by: Calum Murray <[email protected]> * feat: the control plane ensures receiver restarts When config-features changes, the control plane sets a annotation on the receiver pods so that the configmap update is reconciled by k8s Signed-off-by: Calum Murray <[email protected]> * mvn spotless:apply Signed-off-by: Calum Murray <[email protected]> * cleanup: goimports Signed-off-by: Calum Murray <[email protected]> * fix: do not re-deploy verticles Signed-off-by: Calum Murray <[email protected]> * fix: features config paths are now correct Signed-off-by: Calum Murray <[email protected]> * fix java unit tests Signed-off-by: Calum Murray <[email protected]> * mvn spotless:apply Signed-off-by: Calum Murray <[email protected]> * address review comments Signed-off-by: Calum Murray <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]>
@Cali0707: The following tests failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
…4056) * fix: do not build OIDC config unless enabled (#4021) * fix: do not build OIDC config unless enabled Signed-off-by: Calum Murray <[email protected]> * feat: receiver redeploys verticles when oidc feature changes Signed-off-by: Calum Murray <[email protected]> * feat: the control plane ensures receiver restarts When config-features changes, the control plane sets a annotation on the receiver pods so that the configmap update is reconciled by k8s Signed-off-by: Calum Murray <[email protected]> * mvn spotless:apply Signed-off-by: Calum Murray <[email protected]> * cleanup: goimports Signed-off-by: Calum Murray <[email protected]> * fix: do not re-deploy verticles Signed-off-by: Calum Murray <[email protected]> * fix: features config paths are now correct Signed-off-by: Calum Murray <[email protected]> * fix java unit tests Signed-off-by: Calum Murray <[email protected]> * mvn spotless:apply Signed-off-by: Calum Murray <[email protected]> * address review comments Signed-off-by: Calum Murray <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]> * fix: compilation errors Signed-off-by: Calum Murray <[email protected]> * goimports Signed-off-by: Calum Murray <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]>
* fix: do not build OIDC config unless enabled * feat: receiver redeploys verticles when oidc feature changes * feat: the control plane ensures receiver restarts When config-features changes, the control plane sets a annotation on the receiver pods so that the configmap update is reconciled by k8s * mvn spotless:apply * cleanup: goimports * fix: do not re-deploy verticles * fix: features config paths are now correct * fix java unit tests * mvn spotless:apply * address review comments --------- Signed-off-by: Calum Murray <[email protected]>
…extensions#4021) (knative-extensions#4056) * fix: do not build OIDC config unless enabled (knative-extensions#4021) * fix: do not build OIDC config unless enabled Signed-off-by: Calum Murray <[email protected]> * feat: receiver redeploys verticles when oidc feature changes Signed-off-by: Calum Murray <[email protected]> * feat: the control plane ensures receiver restarts When config-features changes, the control plane sets a annotation on the receiver pods so that the configmap update is reconciled by k8s Signed-off-by: Calum Murray <[email protected]> * mvn spotless:apply Signed-off-by: Calum Murray <[email protected]> * cleanup: goimports Signed-off-by: Calum Murray <[email protected]> * fix: do not re-deploy verticles Signed-off-by: Calum Murray <[email protected]> * fix: features config paths are now correct Signed-off-by: Calum Murray <[email protected]> * fix java unit tests Signed-off-by: Calum Murray <[email protected]> * mvn spotless:apply Signed-off-by: Calum Murray <[email protected]> * address review comments Signed-off-by: Calum Murray <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]> * fix: compilation errors Signed-off-by: Calum Murray <[email protected]> * goimports Signed-off-by: Calum Murray <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]>
knative-extensions#4055) * fix: do not build OIDC config unless enabled * feat: receiver redeploys verticles when oidc feature changes * feat: the control plane ensures receiver restarts When config-features changes, the control plane sets a annotation on the receiver pods so that the configmap update is reconciled by k8s * mvn spotless:apply * cleanup: goimports * fix: do not re-deploy verticles * fix: features config paths are now correct * fix java unit tests * mvn spotless:apply * address review comments --------- Signed-off-by: Calum Murray <[email protected]>
* [release-1.14] fix: do not build OIDC config unless enabled (knative-extensions#4021) (knative-extensions#4056) * fix: do not build OIDC config unless enabled (knative-extensions#4021) * fix: do not build OIDC config unless enabled Signed-off-by: Calum Murray <[email protected]> * feat: receiver redeploys verticles when oidc feature changes Signed-off-by: Calum Murray <[email protected]> * feat: the control plane ensures receiver restarts When config-features changes, the control plane sets a annotation on the receiver pods so that the configmap update is reconciled by k8s Signed-off-by: Calum Murray <[email protected]> * mvn spotless:apply Signed-off-by: Calum Murray <[email protected]> * cleanup: goimports Signed-off-by: Calum Murray <[email protected]> * fix: do not re-deploy verticles Signed-off-by: Calum Murray <[email protected]> * fix: features config paths are now correct Signed-off-by: Calum Murray <[email protected]> * fix java unit tests Signed-off-by: Calum Murray <[email protected]> * mvn spotless:apply Signed-off-by: Calum Murray <[email protected]> * address review comments Signed-off-by: Calum Murray <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]> * fix: compilation errors Signed-off-by: Calum Murray <[email protected]> * goimports Signed-off-by: Calum Murray <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]> * usage of CopyOnWriteArrayList/AtomicRef Signed-off-by: Matthias Wessendorf <[email protected]> * using concurrent hash map and atomic integer for ids Signed-off-by: Matthias Wessendorf <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]> Signed-off-by: Matthias Wessendorf <[email protected]> Co-authored-by: Calum Murray <[email protected]>
* fix: do not build OIDC config unless enabled (knative-extensions#4021) (knative-extensions#4055) * fix: do not build OIDC config unless enabled * feat: receiver redeploys verticles when oidc feature changes * feat: the control plane ensures receiver restarts When config-features changes, the control plane sets a annotation on the receiver pods so that the configmap update is reconciled by k8s * mvn spotless:apply * cleanup: goimports * fix: do not re-deploy verticles * fix: features config paths are now correct * fix java unit tests * mvn spotless:apply * address review comments --------- Signed-off-by: Calum Murray <[email protected]> * usage of CopyOnWriteArrayList/AtomicRef Signed-off-by: Matthias Wessendorf <[email protected]> * using concurrent hash map and atomic integer for ids Signed-off-by: Matthias Wessendorf <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]> Signed-off-by: Matthias Wessendorf <[email protected]> Co-authored-by: Calum Murray <[email protected]>
Temporary fix for #3901 (this does not fix the underlying problem as far as I can tell, but will enable anyone not interested in OIDC to use 1.14+)
Proposed Changes
Main
class to allow for redeploying the receiver verticles when the OIDC config changesconfig-features
configmap, so that the receiver quickly picks up on changes to feature flags.Release Note