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

Support params specific to template option selected #974

Open
xyloman opened this issue Aug 16, 2022 · 1 comment
Open

Support params specific to template option selected #974

xyloman opened this issue Aug 16, 2022 · 1 comment

Comments

@xyloman
Copy link

xyloman commented Aug 16, 2022

Description of problem

Ability to have specific parameters passed to a template when selected via options:

Proposed solution

Update options selection of the templateRef for a resource to take option specific params.

Given a templateRef with options
When parameters need to flex based upon the selected template
Then parameters specific to the selected template will be provided

Example

  - name: image-provider
    templateRef:
      kind: ClusterImageTemplate
      options:
        - name: kpack-template
          selector:
            matchFields:
              - key: spec.params[?(@.name=="dockerfile")]
                operator: DoesNotExist
              - key: spec.image
                operator: DoesNotExist
           params:
              - name: clusterBuilder
                default: #@ data.values.cluster_builder
              - name: serviceAccount
                value: kpack-image-builder-service-account
              - name: registry
                value: myregistry2.com/myrepo
        - name: kaniko-template
          selector:
            matchFields:
              - key: spec.params[?(@.name=="dockerfile")]
                operator: Exists
              - key: spec.image
                operator: DoesNotExist
          params:
              - name: dockerfile
                default: ./Dockerfile
              - name: docker_build_context
                default: ./
              - name: docker_build_extra_args
                default: []
              - name: serviceAccount
                value: docker-image-builder-service-account
              - name: registry
                value: myregistry.com/myrepo
        - name: image-provider-template
          selector:
            matchFields:
              - key: spec.image
                operator: Exists
    sources:
    - resource: source-git
      name: source
@github-actions
Copy link

Hello @xyloman! Welcome to the Cartographer community and thank you for opening your first issue, we appreciate your contributions

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