-
Notifications
You must be signed in to change notification settings - Fork 212
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
Handle wiring images #708
Handle wiring images #708
Conversation
7157b49
to
2a2b5e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Couple of Q's:
- Do these changes address the TODO in https://github.com/deislabs/porter/blob/master/pkg/manifest/manifest.go#L50-L51 ?
- Perhaps as a follow-up, it seems like the
OriginalImage
field in theImageMap
struct is no longer needed? https://github.com/deislabs/porter/blob/master/pkg/manifest/manifest.go#L264 (Or do we want to start populating/using it?)
@vdice nixed the Original Image and TODO comments |
I have an impending update of the relocation mapping. The format I had seen before isn't what is there for reals, so fixing that up at the moment. |
OK, this is updated now. The image relocation map looks like:
Which means, we need to reverse from the bundle.json's image -> the name in the map in order to connect it back to the porter manifest. PR was updated to handle this and error if mappings are provided that don't exist. I suppose we could be more lenient in those cases, but I went with more strict to start out with. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -102,6 +105,31 @@ func (p *Porter) Run(opts RunOptions) error { | |||
return err | |||
} | |||
|
|||
//Update the runtimeManifest images with the bundle.json and relocation mapping (if it's there) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: In a follow up, it would be nice to wrap this all up in a function in this same file so that Run
continues to be pretty readable at a high level. Maybe handleRelocationImages
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, i'll do a follow up. I think i want to do a refactor of a bunch of the logic here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah based on the touched file list you showed me, a refactor doesn't seem like a bad idea if you have ideas on how to improve the abstraction.
What does this change
This change introduces additional run time wiring logic for the mustache like
bundle.images
functionality. When a bundle is executed, thebundle.json
and an optionalrelocation-mapping.json
file can be mounted into the invocation image. These can override the values present in theporter.yaml
(which is inserted into the invocation image at build). The values provided by thebundle.json
andrelocation-mapping.json
should override what is in theporter.yaml
manifest.What issue does it fix
Closes #692
Notes for the reviewer
👋 🌵
Checklist