diff --git a/scripts/run-test.sh b/scripts/run-test.sh index 89da99eb..7ebb9f4d 100755 --- a/scripts/run-test.sh +++ b/scripts/run-test.sh @@ -18,4 +18,4 @@ set -e -x -go test -v ./... -covermode=atomic -coverprofile=coverage.out -race -p 1 \ No newline at end of file +CGO_ENABLED=0 go test -v ./... -covermode=atomic -coverprofile=coverage.out -race -p 1 \ No newline at end of file diff --git a/store/store.go b/store/store.go index 6c649808..f0f66720 100644 --- a/store/store.go +++ b/store/store.go @@ -180,7 +180,7 @@ func (s *ClusterStore) UpdateCluster(ctx context.Context, ns string, clusterInfo if err != nil { return err } - if oldCluster.Version.Load() != clusterInfo.Version.Load() { + if oldCluster.Version.Load() > clusterInfo.Version.Load() { return fmt.Errorf("the cluster has been updated by others") } @@ -212,7 +212,7 @@ func (s *ClusterStore) SetCluster(ctx context.Context, ns string, clusterInfo *C if err != nil { return err } - if oldCluster.Version.Load() != clusterInfo.Version.Load() { + if oldCluster.Version.Load() > clusterInfo.Version.Load() { return fmt.Errorf("the cluster has been updated by others") }