longhorn-manager
longhorn-manager copied to clipboard
feat(webhook selector): add longhorn-manager labels when webhook ready.
Which issue(s) this PR fixes:
Issue longhorn/longhorn#8803 and longhorn/longhorn#8612
What this PR does / why we need it:
Add the longhorn-manager pod labels to be used as webhook service selectors dynamically after the webhooks have been started.
Special notes for your reviewer:
Note that this PR must be accompanied by the manifest changes in PR https://github.com/longhorn/longhorn/pull/8804. They depend on each other.
Additional documentation or context
As I mentioned in https://github.com/longhorn/longhorn/issues/8803#issuecomment-2192856444, the PR only adds the labels to webhook but doesn't handle the deletion. Could you help clear up my confusion?
I hope so. This PR (and https://github.com/longhorn/longhorn/pull/8804 in longhorn) just add the new selector labels. Should make no difference to normal operation. After it is committed, then I can pull the changes into my RWX HA branch, because the logic for deletion and restoration depends on conditions and checks that only exist in that branch. I did it this way, rather than just introducing it all in that branch, because it does also offer a fix for the situation described by @PhanLe1010 in https://github.com/longhorn/longhorn/issues/8612.
I hope so. This PR (and longhorn/longhorn#8804 in longhorn) just add the new selector labels. Should make no difference to normal operation. After it is committed, then I can pull the changes into my RWX HA branch, because the logic for deletion and restoration depends on conditions and checks that only exist in that branch. I did it this way, rather than just introducing it all in that branch, because it does also offer a fix for the situation described by @PhanLe1010 in longhorn/longhorn#8612.
I see. Then, let's merge the PR after RWX HA branch is ready for review. Then, we can see how webhook selector works in the implementation. WDYT?
This pull request is now in conflict. Could you fix it @james-munson? 🙏
The change in this PR has been pulled into RWX HA PR https://github.com/longhorn/longhorn-manager/pull/2811. I will close this one, since it is unlikely to be adopted on its own.