Watch for keystone-overrides#795
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fmount 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 |
d07c59f to
b0508a9
Compare
| if ls := secret.GetLabels(); ls != nil { | ||
| lSelector := labels.GetLabelSelector(ls) | ||
| kSelector := labels.GetLabelSelector(keystonev1.KeystoneOverridesLabelSelector) | ||
| if labels.EqualLabelSelectors(lSelector, kSelector) { |
There was a problem hiding this comment.
@Deydra71 labels.EqualLabelSelectors is available in lib-common: openstack-k8s-operators/lib-common#638 and it is useful here where we want to trigger a reconcile based on a set of labels extracted from the secret.
We expect the secret labels to be the same of what is defined in keystonev1.KeystoneOverridesLabelSelector, which is instead available in keystone-operator: openstack-k8s-operators/keystone-operator#625.
This way this logic has minimal dependencies on the object that the controller reconciles, and minimize the amount of changes required in a service operator.
|
@Deydra71 I think I reduced as much as possible the amount of code required in the service operator.
By doing this is very easy to consume the same function on a different operator and copy/paste the same pattern. I'll verify this with Manila. |
This patch implements a watcher over keystone-overrides secrets based on a particular labelSelector. By doing this it is possible to extract and process keystone parameters (auth_url, www_authenticate_uri, region) and override the default information. Signed-off-by: Francesco Pantano <fpantano@redhat.com>
|
PR needs rebase. DetailsInstructions 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. |
|
Closing as we discussed a different (better) solution |
This patch implements a watcher over keystone-overrides secrets based on a particular labelSelector. By doing this it is possible to extract and process keystone parameters (auth_url, www_authenticate_uri, region) and override the default information.