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

Improve labels handling #19

Open
etiennetremel opened this issue Nov 29, 2018 · 0 comments
Open

Improve labels handling #19

etiennetremel opened this issue Nov 29, 2018 · 0 comments

Comments

@etiennetremel
Copy link
Contributor

Currently, we remove labels based on a list of YAML keys which could break the initial chart. For example, if a custom resource definition contains a key with the same name as provided in the list to remove and this key has nothing to do with labels, then it will break:

apiVersion: custom/v1
kind: MyCustomResource
metadata:
  name: my-custom-resource
spec:
  something:
    labels: # << this shouldn't be removed but helm-convert will remove it
      someConfig: someValue
      someMoreConfig:
        labels:  ## << this should be removed
           some: label
        someMoreNestedConfig: someValue

To prevent this to happen, we could create a map of safe path per resource using the following format which could be parsed into a GVK type <api group>/<api version>/<kind>:

paths := map[string][]string{} {
  "custom/v1/MyCustomResource": []string{
    "spec.something.labels.someMoreConfig.labels",
  },
}

By doing so we would need to provide the path of all the resources and make it possible to pass custom path via the CLI.

For natives resources (apps/v1, policy/v1beta1, etc.). We can keep the current behavior.

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