Skip to content

Commit

Permalink
Merge pull request #603 from ahitacat/no-update-empty-cluster
Browse files Browse the repository at this point in the history
OCM-6450 | No update cluster with empty config
  • Loading branch information
tzvatot authored Mar 4, 2024
2 parents 1095264 + 9cf11ef commit 4409e36
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/ocm/edit/cluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package cluster
import (
"fmt"
"os"
"reflect"
"strings"
"time"

Expand Down Expand Up @@ -268,9 +269,11 @@ func run(cmd *cobra.Command, argv []string) error {
}
clusterConfig.ClusterWideProxy = clusterWideProxy

err = c.UpdateCluster(clusterCollection, cluster.ID(), clusterConfig)
if err != nil {
return fmt.Errorf("Failed to update cluster: %v", err)
if !reflect.ValueOf(clusterConfig).IsZero() {
err = c.UpdateCluster(clusterCollection, cluster.ID(), clusterConfig)
if err != nil {
return fmt.Errorf("Failed to update cluster: %v", err)
}
}

return nil
Expand Down

0 comments on commit 4409e36

Please sign in to comment.