mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-06-10 10:15:57 +00:00
vendor: Update vendor logic
This commit is contained in:
parent
c6ac5cbc87
commit
4ca64b85f0
1540 changed files with 265304 additions and 91616 deletions
19
vendor/k8s.io/apiserver/pkg/registry/rest/create.go
generated
vendored
19
vendor/k8s.io/apiserver/pkg/registry/rest/create.go
generated
vendored
|
|
@ -92,9 +92,6 @@ func BeforeCreate(strategy RESTCreateStrategy, ctx context.Context, obj runtime.
|
|||
objectMeta.SetName(strategy.GenerateName(objectMeta.GetGenerateName()))
|
||||
}
|
||||
|
||||
// Initializers are a deprecated alpha field and should not be saved
|
||||
objectMeta.SetInitializers(nil)
|
||||
|
||||
// Ensure managedFields is not set unless the feature is enabled
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.ServerSideApply) {
|
||||
objectMeta.SetManagedFields(nil)
|
||||
|
|
@ -163,15 +160,23 @@ type NamespaceScopedStrategy interface {
|
|||
func AdmissionToValidateObjectFunc(admit admission.Interface, staticAttributes admission.Attributes, o admission.ObjectInterfaces) ValidateObjectFunc {
|
||||
validatingAdmission, ok := admit.(admission.ValidationInterface)
|
||||
if !ok {
|
||||
return func(obj runtime.Object) error { return nil }
|
||||
return func(ctx context.Context, obj runtime.Object) error { return nil }
|
||||
}
|
||||
return func(obj runtime.Object) error {
|
||||
return func(ctx context.Context, obj runtime.Object) error {
|
||||
name := staticAttributes.GetName()
|
||||
// in case the generated name is populated
|
||||
if len(name) == 0 {
|
||||
if metadata, err := meta.Accessor(obj); err == nil {
|
||||
name = metadata.GetName()
|
||||
}
|
||||
}
|
||||
|
||||
finalAttributes := admission.NewAttributesRecord(
|
||||
obj,
|
||||
staticAttributes.GetOldObject(),
|
||||
staticAttributes.GetKind(),
|
||||
staticAttributes.GetNamespace(),
|
||||
staticAttributes.GetName(),
|
||||
name,
|
||||
staticAttributes.GetResource(),
|
||||
staticAttributes.GetSubresource(),
|
||||
staticAttributes.GetOperation(),
|
||||
|
|
@ -182,6 +187,6 @@ func AdmissionToValidateObjectFunc(admit admission.Interface, staticAttributes a
|
|||
if !validatingAdmission.Handles(finalAttributes.GetOperation()) {
|
||||
return nil
|
||||
}
|
||||
return validatingAdmission.Validate(finalAttributes, o)
|
||||
return validatingAdmission.Validate(ctx, finalAttributes, o)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue