mark metadata.initializers as deprecated

Kubernetes-commit: 047ecae1f445ed0f6ea7595c40122362444952a4
This commit is contained in:
Jordan Liggitt 2019-01-17 09:20:30 -05:00 committed by Kubernetes Publisher
parent 80029a760c
commit d1d4d76560
2 changed files with 6 additions and 3 deletions

View File

@ -90,7 +90,8 @@ func BeforeCreate(strategy RESTCreateStrategy, ctx context.Context, obj runtime.
objectMeta.SetName(strategy.GenerateName(objectMeta.GetGenerateName()))
}
objectMeta.SetInitializers(nil)
// Initializers are a deprecated alpha field and should not be saved
objectMeta.SetInitializers(nil)
// ClusterName is ignored and should not be saved
if len(objectMeta.GetClusterName()) > 0 {
objectMeta.SetClusterName("")

View File

@ -102,8 +102,10 @@ func BeforeUpdate(strategy RESTUpdateStrategy, ctx context.Context, obj, old run
}
objectMeta.SetGeneration(oldMeta.GetGeneration())
oldMeta.SetInitializers(nil)
objectMeta.SetInitializers(nil)
// Initializers are a deprecated alpha field and should not be saved
oldMeta.SetInitializers(nil)
objectMeta.SetInitializers(nil)
strategy.PrepareForUpdate(ctx, obj, old)
// ClusterName is ignored and should not be saved