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

Resolution of local file references in extensions transformer configuration #4154

Open
KnVerey opened this issue Aug 30, 2021 · 6 comments
Open
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. triage/under-consideration

Comments

@KnVerey
Copy link
Contributor

KnVerey commented Aug 30, 2021

This issue continues a discussion started in #4117. As of the fix for that issue, Kustomize sets the working directory for exec function plugins to the directory in which the current Kustomization is located. This solves the problem for the default case, where the configuration layer that initially defines the transformer config is the same as the layer that executes it.

There are two more advanced use cases where a problem remains:

  1. When the transformer config is manipulated as a resource in lower Kustomization layers.
  2. [upcoming] In Composition, where patching transformer config originating in a lower layer is a standard operation.

It is more important to address this for Composition, where manipulating transformer config is a first-class operation, and Kustomize always knows whether the KRM object it is dealing with is a transformer config.

Options under discussion include:

  1. A reserved field (e.g. spec.localFilePaths) that Kustomize will always resolve relative to the current Kustomization, when present. This field would need to be harmonized with mounts.src in the function provider specification. This would be more dangerous to apply to Kustomization's resources field, though an additional restriction such as the local-resource annotation could be imposed in that context.
  2. An annotation end-users could include on their KRM config objects to trigger path resolution of JSONpath-targeted fields relative to the current Kustomization/Composition. This option would be more annoying for the end-user, but safer to apply to Kustomization's resources field (where we don't know what is a transformer config vs. normal resource).
  3. Metadata in the function schema provided through the Catalog enabling the plugin in question.

It's worth noting that although some valid extensions use cases do require file mounting, in the default case, transformer authors should be encouraged to provide as much of the input state as possible through the KRM configuration object and the input resource stream.

/kind feature
/triage under-consideration
@natasha41575

@KnVerey KnVerey added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 30, 2021
@k8s-ci-robot k8s-ci-robot added triage/under-consideration needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 30, 2021
@k8s-ci-robot
Copy link
Contributor

@KnVerey: This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@KnVerey KnVerey added this to To do in Kustomize plugin graduation via automation Aug 30, 2021
@KnVerey KnVerey removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Aug 30, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 28, 2021
@KnVerey
Copy link
Contributor Author

KnVerey commented Nov 29, 2021

/remove-lifecycle stale

I've been working on Composition recently and this is definitely a big problem for it (and the equivalent Kustomization flow, though that flow is not first-class).

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 20, 2022
@natasha41575
Copy link
Contributor

/remove-lifecycle rotten
/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Jan 20, 2022
@KnVerey
Copy link
Contributor Author

KnVerey commented May 10, 2022

The inability to identify local file references in extensions transformer configs is also a problem for a fully functional kustomize localize: #4590. The solution we choose should satisfy that use case as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. triage/under-consideration
Development

No branches or pull requests

4 participants