mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes and libraries to v1.22.0 version
Kubernetes v1.22 version has been released and this update ceph csi dependencies to use the same version. Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
e077c1fdf5
commit
aa698bc3e1
1
vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS
generated
vendored
1
vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS
generated
vendored
@ -11,7 +11,6 @@ reviewers:
|
||||
- caesarxuchao
|
||||
- mikedanese
|
||||
- liggitt
|
||||
- erictune
|
||||
- saad-ali
|
||||
- janetkuo
|
||||
- tallclair
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/api/errors/errors.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/api/errors/errors.go
generated
vendored
@ -274,7 +274,7 @@ func NewBadRequest(reason string) *StatusError {
|
||||
|
||||
// NewTooManyRequests creates an error that indicates that the client must try again later because
|
||||
// the specified endpoint is not accepting requests. More specific details should be provided
|
||||
// if client should know why the failure was limited4.
|
||||
// if client should know why the failure was limited.
|
||||
func NewTooManyRequests(message string, retryAfterSeconds int) *StatusError {
|
||||
return &StatusError{metav1.Status{
|
||||
Status: metav1.StatusFailure,
|
||||
|
9
vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
generated
vendored
9
vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
generated
vendored
@ -696,6 +696,15 @@ func (q *Quantity) UnmarshalJSON(value []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDecimalQuantity returns a new Quantity representing the given
|
||||
// value in the given format.
|
||||
func NewDecimalQuantity(b inf.Dec, format Format) *Quantity {
|
||||
return &Quantity{
|
||||
d: infDecAmount{&b},
|
||||
Format: format,
|
||||
}
|
||||
}
|
||||
|
||||
// NewQuantity returns a new Quantity representing the given
|
||||
// value in the given format.
|
||||
func NewQuantity(value int64, format Format) *Quantity {
|
||||
|
6
vendor/k8s.io/apimachinery/pkg/api/validation/generic.go
generated
vendored
6
vendor/k8s.io/apimachinery/pkg/api/validation/generic.go
generated
vendored
@ -68,9 +68,11 @@ var ValidateNamespaceName = NameIsDNSLabel
|
||||
var ValidateServiceAccountName = NameIsDNSSubdomain
|
||||
|
||||
// maskTrailingDash replaces the final character of a string with a subdomain safe
|
||||
// value if is a dash.
|
||||
// value if it is a dash and if the length of this string is greater than 1. Note that
|
||||
// this is used when a value could be appended to the string, see ValidateNameFunc
|
||||
// for more info.
|
||||
func maskTrailingDash(name string) string {
|
||||
if strings.HasSuffix(name, "-") {
|
||||
if len(name) > 1 && strings.HasSuffix(name, "-") {
|
||||
return name[:len(name)-2] + "a"
|
||||
}
|
||||
return name
|
||||
|
25
vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go
generated
vendored
25
vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go
generated
vendored
@ -33,7 +33,7 @@ import (
|
||||
// FieldImmutableErrorMsg is a error message for field is immutable.
|
||||
const FieldImmutableErrorMsg string = `field is immutable`
|
||||
|
||||
const totalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB
|
||||
const TotalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB
|
||||
|
||||
// BannedOwners is a black list of object that are not allowed to be owners.
|
||||
var BannedOwners = map[schema.GroupVersionKind]struct{}{
|
||||
@ -46,19 +46,28 @@ var ValidateClusterName = NameIsDNS1035Label
|
||||
// ValidateAnnotations validates that a set of annotations are correctly defined.
|
||||
func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
var totalSize int64
|
||||
for k, v := range annotations {
|
||||
for k := range annotations {
|
||||
for _, msg := range validation.IsQualifiedName(strings.ToLower(k)) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, k, msg))
|
||||
}
|
||||
totalSize += (int64)(len(k)) + (int64)(len(v))
|
||||
}
|
||||
if totalSize > (int64)(totalAnnotationSizeLimitB) {
|
||||
allErrs = append(allErrs, field.TooLong(fldPath, "", totalAnnotationSizeLimitB))
|
||||
if err := ValidateAnnotationsSize(annotations); err != nil {
|
||||
allErrs = append(allErrs, field.TooLong(fldPath, "", TotalAnnotationSizeLimitB))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateAnnotationsSize(annotations map[string]string) error {
|
||||
var totalSize int64
|
||||
for k, v := range annotations {
|
||||
totalSize += (int64)(len(k)) + (int64)(len(v))
|
||||
}
|
||||
if totalSize > (int64)(TotalAnnotationSizeLimitB) {
|
||||
return fmt.Errorf("annotations size %d is larger than limit %d", totalSize, TotalAnnotationSizeLimitB)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateOwnerReference(ownerReference metav1.OwnerReference, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
gvk := schema.FromAPIVersionAndKind(ownerReference.APIVersion, ownerReference.Kind)
|
||||
@ -134,7 +143,7 @@ func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) fie
|
||||
func ValidateObjectMeta(objMeta *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList {
|
||||
metadata, err := meta.Accessor(objMeta)
|
||||
if err != nil {
|
||||
allErrs := field.ErrorList{}
|
||||
var allErrs field.ErrorList
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, objMeta, err.Error()))
|
||||
return allErrs
|
||||
}
|
||||
@ -145,7 +154,7 @@ func ValidateObjectMeta(objMeta *metav1.ObjectMeta, requiresNamespace bool, name
|
||||
// been performed.
|
||||
// It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before.
|
||||
func ValidateObjectMetaAccessor(meta metav1.Object, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
var allErrs field.ErrorList
|
||||
|
||||
if len(meta.GetGenerateName()) != 0 {
|
||||
for _, msg := range nameFn(meta.GetGenerateName(), true) {
|
||||
|
Reference in New Issue
Block a user