From c7046114b321ba0910ad18c492753280f9e8d863 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Date: Thu, 24 Oct 2024 12:30:43 -0300 Subject: [PATCH] OCM-12050 | fix: warn instead of error rosa_creatorn_arn update validation --- .../clusterrosa/classic/cluster_rosa_classic_resource.go | 7 +++---- provider/clusterrosa/common/properties.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/provider/clusterrosa/classic/cluster_rosa_classic_resource.go b/provider/clusterrosa/classic/cluster_rosa_classic_resource.go index d923dad3..4a4d9236 100644 --- a/provider/clusterrosa/classic/cluster_rosa_classic_resource.go +++ b/provider/clusterrosa/classic/cluster_rosa_classic_resource.go @@ -1094,11 +1094,10 @@ func (r *ClusterRosaClassicResource) Update(ctx context.Context, request resourc if patchProperties { propertiesElements, err := rosa.ValidatePatchProperties(ctx, state.Properties, plan.Properties) if err != nil { - response.Diagnostics.AddError( - "Can't patch cluster", - fmt.Sprintf("Can't patch cluster with identifier: '%s', %v", state.ID.ValueString(), err), + response.Diagnostics.AddWarning( + "Shouldn't patch cluster properties", + fmt.Sprintf("Shouldn't patch cluster with identifier: '%s', %v", state.ID.ValueString(), err), ) - return } if propertiesElements != nil { for k, v := range rosa.OCMProperties { diff --git a/provider/clusterrosa/common/properties.go b/provider/clusterrosa/common/properties.go index e12fba6b..ebea4fd1 100644 --- a/provider/clusterrosa/common/properties.go +++ b/provider/clusterrosa/common/properties.go @@ -20,7 +20,7 @@ func ValidatePatchProperties(ctx context.Context, state, plan types.Map) (map[st } if ogCreatorArn, ogOk := ogProperties[PropertyRosaCreatorArn]; ogOk { if creatorArnValue != ogCreatorArn { - return nil, fmt.Errorf("Can't patch property '%s'", PropertyRosaCreatorArn) + return nil, fmt.Errorf("Shouldn't patch property '%s'", PropertyRosaCreatorArn) } } }