mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-07 22:25:03 +00:00
vendor: Update vendor logic
This commit is contained in:
parent
c6ac5cbc87
commit
4ca64b85f0
1540 changed files with 265304 additions and 91616 deletions
8
vendor/k8s.io/apiserver/pkg/registry/rest/OWNERS
generated
vendored
8
vendor/k8s.io/apiserver/pkg/registry/rest/OWNERS
generated
vendored
|
|
@ -13,22 +13,14 @@ reviewers:
|
|||
- nikhiljindal
|
||||
- gmarek
|
||||
- justinsb
|
||||
- roberthbailey
|
||||
- ncdc
|
||||
- eparis
|
||||
- dims
|
||||
- hongchaodeng
|
||||
- krousey
|
||||
- jszczepkowski
|
||||
- euank
|
||||
- markturansky
|
||||
- fgrzadkowski
|
||||
- fabioy
|
||||
- ingvagabund
|
||||
- david-mcmahon
|
||||
- jianhuiz
|
||||
- nhlfr
|
||||
- feihujiang
|
||||
- sdminonne
|
||||
- goltermann
|
||||
- enj
|
||||
|
|
|
|||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
6
vendor/k8s.io/apiserver/pkg/registry/rest/delete.go
generated
vendored
6
vendor/k8s.io/apiserver/pkg/registry/rest/delete.go
generated
vendored
|
|
@ -150,7 +150,7 @@ func AdmissionToValidateObjectDeleteFunc(admit admission.Interface, staticAttrib
|
|||
mutating := isMutatingAdmission && mutatingAdmission.Handles(staticAttributes.GetOperation())
|
||||
validating := isValidatingAdmission && validatingAdmission.Handles(staticAttributes.GetOperation())
|
||||
|
||||
return func(old runtime.Object) error {
|
||||
return func(ctx context.Context, old runtime.Object) error {
|
||||
if !mutating && !validating {
|
||||
return nil
|
||||
}
|
||||
|
|
@ -169,12 +169,12 @@ func AdmissionToValidateObjectDeleteFunc(admit admission.Interface, staticAttrib
|
|||
staticAttributes.GetUserInfo(),
|
||||
)
|
||||
if mutating {
|
||||
if err := mutatingAdmission.Admit(finalAttributes, objInterfaces); err != nil {
|
||||
if err := mutatingAdmission.Admit(ctx, finalAttributes, objInterfaces); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if validating {
|
||||
if err := validatingAdmission.Validate(finalAttributes, objInterfaces); err != nil {
|
||||
if err := validatingAdmission.Validate(ctx, finalAttributes, objInterfaces); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
vendor/k8s.io/apiserver/pkg/registry/rest/rest.go
generated
vendored
8
vendor/k8s.io/apiserver/pkg/registry/rest/rest.go
generated
vendored
|
|
@ -210,20 +210,20 @@ type UpdatedObjectInfo interface {
|
|||
// ValidateObjectFunc is a function to act on a given object. An error may be returned
|
||||
// if the hook cannot be completed. An ObjectFunc may NOT transform the provided
|
||||
// object.
|
||||
type ValidateObjectFunc func(obj runtime.Object) error
|
||||
type ValidateObjectFunc func(ctx context.Context, obj runtime.Object) error
|
||||
|
||||
// ValidateAllObjectFunc is a "admit everything" instance of ValidateObjectFunc.
|
||||
func ValidateAllObjectFunc(obj runtime.Object) error {
|
||||
func ValidateAllObjectFunc(ctx context.Context, obj runtime.Object) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ValidateObjectUpdateFunc is a function to act on a given object and its predecessor.
|
||||
// An error may be returned if the hook cannot be completed. An UpdateObjectFunc
|
||||
// may NOT transform the provided object.
|
||||
type ValidateObjectUpdateFunc func(obj, old runtime.Object) error
|
||||
type ValidateObjectUpdateFunc func(ctx context.Context, obj, old runtime.Object) error
|
||||
|
||||
// ValidateAllObjectUpdateFunc is a "admit everything" instance of ValidateObjectUpdateFunc.
|
||||
func ValidateAllObjectUpdateFunc(obj, old runtime.Object) error {
|
||||
func ValidateAllObjectUpdateFunc(ctx context.Context, obj, old runtime.Object) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
10
vendor/k8s.io/apiserver/pkg/registry/rest/update.go
generated
vendored
10
vendor/k8s.io/apiserver/pkg/registry/rest/update.go
generated
vendored
|
|
@ -104,10 +104,6 @@ func BeforeUpdate(strategy RESTUpdateStrategy, ctx context.Context, obj, old run
|
|||
}
|
||||
objectMeta.SetGeneration(oldMeta.GetGeneration())
|
||||
|
||||
// Initializers are a deprecated alpha field and should not be saved
|
||||
oldMeta.SetInitializers(nil)
|
||||
objectMeta.SetInitializers(nil)
|
||||
|
||||
// Ensure managedFields state is removed unless ServerSideApply is enabled
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.ServerSideApply) {
|
||||
oldMeta.SetManagedFields(nil)
|
||||
|
|
@ -259,9 +255,9 @@ func (i *wrappedUpdatedObjectInfo) UpdatedObject(ctx context.Context, oldObj run
|
|||
func AdmissionToValidateObjectUpdateFunc(admit admission.Interface, staticAttributes admission.Attributes, o admission.ObjectInterfaces) ValidateObjectUpdateFunc {
|
||||
validatingAdmission, ok := admit.(admission.ValidationInterface)
|
||||
if !ok {
|
||||
return func(obj, old runtime.Object) error { return nil }
|
||||
return func(ctx context.Context, obj, old runtime.Object) error { return nil }
|
||||
}
|
||||
return func(obj, old runtime.Object) error {
|
||||
return func(ctx context.Context, obj, old runtime.Object) error {
|
||||
finalAttributes := admission.NewAttributesRecord(
|
||||
obj,
|
||||
old,
|
||||
|
|
@ -278,6 +274,6 @@ func AdmissionToValidateObjectUpdateFunc(admit admission.Interface, staticAttrib
|
|||
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