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

Fix: Change Base Labels to CamelCase for ArgoCD ApplicationSets Compatibility #18

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Courtlane
Copy link
Collaborator

Description:

This pull request addresses an issue with ArgoCD ApplicationSets where labels containing '-' cannot be reused due to invalid characters. To resolve this, I have updated the base labels to use camelCase instead.

Example:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: my-applicationset
  namespace: argocd
spec:
  goTemplate: true
  goTemplateOptions: ["missingkey=zero"]
  generators:
    - clusters:
        selector:
          matchLabels:
            "clusterType": "usercluster"
        values:
          clusterId: '{{.metadata.labels.kubermatic-argocd-bridge/cluster-id}}'

Here are the log errors from ArgoCD that prompted these changes:

Message: error appending templated values for cluster: failed to replace templated string: failed to replace templated string with rendered values: failed to parse template {{.metadata.labels.kubermatic-argocd-bridge/cluster-id}}: template: :1: bad character U+002D '-'
Reason: ApplicationGenerationFromParamsError

Changes:

  • Updated all base labels to camelCase.
  • Ensured compatibility with ArgoCD ApplicationSets by removing invalid characters.

Testing:

  • Confirmed that ArgoCD ApplicationSets can now reuse the labels without issues.

Oleg Franko added 2 commits January 16, 2025 09:43
Update label keys to camel case.
ArgoCD applicationsets cannot template values with bad characters '-'
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.

1 participant