Skip to content

Commit

Permalink
Merge pull request #161 from kilosonc/feat/metatag
Browse files Browse the repository at this point in the history
fix: tags disappear when updating cluster
  • Loading branch information
kilosonc authored May 24, 2023
2 parents 17edf24 + 9884c03 commit 09f8392
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/controller/cluster/controller_basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ func (c *controller) UpdateCluster(ctx context.Context, clusterID uint,
if err != nil {
return nil, err
}
if !tagmodels.Tags(tags).Eq(tagsInDB) {
if r.Tags != nil && !tagmodels.Tags(tags).Eq(tagsInDB) {
if err := c.clusterGitRepo.UpdateTags(ctx, application.Name, cluster.Name, cluster.Template, tags); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion core/controller/cluster/controller_basic_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ func (c *controller) UpdateClusterV2(ctx context.Context, clusterID uint,
if err != nil {
return err
}
if !tagmodels.Tags(tags).Eq(tagsInDB) {
if r.Tags != nil && !tagmodels.Tags(tags).Eq(tagsInDB) {
if err := c.clusterGitRepo.UpdateTags(ctx, application.Name, cluster.Name, cluster.Template, tags); err != nil {
return err
}
Expand Down

0 comments on commit 09f8392

Please sign in to comment.