Skip to content

Conversation

@lmiccini
Copy link
Contributor

@lmiccini lmiccini commented Dec 3, 2025

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

@openshift-ci openshift-ci bot requested review from fultonj and rabi December 3, 2025 06:45
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 3, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lmiccini
Once this PR has been reviewed and has the lgtm label, please assign abays for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lmiccini lmiccini requested review from abays and stuggi and removed request for fultonj and rabi December 3, 2025 06:49
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>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 3, 2025

@lmiccini: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/openstack-operator-build-deploy-kuttl 478deb4 link true /test openstack-operator-build-deploy-kuttl

Full PR test history. Your PR dashboard.

Details

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.

fieldPath: metadata.namespace
{{- range .RabbitmqOperator.Deployment.Manager.Env }}
- name: '{{ .Name }}'
{{- if .Value }}
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants