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 support of templatePatch in ApplicationSet (on ArgoCD 2.10) #368

Open
dtrouillet opened this issue Feb 20, 2024 · 9 comments
Open

Add support of templatePatch in ApplicationSet (on ArgoCD 2.10) #368

dtrouillet opened this issue Feb 20, 2024 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@dtrouillet
Copy link
Contributor

Description

A new parameter named templatePatch allow to add more control on Application template in ApplicationSet. More information here

Potential Terraform Configuration

locals {
  mytemplate = <<EOT
      spec:
      source:
        helm:
          valueFiles:
          {{- range $valueFile := .valueFiles }}
            - {{ $valueFile }}
          {{- end }}
    {{- if .autoSync }}
      syncPolicy:
        automated:
          prune: {{ .prune }}
    {{- end }}
    EOT
  project = "my-project"
}

resource "argocd_application_set" "test" {
  metadata {
    name      = "my-applicationset"
    namespace = "argocd"
  }

  spec {
    generator {
      clusters {
        selector {
          match_labels = {
            "env" = "qa"
          }
        }
      }
    }
    go_template = true
    templatePatch = local.mytemplate
    template {
      metadata {
        name = "test-{{ .name }}"
      }
      spec {
        destination {
          namespace = "my-ns"
          server    = "{{ .server }}"
        }
        project = local.project

        source {
          repo_url        = "{{ .url  }}"
          path            = "{{ .chart  }}"
          target_revision = "{{ .branch  }}"
        }
      }
      source {
        repo_url        = "{{ .url }}"
        ref             = "local"
        target_revision = "{{ .branch }}"
        path            = ""
      }
    }
  }
}

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@dtrouillet dtrouillet added the enhancement New feature or request label Feb 20, 2024
@KyriosGN0
Copy link

Hey, I would like to work on this,
I'll try to open a PR this weekend

@KyriosGN0
Copy link

KyriosGN0 commented May 9, 2024

Hi, @dtrouillet, @onematchfox, in order to use templatePatch from the go package we need to update to argocd go dep to 2.10 at least,
is there some guide on how to upgrade dependency of the project?
i've tried some thing but it is breaking the build, seems to be some transitive dependency

Copy link

github-actions bot commented Oct 3, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Oct 3, 2024
@dtrouillet
Copy link
Contributor Author

not stale

@KyriosGN0
Copy link

@dtrouillet is there a plan to upgrade the argocd dep to 2.10+ ?

@the-technat
Copy link
Collaborator

@KyriosGN0 would you mind opening an issue for the dep update? Then we can discuss about the update there.

But from my point of view it's something we have to do soon as it's also sort of linked to #443

@KyriosGN0
Copy link

I'll try to take a look in the next couple of days since the bump wad merged

@the-technat
Copy link
Collaborator

@KyriosGN0 do you want that I assign you the issue?

@KyriosGN0
Copy link

@the-technat yes thank you

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

No branches or pull requests

3 participants