let objects without metadata pass through the managedFields admission controller
Not all objects provide metadata. There might be extention servers that allow for creating objects without the metadata field. This PR changes the managedFileds admission to deal with objects without the metadata field. Object without that field will be passed directly to the wrapped admission controller for further validation. Kubernetes-commit: 3dbaf305ae1e52105a338987f3770ff104def68b
This commit is contained in:
parent
28df761863
commit
a9e68c9b32
|
|
@ -60,7 +60,10 @@ func (admit *managedFieldsValidatingAdmissionController) Admit(ctx context.Conte
|
|||
}
|
||||
objectMeta, err := meta.Accessor(a.GetObject())
|
||||
if err != nil {
|
||||
return err
|
||||
// the object we are dealing with doesn't have object metadata defined
|
||||
// in that case we don't have to keep track of the managedField
|
||||
// just call the wrapped admission
|
||||
return mutationInterface.Admit(ctx, a, o)
|
||||
}
|
||||
managedFieldsBeforeAdmission := objectMeta.GetManagedFields()
|
||||
if err := mutationInterface.Admit(ctx, a, o); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue