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

Template cannot fill keys with parameters #9321

Closed
sosiouxme opened this issue Jun 14, 2016 · 4 comments
Closed

Template cannot fill keys with parameters #9321

sosiouxme opened this issue Jun 14, 2016 · 4 comments
Assignees

Comments

@sosiouxme
Copy link
Member

sosiouxme commented Jun 14, 2016

When filling in a template it is helpful to be able to vary the keys, e.g. for label names or annotation names. But you can't; only values appear to get substitutions from template parameters.

Version

oc v1.3.0-alpha.1-189-gde2a8bc-dirty
kubernetes v1.3.0-alpha.1-331-g0522e63

Steps To Reproduce
  1. Create a template like the following:

      apiVersion: "v1"
      kind: "Template"
      parameters:
      -
        description: "Annotation name to enable dynamic provisioning for the PVC, if available"
        name: DYNAMIC
        value: dynamic-provisioning-disabled
      metadata:
        name: logging-pvc-template
        annotations:
          description: "Template for deploying logging support entities: persistentvolumeclaims."
          tags: "infrastructure"
        labels:
          logging-infra: support
      labels:
        logging-infra: support
        provider: openshift
        component: support
      objects:
      -
        apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: foo
          annotations:
            "volume.alpha.kubernetes.io/${DYNAMIC}": "dynamic"
        spec:
          accessModes:
          - ReadWriteOnce
          resources:
            requests:
              storage: "1"
    
  2. Invoke it e.g.:

    $ oc process -f /tmp/template.yaml -v DYNAMIC=foo | grep dynamic

Current Result
                "volume.alpha.kubernetes.io/${DYNAMIC}": "dynamic"
Expected Result
                "volume.alpha.kubernetes.io/foo": "dynamic"
@liggitt
Copy link
Contributor

liggitt commented Jun 14, 2016

I know we're trying to limit feature additions to templates to ease transitioning to eventual upstream templating... @bparees, this seem likely or not?

@deads2k
Copy link
Contributor

deads2k commented Jun 14, 2016

Opened #9324 so we can argue about whether we want it, not about whether or not it will be hard.

@bparees
Copy link
Contributor

bparees commented Jun 14, 2016

it seems reasonable to me.

@sosiouxme
Copy link
Member Author

thanks!

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

4 participants