Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

When importing YAML, extract objects into separate component files#462

Merged
bryanl merged 2 commits intoksonnet:masterfrom
bryanl:yaml-separate-objects
Apr 20, 2018
Merged

When importing YAML, extract objects into separate component files#462
bryanl merged 2 commits intoksonnet:masterfrom
bryanl:yaml-separate-objects

Conversation

@bryanl
Copy link
Member

@bryanl bryanl commented Apr 20, 2018

  • Create separate components for all items in YAML manifest
  • Remove component index because it isn't needed

Fixes #437

bryanl added 2 commits April 19, 2018 15:15
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>
@bryanl bryanl force-pushed the yaml-separate-objects branch from d877cf4 to caac460 Compare April 20, 2018 13:35
@bryanl bryanl merged commit 83e92d6 into ksonnet:master Apr 20, 2018
@bryanl bryanl deleted the yaml-separate-objects branch April 20, 2018 13:50
return errors.Errorf("unable to find metadata name of object in %s", fileName)
}

componentName := fmt.Sprintf("%s-%s", strings.ToLower(ts.Kind()), name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's now kind-name-random.

Adding apiVersion could have made it unbearable. If this doesn't work out, We'll revisit this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants