-
Notifications
You must be signed in to change notification settings - Fork 102
Add support for configuring environment variables for operators #1718
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
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lmiccini The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
787001c to
0515f90
Compare
This change allows users to specify custom environment variables for
operator containers through the operatorOverrides field in the OpenStack
CR.
Changes:
- Add Env field to ContainerSpec in the API types
- Implement mergeEnvVars() to merge custom environment variables with defaults
- Update SetOverrides() to apply environment variable overrides
- Enhance operator deployment templates to support both Value and ValueFrom
for environment variables (supporting secrets, configmaps, and field refs)
Usage example - Configure OPERATOR_SCOPE_NAMESPACE for rabbitmq-cluster-operator:
apiVersion: operator.openstack.org/v1beta1
kind: OpenStack
metadata:
name: openstack
spec:
operatorOverrides:
- name: rabbitmq-cluster
controllerManager:
env:
- name: OPERATOR_SCOPE_NAMESPACE
value: "namespace1,namespace2,namespace3"
Co-Authored-By: Claude <noreply@anthropic.com>
0515f90 to
478deb4
Compare
|
@lmiccini: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
| fieldPath: metadata.namespace | ||
| {{- range .RabbitmqOperator.Deployment.Manager.Env }} | ||
| - name: '{{ .Name }}' | ||
| {{- if .Value }} |
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.
I guess we want the same in config/operator/managers.yaml for the other operator deployments?
This change allows users to specify custom environment variables for operator containers through the operatorOverrides field in the OpenStack CR.
Changes:
Usage example - Configure OPERATOR_SCOPE_NAMESPACE for rabbitmq-cluster-operator:
Co-Authored-By: Claude noreply@anthropic.com