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

Remove unused code, fix guestinfo data paths #166

Merged
merged 2 commits into from
Feb 24, 2020

Conversation

chrisjs
Copy link
Contributor

@chrisjs chrisjs commented Feb 22, 2020

No description provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 22, 2020
@chrisjs
Copy link
Contributor Author

chrisjs commented Feb 22, 2020

/assign @ncdc

@detiber
Copy link
Member

detiber commented Feb 22, 2020

/lgtm
/assign @codenrhoden

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 22, 2020
Copy link
Contributor

@codenrhoden codenrhoden left a comment

Choose a reason for hiding this comment

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

After looking at this a little closer, I think there is a simpler way, and one that satisfies shellcheck.

-e "guestinfo.userdata='$(base64 -w0 <build/images/cloudinit/user-data)'" \
-e "guestinfo.metadata='$(base64 -w0 <build/images/cloudinit/meta-data)'"
-e "guestinfo.userdata='$(base64 -w0 <$( cd "$( dirname "$0" )" && pwd )/../cloudinit/user-data)'" \
-e "guestinfo.metadata='$(base64 -w0 <$( cd "$( dirname "$0" )" && pwd )/../cloudinit/meta-data)'"
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't tried it, but this looks weird to me. why the pwd call? Also, it seems like a couple sets of nested double-quotes without escaping...

shellcheck also does not like this:

$ shellcheck image-govc-cloudinit.sh

In image-govc-cloudinit.sh line 72:
  -e "guestinfo.userdata='$(base64 -w0 <$( cd "$( dirname "$0" )" && pwd )/../cloudinit/user-data)'" \
                                        ^-- SC2046: Quote this to prevent word splitting.


In image-govc-cloudinit.sh line 73:
  -e "guestinfo.metadata='$(base64 -w0 <$( cd "$( dirname "$0" )" && pwd )/../cloudinit/meta-data)'"
                                        ^-- SC2046: Quote this to prevent word splitting.

I might suggest an alternative. Rather than deleting the cd "$(dirname "${BASH_SOURCE[0]}")/.." above, keep it, and change build/images/cloudinit/... to cloudinit/....

The way I see it, we've basically changed from do a cd to the directory above us once to doing it twice. Any compelling reason to do that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see why the pwd now. But still, I think there's a much simpler way. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was just more explicit in terms of reading for me, but the suggestion is fine and have pushed an update to reflect

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 24, 2020
@chrisjs
Copy link
Contributor Author

chrisjs commented Feb 24, 2020

/assign @codenrhoden

@codenrhoden
Copy link
Contributor

/lgtm
/approve

Thanks!

It has obviously been a while someone used that script. Clearly not since the project was moved over into this repo and the directory structure changed. :)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 24, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrisjs, codenrhoden

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2020
@k8s-ci-robot k8s-ci-robot merged commit e3cf709 into kubernetes-sigs:master Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants