From 945bbd4edb42c32d6ad3624240a15b544d0a995e Mon Sep 17 00:00:00 2001 From: Ismail Alidzhikov Date: Wed, 25 Sep 2024 12:47:30 +0300 Subject: [PATCH] Adapt to the removal of the `PersistentVolumeLabel` admission plugin --- pkg/webhook/controlplane/ensurer.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/webhook/controlplane/ensurer.go b/pkg/webhook/controlplane/ensurer.go index c909a6d68..afbb1b8c5 100644 --- a/pkg/webhook/controlplane/ensurer.go +++ b/pkg/webhook/controlplane/ensurer.go @@ -220,10 +220,12 @@ func ensureKubeAPIServerCommandLineArgs(c *corev1.Container, k8sVersion *semver. c.Command = extensionswebhook.EnsureNoStringWithPrefix(c.Command, "--cloud-provider=") c.Command = extensionswebhook.EnsureNoStringWithPrefix(c.Command, "--cloud-config=") - c.Command = extensionswebhook.EnsureNoStringWithPrefixContains(c.Command, "--enable-admission-plugins=", - "PersistentVolumeLabel", ",") - c.Command = extensionswebhook.EnsureStringWithPrefixContains(c.Command, "--disable-admission-plugins=", - "PersistentVolumeLabel", ",") + if constraintK8sLess131.Check(k8sVersion) { + c.Command = extensionswebhook.EnsureNoStringWithPrefixContains(c.Command, "--enable-admission-plugins=", + "PersistentVolumeLabel", ",") + c.Command = extensionswebhook.EnsureStringWithPrefixContains(c.Command, "--disable-admission-plugins=", + "PersistentVolumeLabel", ",") + } } func ensureKubeControllerManagerCommandLineArgs(c *corev1.Container, k8sVersion *semver.Version) {