longhorn-manager icon indicating copy to clipboard operation
longhorn-manager copied to clipboard

feat(webhook selector): add longhorn-manager labels when webhook ready.

Open james-munson opened this issue 1 year ago • 3 comments
trafficstars

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

james-munson avatar Jun 28 '24 23:06 james-munson

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?

derekbit avatar Jun 30 '24 15:06 derekbit

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.

james-munson avatar Jul 01 '24 16:07 james-munson

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?

derekbit avatar Jul 02 '24 01:07 derekbit

This pull request is now in conflict. Could you fix it @james-munson? 🙏

mergify[bot] avatar Jul 11 '24 00:07 mergify[bot]

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.

james-munson avatar Jul 16 '24 18:07 james-munson