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

Add extensible transformation #122

Closed
Liujingfang1 opened this issue Jun 19, 2018 · 5 comments
Closed

Add extensible transformation #122

Liujingfang1 opened this issue Jun 19, 2018 · 5 comments
Labels
kind/design Categorizes issue or PR as related to design. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@Liujingfang1
Copy link
Contributor

This is to make kustomize libraries more flexible and extensible. Consider a kustomization, if an extra transformation is allowed, then user can specify their own transformations, such as replacing certain field to other strings, filling an docker image name.

@Liujingfang1 Liujingfang1 added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 19, 2018
@Liujingfang1 Liujingfang1 added the kind/design Categorizes issue or PR as related to design. label Jun 19, 2018
@Liujingfang1
Copy link
Contributor Author

Some thoughts: an extended transformer reads in []byte and returns []byte. The transformer itself can be written in other language.
For example, a transformer that patches multiple object based on matched labels need to

  • filter the []byte to get resources to patch
  • update the matched resources
  • return the new []byte

@mxey
Copy link
Contributor

mxey commented Jul 25, 2018

When you say another language, do you mean running an external program that would need to have its own understanding of how to parse Kubernetes manifests?

I was just thinking, what about embedding Skylark? Just passing a data structure with the matching resources to a Skylark function and having the function return a modified version.

@mxey
Copy link
Contributor

mxey commented Jul 28, 2018

Actually, Jsonnet probably makes more sense than Skylark.

@monopole
Copy link
Contributor

IMO, once #300 is in and #169 is closed, we've done enough to support for creation of simple variants on a base.

ksonnet, helm et al. already provide completely general transformation languages for folks that want that sort of thing.

@Liujingfang1
Copy link
Contributor Author

With JSON patch support added and transformer configurations added, we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/design Categorizes issue or PR as related to design. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants