gardener / gardener

Homogeneous Kubernetes clusters at scale on any infrastructure using hosted control planes.

Home Page:https://gardener.cloud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`node-agent` image tag in `OperatingSystemConfig` uses shoot kubernetes version instead of gardener version

lotharbach opened this issue · comments

How to categorize this issue?

/area control-plane
/kind bug

What happened:

After update to gardener v1.92.0, Workers don't apply updated OperatingSystemConfig. We found they try to download a non-existing node-agent image tag. Their OperatingSystemConfig -original contains the following lines

  - content:
      imageRef:
        filePathInImage: /gardener-node-agent
        image: europe-docker.pkg.dev/gardener-project/releases/gardener/node-agent:v1.27.12
    path: /opt/bin/gardener-node-agent
    permissions: 493

with the tag always being the shoot kubernetes version.

What you expected to happen:
The tag should be node-agent:v1.92.0

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:
My best guess so far

oscImages[imagevector.ImageNameGardenerNodeAgent].WithOptionalTag(version.Get().GitVersion)

is where the tag should be set to the gardener version, but the tag has been set already in

oscImages, err := imagevectorutils.FindImages(imagevector.ImageVector(), []string{imagevector.ImageNamePauseContainer, imagevector.ImageNameValitail, imagevector.ImageNameGardenerNodeAgent}, imagevectorutils.RuntimeVersion(b.ShootVersion()), imagevectorutils.TargetVersion(b.ShootVersion()))

FindImages -> FindImage -> ToImage

ToImage applies the given <targetK8sVersion> to the source to produce an output image. If the tag of an image source is empty, it will use the given <targetVersion> as tag.

and so it is not nil anymore.

WithOptionalTag will set the 'Tag' field of the 'Image' to <tag> in case it is nil. If 'Tag' is already set, nothing happens.

Environment:

  • Gardener version: v1.92.0
  • No custom gardenlet IMAGEVECTOR_OVERWRITE at all
  • os-ubuntu v1.25.0, os-gardenlinux v0.24.0

/cc @rfranzke since you where the last to touch that code ❤️

/assign