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

Optional pipeline steps: enabled=false boolean #2306

Open
karlkfi opened this issue Jun 22, 2021 · 4 comments
Open

Optional pipeline steps: enabled=false boolean #2306

karlkfi opened this issue Jun 22, 2021 · 4 comments
Labels
area/hydrate enhancement New feature or request p1 triaged Issue has been triaged by adding an `area/` label

Comments

@karlkfi
Copy link
Contributor

karlkfi commented Jun 22, 2021

I want to be able to ship kpt packages with optional features, but kpt doesn't have any conditional code blocks.

One way to satisfy this requirement would be to add an enabled boolean to the pipeline step syntax in kpt v1. This would allow kptfiles to include steps that are disabled by default, allowing users to enable them with a one-line change.

An optional additional enhancement would be a CLI command for toggling steps by name:

kpt pipeline step enable "step-name"
@karlkfi karlkfi added the enhancement New feature or request label Jun 22, 2021
@bgrant0607
Copy link
Contributor

Sounds useful.

I wanted something similar for kustomize at some point.

@karlkfi
Copy link
Contributor Author

karlkfi commented Jun 22, 2021

Hypothetical example:

Kptfile:

pipeline:
  mutators:
  - image: gke-security-group
    configMap:
      domain: environblueprint.joonix.net
      parent: gke-security-groups
      create: true
      groups:
      - group1
      - group2
    enabled: false

This example would call a function to set the spec.authenticatorGroupsConfig.securityGroup on any ContainerCluster in the package, and make the group in Google Workspaces if it didn't already exist, but would be disabled by default, because not all users of the GKE clusters have a Google Workspace or Cloud Identity subscription.

This would allow reducing the dependencies of the package by default and making groups an optional dependency.

@frankfarzan
Copy link
Contributor

frankfarzan commented Jun 22, 2021

The use case makes sense to me. This will be a post-v1 additive change. Exact design for schema and CLI porcelain (if any) TBD.

@frankfarzan frankfarzan added this to the v1.1 milestone Jun 22, 2021
@frankfarzan frankfarzan added area/hydrate triaged Issue has been triaged by adding an `area/` label labels Jun 22, 2021
@bgrant0607
Copy link
Contributor

@droot mentioned a use case for this in #2284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hydrate enhancement New feature or request p1 triaged Issue has been triaged by adding an `area/` label
Projects
None yet
Development

No branches or pull requests

5 participants