When importing YAML, extract objects into separate component files#462
When importing YAML, extract objects into separate component files#462bryanl merged 2 commits intoksonnet:masterfrom
Conversation
Signed-off-by: bryanl <bryanliles@gmail.com>
Since components are now one-per-file, remove the idea of indexes because they are no longer needed. Signed-off-by: bryanl <bryanliles@gmail.com>
d877cf4 to
caac460
Compare
| return errors.Errorf("unable to find metadata name of object in %s", fileName) | ||
| } | ||
|
|
||
| componentName := fmt.Sprintf("%s-%s", strings.ToLower(ts.Kind()), name) |
There was a problem hiding this comment.
unfortunately, Kind + Name is not unique identifier :( Look at Voyager Ingress for example: https://github.com/appscode/voyager/blob/master/docs/examples/ingress/types/loadbalancer/ing.yaml
it clashes with builtin Ingress.
Kind + Name + Apiversion would be unique, but at least builtin resources (Deployment, Job, etc) somehow automagically coalesce into same resource, so for them Kind + Name is unique combination.
There was a problem hiding this comment.
This is a good catch, I took a look at the built in resources and there wasn't an issue. I will follow up with a change that will handle custom resources as well.
There was a problem hiding this comment.
It's now kind-name-random.
Adding apiVersion could have made it unbearable. If this doesn't work out, We'll revisit this.
Fixes #437