mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes to 1.26.1
update kubernetes and its dependencies to v1.26.1 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
e9e33fb851
commit
9c8de9471e
35
vendor/k8s.io/apimachinery/pkg/api/meta/errors.go
generated
vendored
35
vendor/k8s.io/apimachinery/pkg/api/meta/errors.go
generated
vendored
@ -17,6 +17,7 @@ limitations under the License.
|
||||
package meta
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
@ -43,6 +44,11 @@ func (e *AmbiguousResourceError) Error() string {
|
||||
return fmt.Sprintf("%v matches multiple resources or kinds", e.PartialResource)
|
||||
}
|
||||
|
||||
func (*AmbiguousResourceError) Is(target error) bool {
|
||||
_, ok := target.(*AmbiguousResourceError)
|
||||
return ok
|
||||
}
|
||||
|
||||
// AmbiguousKindError is returned if the RESTMapper finds multiple matches for a kind
|
||||
type AmbiguousKindError struct {
|
||||
PartialKind schema.GroupVersionKind
|
||||
@ -63,16 +69,16 @@ func (e *AmbiguousKindError) Error() string {
|
||||
return fmt.Sprintf("%v matches multiple resources or kinds", e.PartialKind)
|
||||
}
|
||||
|
||||
func (*AmbiguousKindError) Is(target error) bool {
|
||||
_, ok := target.(*AmbiguousKindError)
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsAmbiguousError(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
switch err.(type) {
|
||||
case *AmbiguousResourceError, *AmbiguousKindError:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
return errors.Is(err, &AmbiguousResourceError{}) || errors.Is(err, &AmbiguousKindError{})
|
||||
}
|
||||
|
||||
// NoResourceMatchError is returned if the RESTMapper can't find any match for a resource
|
||||
@ -84,6 +90,11 @@ func (e *NoResourceMatchError) Error() string {
|
||||
return fmt.Sprintf("no matches for %v", e.PartialResource)
|
||||
}
|
||||
|
||||
func (*NoResourceMatchError) Is(target error) bool {
|
||||
_, ok := target.(*NoResourceMatchError)
|
||||
return ok
|
||||
}
|
||||
|
||||
// NoKindMatchError is returned if the RESTMapper can't find any match for a kind
|
||||
type NoKindMatchError struct {
|
||||
// GroupKind is the API group and kind that was searched
|
||||
@ -108,14 +119,14 @@ func (e *NoKindMatchError) Error() string {
|
||||
}
|
||||
}
|
||||
|
||||
func (*NoKindMatchError) Is(target error) bool {
|
||||
_, ok := target.(*NoKindMatchError)
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsNoMatchError(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
switch err.(type) {
|
||||
case *NoResourceMatchError, *NoKindMatchError:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
return errors.Is(err, &NoResourceMatchError{}) || errors.Is(err, &NoKindMatchError{})
|
||||
}
|
||||
|
9
vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go
generated
vendored
9
vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go
generated
vendored
@ -91,15 +91,16 @@ func validateOwnerReference(ownerReference metav1.OwnerReference, fldPath *field
|
||||
// ValidateOwnerReferences validates that a set of owner references are correctly defined.
|
||||
func ValidateOwnerReferences(ownerReferences []metav1.OwnerReference, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
controllerName := ""
|
||||
firstControllerName := ""
|
||||
for _, ref := range ownerReferences {
|
||||
allErrs = append(allErrs, validateOwnerReference(ref, fldPath)...)
|
||||
if ref.Controller != nil && *ref.Controller {
|
||||
if controllerName != "" {
|
||||
curControllerName := ref.Kind + "/" + ref.Name
|
||||
if firstControllerName != "" {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, ownerReferences,
|
||||
fmt.Sprintf("Only one reference can have Controller set to true. Found \"true\" in references for %v and %v", controllerName, ref.Name)))
|
||||
fmt.Sprintf("Only one reference can have Controller set to true. Found \"true\" in references for %v and %v", firstControllerName, curControllerName)))
|
||||
} else {
|
||||
controllerName = ref.Name
|
||||
firstControllerName = curControllerName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user