Skip to content

Ability to import different kcl files based on parameters #204

Open
@irizzant

Description

@irizzant

What happened?

I'd like to specify a channel parameter that can be read in my Composition file, and decide what file to import basing on that parameter.
Something like:

apiVersion: krm.kcl.dev/v1alpha1
kind: KCLInput
metadata:
  annotations:
    "krm.kcl.dev/default_ready": "True"
  name: basic
spec:
  source: |
    import file

    if _option("params")?.oxr?.spec.parameters.channel:
       file.read(_option("params")?.oxr?.spec.parameters.channel + "/something.yaml"
    else:
       file.read("default/somethingElse.yaml")

but maybe it's not feasible.

How can we reproduce it?

What environment did it happen in?

Function version:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions