Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Enhancement: ApplicationSet should support functions in template #447

Open
Shane-Williamson opened this issue Dec 29, 2021 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@Shane-Williamson
Copy link

Feature request

ApplicationSet should be able to support functions in the template section of the manifest. This should be generator-agnostic, although for our use-case, we're blocked by the scmGenerator.

Something like this pseudo-code:

template:
  metadata:
    name: {{ repository | replace "some-text" "" }}-{{ branch | replace "/" "-" | lower }}`

Use-case (as example): we want to be able to scan repos in our org that match a naming pattern for branches that match a naming pattern and deploy applications from those branches. The purpose is to support a fully automated gitops development process where developers can create specific branches in their repos and an instance of that app will be automatically deployed by ApplicationSet. This means that there will be several instances of the same app deployed in cluster so names need to be unique. After changes are merged and the branch is deleted, the application should then be deleted by ApplicationSet.

The lack of functions is blocking this in these ways:

  1. Combining the repo name with the branch name for uniqueness (e.g. {{ repository }}-{{ branch }} ) can exceed the character limit in k8s. The replace function would enable shortening the name by any matched string.
  2. We use Jira which only recognizes upper-case ticket identifiers (e.g. DEVOPS-1234). Atlassian has stated this is not something they will fix from the digging I've done. K8s does not allow upper-case resource names. So we either break Jira integration or break deployments.
  3. Our branch names have / in them which is an invalid character to k8s.
@jgwest jgwest added the enhancement New feature or request label Jan 17, 2022
@crenshaw-dev
Copy link
Member

crenshaw-dev commented Feb 24, 2022

Duplicate of #351 / #303? Potential fix here: #513

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants