From 260aff6c5d7026e58315a309f81b973b26d17f50 Mon Sep 17 00:00:00 2001 From: david-kow <50632861+david-kow@users.noreply.github.com> Date: Mon, 23 Sep 2019 10:39:36 +0200 Subject: [PATCH] Set both beta and non-beta is-default-value annotation on storage class (#1772) * Set both beta and non-beta is-default-value annotation on storage class * Add comment --- hack/deployer/runner/gke.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/deployer/runner/gke.go b/hack/deployer/runner/gke.go index dd1f77b369..43c4d622b7 100644 --- a/hack/deployer/runner/gke.go +++ b/hack/deployer/runner/gke.go @@ -269,9 +269,9 @@ EOF`, sc)).Run() return err } - cmd := fmt.Sprintf( - `kubectl patch storageclass %s -p '{ "metadata": { "annotations": { "storageclass.beta.kubernetes.io/is-default-class":"false"} } }'`, - defaultName) + // Depending on K8s version, a different annotation is needed. To avoid parsing version string, both are set. + patch := `'{ "metadata": { "annotations": { "storageclass.kubernetes.io/is-default-class":"false", "storageclass.beta.kubernetes.io/is-default-class":"false"} } }'` + cmd := fmt.Sprintf(`kubectl patch storageclass %s -p %s`, defaultName, patch) return NewCommand(cmd).Run() }