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() }