-
Notifications
You must be signed in to change notification settings - Fork 33
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
Conversation
PR is ready for review now that g/g@v1.82 is released |
I plan to add a few unit tests for the new |
OK, @oliver-goetz @MrBatschner @danielfoehrKn PTAL :) |
/hold |
- no longer use `oscommon` package - prepare for new OSC contract when `UseGardenerNodeAgent` feature gate is enabled
- no longer depend on `oscommon` package
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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
gardener-extension-os-gardenlinux/pkg/controller/operatingsystemconfig/actuator.go
Line 88 in e9ab9ee
func (a *actuator) handleProvisionOSC(ctx context.Context, osc *extensionsv1alpha1.OperatingSystemConfig) (string, error) { |
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Can we release this PR? |
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:
OperatingSystemConfig
API for changes needed forgardener-node-agent
gardener#8647 and a new release containing this PR, hence this PR remains in draft state until then.Kindly use the dedicated commits for an easier review process.
/cc @oliver-goetz @MrBatschner @danielfoehrKn
Release note: