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

Support URL encoded bootstrap token replacement #743

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

Gerrit91
Copy link
Contributor

@Gerrit91 Gerrit91 commented Aug 26, 2022

What this PR does / why we need it:

In metal-stack we do not use the wide-spread software cloud-init for preparing cloud instances but Ignition. The Ignition userdata format encodes data with URL scheme, such that special characters are not contained in user-given contents of the userdata.

The current code patches a placeholder <<BOOTSTRAP_TOKEN>> in order to enrich the userdata with a node's bootstrap token. As the placeholder contains special characters, the string replacement does not work for Ignition-formatted userdata, which looks like:

...
"path":"/var/lib/cloud-config-downloader/credentials/bootstrap-token","contents":{"source":"data:,%3C%3CBOOTSTRAP_TOKEN%3E%3E","verification":{}}
...

This PR allows detecting the URL-encoded placeholder as well and properly replaces the bootstrap token into the userdata.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

Bootstrap token replacement by MCM is now supported for Ignition userData format

@Gerrit91 Gerrit91 requested a review from a team as a code owner August 26, 2022 08:12
@gardener-robot
Copy link

@Gerrit91 Thank you for your contribution.

@gardener-robot
Copy link

@Gerrit91 You need rebase this pull request with latest master branch. Please check.

@gardener-robot gardener-robot added needs/rebase Needs git rebase needs/review Needs review size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Aug 26, 2022
@gardener-robot-ci-2
Copy link
Contributor

Thank you @Gerrit91 for your contribution. Before I can start building your PR, a member of the organization must set the required label(s) {'reviewed/ok-to-test'}. Once started, you can check the build status in the PR checks section below.

@himanshu-kun himanshu-kun added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Aug 26, 2022
@gardener-robot-ci-2 gardener-robot-ci-2 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Aug 26, 2022
Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/rebase Needs git rebase needs/review Needs review labels Aug 26, 2022
@himanshu-kun himanshu-kun added the needs/second-opinion Needs second review by someone else label Aug 26, 2022
@gardener-robot gardener-robot removed the reviewed/lgtm Has approval for merging label Aug 26, 2022
@himanshu-kun
Copy link
Contributor

/invite @unmarshall

@gardener-robot
Copy link

@unmarshall You have pull request review open invite, please check

Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

looks good, a more generic name would help

@himanshu-kun
Copy link
Contributor

@Gerrit91 we are planning to make a release by EoD
Please make the changes if you want it to be included in the next release.

@Gerrit91
Copy link
Contributor Author

Gerrit91 commented Sep 6, 2022

Hey @himanshu-kun. Thanks for review. I integrated your change request into the PR and rebased onto master.

Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added the reviewed/lgtm Has approval for merging label Sep 6, 2022
@gardener-robot gardener-robot removed needs/review Needs review needs/second-opinion Needs second review by someone else labels Sep 6, 2022
@himanshu-kun himanshu-kun added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Sep 6, 2022
@gardener-robot-ci-3 gardener-robot-ci-3 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Sep 6, 2022
@himanshu-kun himanshu-kun changed the title Support bootstrap tokens for Ignition userdata format Support URL encoded bootstrap token replacement Sep 6, 2022
@himanshu-kun himanshu-kun merged commit d5e2aaf into gardener:master Sep 6, 2022
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Sep 6, 2022
@Gerrit91 Gerrit91 deleted the support-ignition branch September 6, 2022 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging size/s Size of pull request is small (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants