diff --git a/pkg/registry/rest/create.go b/pkg/registry/rest/create.go index 32ca642cf..83d5e576a 100644 --- a/pkg/registry/rest/create.go +++ b/pkg/registry/rest/create.go @@ -126,6 +126,7 @@ func BeforeCreate(strategy RESTCreateStrategy, ctx context.Context, obj runtime. // ZZZ_DeprecatedClusterName is ignored and should not be saved if len(objectMeta.GetZZZ_DeprecatedClusterName()) > 0 { objectMeta.SetZZZ_DeprecatedClusterName("") + warning.AddWarning(ctx, "", "metadata.clusterName was specified. This field is not preserved and will be removed from the schema in 1.25") } if errs := strategy.Validate(ctx, obj); len(errs) > 0 { diff --git a/pkg/registry/rest/update.go b/pkg/registry/rest/update.go index 7c8ec3e2e..e5ae7af0e 100644 --- a/pkg/registry/rest/update.go +++ b/pkg/registry/rest/update.go @@ -139,6 +139,7 @@ func BeforeUpdate(strategy RESTUpdateStrategy, ctx context.Context, obj, old run // ZZZ_DeprecatedClusterName is ignored and should not be saved if len(objectMeta.GetZZZ_DeprecatedClusterName()) > 0 { objectMeta.SetZZZ_DeprecatedClusterName("") + warning.AddWarning(ctx, "", "metadata.clusterName was specified. This field is not preserved and will be removed from the schema in 1.25") } // Use the existing UID if none is provided if len(objectMeta.GetUID()) == 0 {