UnifiedStorage: Default to running unified-grpc in integration tests (#93492)

This commit is contained in:
Ryan McKinley
2024-10-31 16:29:32 +03:00
committed by GitHub
parent a93de5f0d8
commit 4e1f0dadbd
9 changed files with 56 additions and 40 deletions
+10 -4
View File
@@ -29,6 +29,7 @@ import (
"github.com/grafana/grafana/pkg/apimachinery/utils"
grafanaregistry "github.com/grafana/grafana/pkg/apiserver/registry/generic"
"github.com/grafana/grafana/pkg/apiserver/rest"
"github.com/grafana/grafana/pkg/storage/unified/resource"
)
@@ -468,11 +469,16 @@ func (s *Storage) GuaranteedUpdate(
mmm.SetResourceVersionInt64(rsp.ResourceVersion)
res.ResourceVersion = uint64(rsp.ResourceVersion)
if err := preconditions.Check(key, existingObj); err != nil {
if attempt >= MaxUpdateAttempts {
return fmt.Errorf("precondition failed: %w", err)
if rest.IsDualWriteUpdate(ctx) {
// Ignore the RV when updating legacy values
mmm.SetResourceVersion("")
} else {
if err := preconditions.Check(key, existingObj); err != nil {
if attempt >= MaxUpdateAttempts {
return fmt.Errorf("precondition failed: %w", err)
}
continue
}
continue
}
} else if !ignoreNotFound {
return apierrors.NewNotFound(s.gr, req.Key.Name)