Skip to content
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

Add 'labels' to the Helm chart to simplify the declaration of labels #1876

Open
wants to merge 7 commits into
base: devel
Choose a base branch
from

Conversation

sbilque
Copy link
Contributor

@sbilque sbilque commented May 28, 2024

SUMMARY

Add labels to the Helm chart to simplify the declaration of custom labels.

ISSUE TYPE
  • New or Enhanced Feature
ADDITIONAL INFORMATION
  • This change allows the labels defined in the additional_labels parameters to be specified in the same values.xml file.
  • These labels are also added to the awx-operator-controller-manager pod. Useful when labels are used to control pod creation based on label rules.

Sample of values.xml

AWX:
  enabled: true
  labels:
    my/team: "foo"
    my/service: "bar"
    my/do-not-inherit: "yes"
  name: awx
  spec:
    additional_labels:
    - my/team
    - my/service

Resulting ressources:
Definitions are truncated to make this easier to read.

apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx-demo
  labels:
    my/team: foo
    my/service: bar
    my/do-not-inherit: yes
spec:
  additional_labels:
  - my/team
  - my/service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: awx-operator-controller-manager
  labels:
    control-plane: controller-manager
    helm.sh/chart: awx-operator
    my/team: foo
    my/service: bar
    my/do-not-inherit: yes
spec:
  template:
    metadata:
      labels:
        control-plane: controller-manager
        helm.sh/chart: awx-operator
        my/team: foo
        my/service: bar
        my/do-not-inherit: yes        

@sbilque sbilque changed the title Add 'labels' to the Helm chart to simplify the declaration of labels Add 'labels' to the Helm chart to simplify the declaration of custom labels May 28, 2024
@sbilque sbilque changed the title Add 'labels' to the Helm chart to simplify the declaration of custom labels Add 'labels' to the Helm chart to simplify the declaration of labels May 28, 2024
@rooftopcellist
Copy link
Member

Can someone from the community who uses helm give this a try?

@rooftopcellist rooftopcellist self-requested a review July 3, 2024 18:26
@rooftopcellist rooftopcellist enabled auto-merge (squash) July 3, 2024 18:27
@djyasin
Copy link
Member

djyasin commented Jul 24, 2024

@sbilque thank you so much for your contribution! Would you mind rebasing and resolving the merge conflicts? Thank you for your time!

Copy link

sonarcloud bot commented Jul 25, 2024

auto-merge was automatically disabled July 26, 2024 15:27

Head branch was pushed to by a user without write access

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

Successfully merging this pull request may close these issues.

3 participants