Skip to content

Commit

Permalink
Set both beta and non-beta is-default-value annotation on storage cla…
Browse files Browse the repository at this point in the history
…ss (#1772)

* Set both beta and non-beta is-default-value annotation on storage class

* Add comment
  • Loading branch information
david-kow authored Sep 23, 2019
1 parent bc89351 commit 260aff6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hack/deployer/runner/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 260aff6

Please sign in to comment.