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

Overlays: references have to be updated when renaming a resource #5

Open
squaremo opened this issue Dec 27, 2018 · 1 comment
Open

Comments

@squaremo
Copy link
Member

In anticipation of #3: in places where the original name of a resource is modified, the name should be updated wherever it's used.

For example, a generated ConfigMap has a static name give in the config, which is used wherever it's referred to in other resources e.g., as a volume in some file deployment.yaml. But the name of the ConfigMap when it's printed out will (by default) have a hash appended to it, and that name has to then be the one used in deployment.yaml when it is printed out.

@squaremo
Copy link
Member Author

squaremo commented Jan 8, 2019

Sketch: an invocation of overlay should return a map of the names to the transformed names; at the top level of composition, all resources then get traversed and any fields which have a LocalObjectRef are replaced. It may make bookkeeping easier to make the return value Map name resource (rather than returning the map and the resources separately).

This raises some questions about how renaming is supposed to work, though:

  • the most basic question is do renames get piled up when you compose overlays? (e.g., you might add -dev to all the names in one overlay, then prepend clusterA- in another -- do you end up with clusterA-foobar-dev? I think so).
  • if you have not assigned a namespace to a resource, how is it addressed by other transformations? Will a patch that mentions a namespace be applied, either before or after an overlay gives the resource a namespace? Can the namespace be changed by an intervening overlay?

These can all surely be elucidated with some experiments.

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

1 participant