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

Enhance git generator with parameter files #20593

Open
OpenGuidou opened this issue Oct 30, 2024 · 0 comments · May be fixed by #20653
Open

Enhance git generator with parameter files #20593

OpenGuidou opened this issue Oct 30, 2024 · 0 comments · May be fixed by #20653
Labels
component:application-sets Bulk application management related enhancement New feature or request

Comments

@OpenGuidou
Copy link
Contributor

OpenGuidou commented Oct 30, 2024

Summary

I would propose to enhance the git generator to be able to fetch parameters from a file, in addition to the values directly provided as key/values

Motivation

Let's say I have two sources to templatize my Applications: a list of tenants with their configurations and a file containing the version of the application to deploy, and technical information not related to the tenants.

Today, if we want to provide values from different files to templatize an Application using an ApplicationSet, we need to create a matrix like so:

spec:
  generators:
    - matrix:
        generators:
          - git:
            repoUrl: http://myGitRepo
            revision: HEAD
            files:
              - path/to/tenants/*.yaml
            pathParamPrefix: "tenant"
          - git:
            repoUrl: http://myGitRepo
            revision: HEAD
            files:
            - path/to/appConfig/{{.tenant.version}}/appconfig.yaml

This complexifies the lisibility, especially if we multiply the number of file sources (ending up with matrix of matrix of...)

Proposal

I would propose to be able to provide extra parameters as files inside a git generator, to be applied on top of the parameters provided by the files.
This would avoid Cartesian product across generators.

spec:
  generators:
      - git:
        repoUrl: http://myGitRepo
        revision: HEAD
        files:
          - path/to/tenants/*.yaml
        pathParamPrefix: "tenant"
        extraParameterFiles:
        - path/to/another/someBaseConfig.yaml
        - path/to/appConfig/{{.tenant.version}}/appconfig.yaml

The extraParameterFiles would be merged by using a priority in the list, from bottom to top, like the helm values at Application level.
The limitation (I think acceptable) is that the files should be in the same git repo (and revision).

@OpenGuidou OpenGuidou added the enhancement New feature or request label Oct 30, 2024
@OpenGuidou OpenGuidou changed the title Enhance git generator with value files Enhance git generator with parameter files Oct 30, 2024
@todaywasawesome todaywasawesome added the component:application-sets Bulk application management related label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:application-sets Bulk application management related enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants