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

Introduce a feature to propagate the machine name to user data and as label to the node #919

Merged
merged 7 commits into from
Aug 12, 2024

Conversation

oliver-goetz
Copy link
Member

What this PR does / why we need it:
This PR adds two new features to MCM which are required to enable node-agent-authorizer webhook based authentication for gardener-node-agent. Please see gardener/gardener#10014

  • MCM replaces the magic string <<MACHINE_NAME>> in user data with the name of the machine when it is bootstrapped.
  • MCM adds the name of the machine to node.gardener.cloud/machine-name label of the corresponding node.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

MCM replaces the magic string `<<MACHINE_NAME>>` in user data with the name of the machine when it is bootstrapped.
MCM adds the name of the machine to `node.gardener.cloud/machine-name` label of the corresponding node.

@oliver-goetz oliver-goetz requested a review from a team as a code owner June 21, 2024 12:46
@gardener-robot gardener-robot added needs/review Needs review size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Jun 21, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 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 Jun 21, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 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 Jun 21, 2024
Copy link
Contributor

@rishabh-11 rishabh-11 left a comment

Choose a reason for hiding this comment

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

Can you also move the code in pkg/util/provider/machinecontroller/machine_name.go and pkg/util/provider/machinecontroller/machine_bootstrap_token.go into a new file called userdata.go at pkg/util/provider/machinecontroller/? This way we have all the userdata related code in one place and can add more code in it if required in the future instead of creating new files everytime

pkg/util/provider/machineutils/utils.go Outdated Show resolved Hide resolved
@gardener-robot gardener-robot added the needs/changes Needs (more) changes label Jun 27, 2024
@gardener-robot gardener-robot added size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) and removed size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Jul 1, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 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 Jul 1, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 removed 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 Jul 1, 2024
@oliver-goetz
Copy link
Member Author

Thanks for reviewing. I just applied your feedback.

@oliver-goetz oliver-goetz requested a review from rishabh-11 July 1, 2024 15:55
Copy link
Contributor

@rishabh-11 rishabh-11 left a comment

Choose a reason for hiding this comment

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

Minor changes needed. Rest looks good

pkg/util/provider/machinecontroller/machine_util.go Outdated Show resolved Hide resolved
pkg/util/provider/machinecontroller/machine_util.go Outdated Show resolved Hide resolved
@oliver-goetz oliver-goetz requested a review from rishabh-11 July 3, 2024 05:46
@gardener-robot-ci-1 gardener-robot-ci-1 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 Jul 3, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed 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 Jul 3, 2024
Copy link
Contributor

@rishabh-11 rishabh-11 left a comment

Choose a reason for hiding this comment

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

One minor change.

pkg/util/provider/machinecontroller/machine_util.go Outdated Show resolved Hide resolved
@gardener-robot-ci-1 gardener-robot-ci-1 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 Jul 4, 2024
@oliver-goetz oliver-goetz requested a review from rishabh-11 July 4, 2024 08:36
@gardener-robot-ci-3 gardener-robot-ci-3 removed 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 Jul 4, 2024
Copy link
Contributor

@rishabh-11 rishabh-11 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 Jul 4, 2024
@gardener-robot gardener-robot removed needs/changes Needs (more) changes needs/review Needs review labels Jul 4, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 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 Jul 4, 2024
@rishabh-11 rishabh-11 removed the reviewed/lgtm Has approval for merging label Jul 4, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 removed 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 Jul 17, 2024
Copy link
Contributor

@rishabh-11 rishabh-11 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 Aug 1, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 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 1, 2024
@rishabh-11 rishabh-11 merged commit 724056d into gardener:master Aug 12, 2024
8 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Aug 12, 2024
@oliver-goetz oliver-goetz deleted the enh/machine-name-file branch August 26, 2024 10:42
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 reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/m Size of pull request is medium (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.

7 participants