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

Adapt to changes needed for gardener-node-agent #130

Merged
merged 8 commits into from Nov 24, 2023

Conversation

rfranzke
Copy link
Member

@rfranzke rfranzke commented Oct 13, 2023

How to categorize this PR?

/area os
/kind enhancement
/os garden-linux

What this PR does / why we need it:
This PR adapts this extension to changes needed for gardener-node-agent, see gardener/gardener#8647 for more information.

Which issue(s) this PR fixes:
Part of gardener/gardener#8023

Special notes for your reviewer:

Kindly use the dedicated commits for an easier review process.

/cc @oliver-goetz @MrBatschner @danielfoehrKn

Release note:

This extension is now prepared to run with an enabled `UseGardenerNodeAgent` feature gate.

@gardener-robot gardener-robot added area/os Operation system related kind/enhancement Enhancement, improvement, extension os/garden-linux Related to Garden Linux OS needs/review Needs review labels Oct 13, 2023
@gardener-robot gardener-robot added size/l Size of pull request is large (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Oct 13, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) 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 Oct 13, 2023
@gardener-robot gardener-robot added size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) and removed size/l Size of pull request is large (see gardener-robot robot/bots/size.py) labels Oct 20, 2023
@rfranzke rfranzke marked this pull request as ready for review October 20, 2023 14:19
@rfranzke rfranzke requested review from a team as code owners October 20, 2023 14:19
@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 Oct 20, 2023
@rfranzke
Copy link
Member Author

PR is ready for review now that g/g@v1.82 is released

@gardener-robot-ci-1 gardener-robot-ci-1 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 Oct 20, 2023
@rfranzke
Copy link
Member Author

I plan to add a few unit tests for the new actuator.go file early next week.

@rfranzke
Copy link
Member Author

OK, @oliver-goetz @MrBatschner @danielfoehrKn PTAL :)

@gardener-robot-ci-3 gardener-robot-ci-3 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 reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 25, 2023
@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 Oct 25, 2023
@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 Oct 25, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 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 reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 26, 2023
@rfranzke
Copy link
Member Author

/hold
Let's wait with the merge for another revendoring with gardener/gardener@v1.83.0 containing gardener/gardener#8707

- no longer use `oscommon` package
- prepare for new OSC contract when `UseGardenerNodeAgent` feature gate is enabled
- no longer depend on `oscommon` package
@gardener-robot-ci-1 gardener-robot-ci-1 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 reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 17, 2023
Copy link
Contributor

@MrBatschner MrBatschner left a comment

Choose a reason for hiding this comment

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

see inline

return osc.Object.Spec.Type == gardenlinux.OSTypeGardenLinux ||
osc.Object.Spec.Type == memoryone.OSTypeMemoryOneGardenLinux
}

// Generate generates a Garden Linux specific cloud-init script from the given OperatingSystemConfig.
func (g *GardenLinuxCloudInitGenerator) Generate(logger logr.Logger, osc *generator.OperatingSystemConfig) ([]byte, *string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I am not fully understanding the flow and/or intention but in

func (a *actuator) handleProvisionOSC(ctx context.Context, osc *extensionsv1alpha1.OperatingSystemConfig) (string, error) {
, the data for CloudInit is generated by the handleProvisionOSC() function, yet here, if useGardenerNodeAgent is false, the old template based generator is used. From what I can see, the actual output seems to be the same for both generating paths.
Can't we do away with the templater and use handleProvisionOSC() and handleReconcileOSC() exclusively for both cases?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we could, but I would prefer to keep things separate for now so that the old legacy generator can be easily deleted later when gardener-node-agent is GA and the cloud-config-downloader scenario fully disappeared. This way, we don't change anything for the current world (no gardener-node-agent in place), but just for the new feature when the feature gate is turned on. Hence, if anything goes wrong, it's just for the new scenario, not for the old one.

We still need to run the generator anyways for the migration scenario (when the UseGardenerNodeAgent feature gate is turned on for the first time) where cloud-config-downloader still runs on existing nodes. It needs to download the new user data (containing the gardener-node-agent systemd unit), so we wouldn't gain much from trying to harmonize anything now here.

@gardener-robot-ci-2 gardener-robot-ci-2 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 reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 24, 2023
Copy link
Contributor

@danielfoehrKn danielfoehrKn left a comment

Choose a reason for hiding this comment

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

Need to rework #133 after this PR is merged.
Looks good to me. I like that the gardener-node-agent simplifies the extensions even more (generation of the execution script with systemd units & files is done not in each extension, but on the node via the gardener-node-agent)

@gardener-robot-ci-1 gardener-robot-ci-1 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 reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 24, 2023
Copy link
Contributor

@MrBatschner MrBatschner 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/review Needs review needs/second-opinion Needs second review by someone else labels Nov 24, 2023
@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 Nov 24, 2023
@danielfoehrKn danielfoehrKn merged commit b42ab45 into gardener:master Nov 24, 2023
5 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Nov 24, 2023
@rfranzke rfranzke deleted the gna branch November 27, 2023 08:10
@rfranzke
Copy link
Member Author

rfranzke commented Nov 27, 2023

Can we release this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/os Operation system related kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) os/garden-linux Related to Garden Linux OS 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/xl Size of pull request is huge (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.

None yet

7 participants