Skip to content

Commit

Permalink
Fix gardener-node-agent image tag defaulting (#8892)
Browse files Browse the repository at this point in the history
Co-authored-by: Rafael Franzke <[email protected]>
  • Loading branch information
gardener-ci-robot and rfranzke authored Dec 1, 2023
1 parent d46c463 commit 825c794
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pkg/operation/botanist/operatingsystemconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/component-base/version"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/gardener/gardener/imagevector"
Expand Down Expand Up @@ -50,16 +51,23 @@ const SecretLabelKeyManagedResource = "managed-resource"
// DefaultOperatingSystemConfig creates the default deployer for the OperatingSystemConfig custom resource.
func (b *Botanist) DefaultOperatingSystemConfig() (operatingsystemconfig.Interface, error) {
images := []string{imagevector.ImageNamePauseContainer, imagevector.ImageNameValitail}
if features.DefaultFeatureGate.Enabled(features.UseGardenerNodeAgent) {
images = append(images, imagevector.ImageNameGardenerNodeAgent)
} else {
if !features.DefaultFeatureGate.Enabled(features.UseGardenerNodeAgent) {
images = append(images, imagevector.ImageNameHyperkube)
}

oscImages, err := imagevectorutils.FindImages(imagevector.ImageVector(), images, imagevectorutils.RuntimeVersion(b.ShootVersion()), imagevectorutils.TargetVersion(b.ShootVersion()))
if err != nil {
return nil, err
}

if features.DefaultFeatureGate.Enabled(features.UseGardenerNodeAgent) {
oscImages[imagevector.ImageNameGardenerNodeAgent], err = imagevector.ImageVector().FindImage(imagevector.ImageNameGardenerNodeAgent)
if err != nil {
return nil, fmt.Errorf("failed finding image %q: %w", imagevector.ImageNameGardenerNodeAgent, err)
}
oscImages[imagevector.ImageNameGardenerNodeAgent].WithOptionalTag(version.Get().GitVersion)
}

clusterDNSAddress := b.Shoot.Networks.CoreDNS.String()
if b.Shoot.NodeLocalDNSEnabled && b.Shoot.IPVSEnabled() {
// If IPVS is enabled then instruct the kubelet to create pods resolving DNS to the `nodelocaldns` network
Expand Down

0 comments on commit 825c794

Please sign in to comment.