Skip to content

commonLabels and commonAnnotations#188

Merged
oliverguenther merged 4 commits intoopf:mainfrom
famfop:commonlabels
Sep 19, 2025
Merged

commonLabels and commonAnnotations#188
oliverguenther merged 4 commits intoopf:mainfrom
famfop:commonlabels

Conversation

@famfop
Copy link
Contributor

@famfop famfop commented Apr 1, 2025

Edit:
This PR fixes setting labels and annotations on resources. Using bitnami/common's commonLabels and commonAnnotations, "global" labels and annotations may be set which will be added to all resources.

On certain resources, i.e. for cron, ingress, persistence, seederJob, serviceAccount and openproject "custom annotations may be set, which will be added together with the commonAnnotations.

I tested it with helm template test-release . -f customvalues.yaml where my customvalues.yaml looks like:

commonLabels:
  environment: staging
  testlabel: asdf
commonAnnotations:
  testAnnotation: hello
cron:
  annotations:
    customAnnotation: crontest
ingress:
  annotations:
    customAnnotation: ingresstest
persistence:
  annotations:
    customAnnotation: persistencetest
seederJob:
  annotations:
    customAnnotation: seederjobtest
serviceAccount:
  annotations:
    customAnnotation: serviceaccounttest
openproject:
  annotations:
    customAnnotation: openprojecttest
memcached:
  commonLabels:
    environment: staging
    testlabel: asdf
  commonAnnotations:
    testAnnotation: hellomemcached
postgresql:
  commonLabels:
    environment: staging
    testlabel: asdf
  commonAnnotations:
    testAnnotation: hellopostgres

Note that memcached and postgresql need the labels and annotations to be passed again as they are not being added automatically (thus doubling config).


Original PR message:
also, add commonLabels as empty dicts in values.yaml "for visibility".

This PR tries to fix the issue stated in issue #178

EDIT: Note, all "matchLabels" used in selectors were NOT checked, I only tested for setting custom labels which did work with this dummy customlabels.yaml

commonLabels:
  environment: staging
  testlabel: asdf
memcached:
  commonLabels:
    environment: staging
    testlabel: asdf
postgresql:
  commonLabels:
    environment: staging
    testlabel: asdf

@changeset-bot
Copy link

changeset-bot bot commented Apr 1, 2025

🦋 Changeset detected

Latest commit: a3f6bf0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@openproject/helm-charts Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@famfop famfop changed the title switch to passing commonLabels dict explicitly commonLabels and commonAnnotations Apr 2, 2025
@xeruf
Copy link
Contributor

xeruf commented May 19, 2025

would love to see that merged, we have a similar issue with velero needing labels!

Copy link
Member

@oliverguenther oliverguenther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this got lost for so long, but I've finally found time to include this. I extended it with a spec to ensure coverage and allow additional labels per web/worker deployment.

@oliverguenther oliverguenther merged commit 8103ece into opf:main Sep 19, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants