-
Notifications
You must be signed in to change notification settings - Fork 21
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
coreos-meta-translator: add gcp cloud launchable to release.json #112
Conversation
Continuation of #109, somehow GH does not allow me to reopen the PR, so moved to here. |
This change works with coreos/fedora-coreos-releng-automation#112 and adds the name, family and project metadata for GCP cloud launchable image from release.json to $stream.json. Signed-off-by: Allen Bai <[email protected]>
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, though for some reason trying to parse this makes my brain hurt. One code comment suggestion.
9697d71
to
d5251ac
Compare
coreos-meta-translator/trans.py
Outdated
arch_dict["media"]["gcp"] = arch_dict["media"].get("gcp", {}) | ||
arch_dict["media"]["gcp"]["image"] = arch_dict["media"]["gcp"].get("image", {}) | ||
arch_dict["media"]["gcp"]["image"].update(input_.get("gcp", {})) | ||
if arch_dict["media"]["gcp"]["image"].get("image", None) is not None: |
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.
Should this be conditional? Feels like it should be an error if image
wasn't in the input, no? IOW, can we drop this and instead just let pop
error out if it's missing?
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.
Emm.. I think this condition will always be true, since arch_dict["media"]["gcp"]["image"].update(input_.get("gcp", {}))
made sure it is at least a {}
. Anyway this is redundant, dropping this
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.
Updated
d5251ac
to
40a6bbc
Compare
This change works with coreos/fedora-coreos-releng-automation#112 and adds the name, family and project metadata for GCP cloud launchable image from release.json to $stream.json. Signed-off-by: Allen Bai <[email protected]>
Adds GCP cloud launchable name, family and project on the download page. This works along side with - coreos/fedora-coreos-releng-automation#112 to add GCP info in release.json - coreos/fedora-coreos-stream-generator#11 to add GCP info in ${stream}.json This change reads metadata from ${stream}.json and renders it. It is also possible to read directly from individual meta.json file but since the download page is already utilizing ${stream}.json, this changes is trying to make use of already fetched metadata instead of fetching another meta.json. Closes: coreos/fedora-coreos-tracker#494 Signed-off-by: Allen Bai <[email protected]>
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.
One comment, but LGTM as is too.
coreos-meta-translator/trans.py
Outdated
arch_dict["media"]["gcp"] = arch_dict["media"].get("gcp", {}) | ||
arch_dict["media"]["gcp"]["image"] = arch_dict["media"]["gcp"].get("image", {}) | ||
arch_dict["media"]["gcp"]["image"].update(input_.get("gcp", {})) | ||
arch_dict["media"]["gcp"]["image"]["name"] = arch_dict["media"]["gcp"]["image"].pop("image", None) |
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.
My suggestion is to make it a hard error so we don't silently continue if image
is missing from meta.json
:
arch_dict["media"]["gcp"]["image"]["name"] = arch_dict["media"]["gcp"]["image"].pop("image", None) | |
arch_dict["media"]["gcp"]["image"]["name"] = arch_dict["media"]["gcp"]["image"].pop("image") |
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.
Oh I see, and the previous pop("image")
too. Updatinged
Related: coreos/fedora-coreos-tracker#494 Signed-off-by: Allen Bai <[email protected]>
40a6bbc
to
145a438
Compare
As AMIs have their own field
images
under theaws
key, I think it might make sense for GCP to follow the same rule, adding animage
field under thegcp
key and rename the originalimage
key toname
.If this is reasonable, it should be followed by updating
fedora-coreos-stream-generator
to support this PR. Finally, download page could read the GCP cloud launchable metadata from e.g.stable.json
instead ofmeta.json
Related: coreos/fedora-coreos-tracker#494
Signed-off-by: Allen Bai [email protected]