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

make addon argocd application names lower case #47

Open
csantanapr opened this issue Apr 14, 2024 · 2 comments
Open

make addon argocd application names lower case #47

csantanapr opened this issue Apr 14, 2024 · 2 comments

Comments

@csantanapr
Copy link
Member

csantanapr commented Apr 14, 2024

In all addons argocd app follow the pattern to specify the name using cluster name, but the cluster name can have upper case letters like using EKS cluster name "Carlos Cluster" we need to lower case and replace space with dash -

For example in https://github.com/gitops-bridge-dev/gitops-bridge-argocd-control-plane-template/blob/main/bootstrap/control-plane/addons/aws/addons-aws-load-balancer-controller-appset.yaml#L41

  template:
    metadata:
      name: addon-{{name}}-{{values.addonChart}}

We need to convert appset to goTemplate issue #46
Then use sprig function lower for example

  template:
    metadata:
      name: addon-{{.name | lower}}-{{.values.addonChart}}
@csantanapr
Copy link
Member Author

This will address when user see the following error

Error: metadata.0.name a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. '[example.com](http://example.com/)', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
│
│   with module.gitops_bridge_bootstrap.kubernetes_secret_v1.cluster[0],
│   on .terraform/modules/gitops_bridge_bootstrap/main.tf line 127, in resource "kubernetes_secret_v1" "cluster":
│  127:     name        = local.argocd.metadata.name

@csantanapr
Copy link
Member Author

Found a better solution for this use {{nameNormalized}} ('name' but normalized to contain only lowercase alphanumeric characters, '-' or '.') instead of {{name}}

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

No branches or pull requests

1 participant