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

Add an image-default.yaml, pass JSON to create_disk.sh #1787

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

cgwalters
Copy link
Member

The way we parse an image.yaml and then convert it
into arguments for create_disk.sh is unwieldy.

Instead, convert image.yaml into JSON, inheriting default values
from a separate image-default.yaml we ship. Then pass
that JSON to create_disk.sh.

This only converts the rootfs argument, but if people
are OK with this I can go ahead and convert everything
else - getting us to where the only argument to create_disk.sh
is a JSON file that's already been pre-validated.

@cgwalters
Copy link
Member Author

This is prep work for a larger refactoring for coreos/bootupd#50

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Looks like a nice cleanup to me! I like also that we have all the defaults in a separate YAML file.

@jlebon
Copy link
Member

jlebon commented Oct 21, 2020

I can /lgtm this if you'd prefer to convert the other ones in a separate PR.

The way we parse an `image.yaml` and then convert it
into arguments for `create_disk.sh` is unwieldy.

Instead, convert `image.yaml` into JSON, inheriting default values
from a separate `image-default.yaml` we ship.  Then pass
that JSON to `create_disk.sh`.

This only converts the `rootfs` argument, but if people
are OK with this I can go ahead and convert everything
else - getting us to where the only argument to `create_disk.sh`
is a JSON file that's already been pre-validated.
@cgwalters
Copy link
Member Author

OK rebased 🏄

@@ -92,6 +92,17 @@ remote_name="${remote_name:?--ostree-remote must be defined}"
grub_script="${grub_script:?--grub-script must be defined}"
os_name="${os_name:?--os_name must be defined}"

getconfig() {
k=$1
jq -re .$k < ${config}
Copy link
Member

Choose a reason for hiding this comment

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

Minor: could just drop <

@jlebon
Copy link
Member

jlebon commented Nov 12, 2020

/lgtm

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, jlebon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit aa689a8 into coreos:master Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants