Skip to content

Commit

Permalink
clean info from from autoupdate component when update
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi committed Aug 31, 2020
1 parent 6b78ca4 commit b810dbc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/phases/cluster/cluster.go
Expand Up @@ -42,6 +42,8 @@ import (
const (
DefaultClusterName = "default"
DefaultOperatorName = "onecloud-operator"
// Annotations of CE autoupdate component
AutoUpdateCurrentVersion = "autoupdate.onecloud.yunion.io/current-version"
)

type clusterData struct {
Expand Down Expand Up @@ -648,6 +650,11 @@ func updateCluster(data *clusterData, opt *updateOptions) error {
}
updateOC = true
}
// remove autoupdate related annotation
{
delete(oc.Annotations, AutoUpdateCurrentVersion)
oc.Spec.AutoUpdate.Tag = ""
}
if updateOC {
if _, err := data.client.OnecloudV1alpha1().OnecloudClusters(constants.OnecloudNamespace).Update(oc); err != nil {
return errors.Wrap(err, "update default onecloud cluster")
Expand Down

0 comments on commit b810dbc

Please sign in to comment.