Fix dependencies
This commit is contained in:
2
vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS
generated
vendored
@ -17,7 +17,9 @@ reviewers:
|
||||
- saad-ali
|
||||
- janetkuo
|
||||
- tallclair
|
||||
- eparis
|
||||
- dims
|
||||
- hongchaodeng
|
||||
- krousey
|
||||
- cjcullen
|
||||
- david-mcmahon
|
||||
|
82
vendor/k8s.io/apimachinery/pkg/api/errors/errors.go
generated
vendored
82
vendor/k8s.io/apimachinery/pkg/api/errors/errors.go
generated
vendored
@ -18,7 +18,6 @@ package errors
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"reflect"
|
||||
@ -30,6 +29,14 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
)
|
||||
|
||||
const (
|
||||
// StatusTooManyRequests means the server experienced too many requests within a
|
||||
// given window and that the client must wait to perform the action again.
|
||||
// DEPRECATED: please use http.StatusTooManyRequests, this will be removed in
|
||||
// the future version.
|
||||
StatusTooManyRequests = http.StatusTooManyRequests
|
||||
)
|
||||
|
||||
// StatusError is an error intended for consumption by a REST API server; it can also be
|
||||
// reconstructed by clients from a REST response. Public to allow easy type switches.
|
||||
type StatusError struct {
|
||||
@ -476,141 +483,127 @@ func NewGenericServerResponse(code int, verb string, qualifiedResource schema.Gr
|
||||
}
|
||||
|
||||
// IsNotFound returns true if the specified error was created by NewNotFound.
|
||||
// It supports wrapped errors.
|
||||
func IsNotFound(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonNotFound
|
||||
}
|
||||
|
||||
// IsAlreadyExists determines if the err is an error which indicates that a specified resource already exists.
|
||||
// It supports wrapped errors.
|
||||
func IsAlreadyExists(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonAlreadyExists
|
||||
}
|
||||
|
||||
// IsConflict determines if the err is an error which indicates the provided update conflicts.
|
||||
// It supports wrapped errors.
|
||||
func IsConflict(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonConflict
|
||||
}
|
||||
|
||||
// IsInvalid determines if the err is an error which indicates the provided resource is not valid.
|
||||
// It supports wrapped errors.
|
||||
func IsInvalid(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonInvalid
|
||||
}
|
||||
|
||||
// IsGone is true if the error indicates the requested resource is no longer available.
|
||||
// It supports wrapped errors.
|
||||
func IsGone(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonGone
|
||||
}
|
||||
|
||||
// IsResourceExpired is true if the error indicates the resource has expired and the current action is
|
||||
// no longer possible.
|
||||
// It supports wrapped errors.
|
||||
func IsResourceExpired(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonExpired
|
||||
}
|
||||
|
||||
// IsNotAcceptable determines if err is an error which indicates that the request failed due to an invalid Accept header
|
||||
// It supports wrapped errors.
|
||||
func IsNotAcceptable(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonNotAcceptable
|
||||
}
|
||||
|
||||
// IsUnsupportedMediaType determines if err is an error which indicates that the request failed due to an invalid Content-Type header
|
||||
// It supports wrapped errors.
|
||||
func IsUnsupportedMediaType(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonUnsupportedMediaType
|
||||
}
|
||||
|
||||
// IsMethodNotSupported determines if the err is an error which indicates the provided action could not
|
||||
// be performed because it is not supported by the server.
|
||||
// It supports wrapped errors.
|
||||
func IsMethodNotSupported(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonMethodNotAllowed
|
||||
}
|
||||
|
||||
// IsServiceUnavailable is true if the error indicates the underlying service is no longer available.
|
||||
// It supports wrapped errors.
|
||||
func IsServiceUnavailable(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonServiceUnavailable
|
||||
}
|
||||
|
||||
// IsBadRequest determines if err is an error which indicates that the request is invalid.
|
||||
// It supports wrapped errors.
|
||||
func IsBadRequest(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonBadRequest
|
||||
}
|
||||
|
||||
// IsUnauthorized determines if err is an error which indicates that the request is unauthorized and
|
||||
// requires authentication by the user.
|
||||
// It supports wrapped errors.
|
||||
func IsUnauthorized(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonUnauthorized
|
||||
}
|
||||
|
||||
// IsForbidden determines if err is an error which indicates that the request is forbidden and cannot
|
||||
// be completed as requested.
|
||||
// It supports wrapped errors.
|
||||
func IsForbidden(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonForbidden
|
||||
}
|
||||
|
||||
// IsTimeout determines if err is an error which indicates that request times out due to long
|
||||
// processing.
|
||||
// It supports wrapped errors.
|
||||
func IsTimeout(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonTimeout
|
||||
}
|
||||
|
||||
// IsServerTimeout determines if err is an error which indicates that the request needs to be retried
|
||||
// by the client.
|
||||
// It supports wrapped errors.
|
||||
func IsServerTimeout(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonServerTimeout
|
||||
}
|
||||
|
||||
// IsInternalError determines if err is an error which indicates an internal server error.
|
||||
// It supports wrapped errors.
|
||||
func IsInternalError(err error) bool {
|
||||
return ReasonForError(err) == metav1.StatusReasonInternalError
|
||||
}
|
||||
|
||||
// IsTooManyRequests determines if err is an error which indicates that there are too many requests
|
||||
// that the server cannot handle.
|
||||
// It supports wrapped errors.
|
||||
func IsTooManyRequests(err error) bool {
|
||||
if ReasonForError(err) == metav1.StatusReasonTooManyRequests {
|
||||
return true
|
||||
}
|
||||
if status := APIStatus(nil); errors.As(err, &status) {
|
||||
return status.Status().Code == http.StatusTooManyRequests
|
||||
switch t := err.(type) {
|
||||
case APIStatus:
|
||||
return t.Status().Code == http.StatusTooManyRequests
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRequestEntityTooLargeError determines if err is an error which indicates
|
||||
// the request entity is too large.
|
||||
// It supports wrapped errors.
|
||||
func IsRequestEntityTooLargeError(err error) bool {
|
||||
if ReasonForError(err) == metav1.StatusReasonRequestEntityTooLarge {
|
||||
return true
|
||||
}
|
||||
if status := APIStatus(nil); errors.As(err, &status) {
|
||||
return status.Status().Code == http.StatusRequestEntityTooLarge
|
||||
switch t := err.(type) {
|
||||
case APIStatus:
|
||||
return t.Status().Code == http.StatusRequestEntityTooLarge
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsUnexpectedServerError returns true if the server response was not in the expected API format,
|
||||
// and may be the result of another HTTP actor.
|
||||
// It supports wrapped errors.
|
||||
func IsUnexpectedServerError(err error) bool {
|
||||
if status := APIStatus(nil); errors.As(err, &status) && status.Status().Details != nil {
|
||||
for _, cause := range status.Status().Details.Causes {
|
||||
if cause.Type == metav1.CauseTypeUnexpectedServerResponse {
|
||||
return true
|
||||
switch t := err.(type) {
|
||||
case APIStatus:
|
||||
if d := t.Status().Details; d != nil {
|
||||
for _, cause := range d.Causes {
|
||||
if cause.Type == metav1.CauseTypeUnexpectedServerResponse {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -618,37 +611,38 @@ func IsUnexpectedServerError(err error) bool {
|
||||
}
|
||||
|
||||
// IsUnexpectedObjectError determines if err is due to an unexpected object from the master.
|
||||
// It supports wrapped errors.
|
||||
func IsUnexpectedObjectError(err error) bool {
|
||||
uoe := &UnexpectedObjectError{}
|
||||
return err != nil && errors.As(err, &uoe)
|
||||
_, ok := err.(*UnexpectedObjectError)
|
||||
return err != nil && ok
|
||||
}
|
||||
|
||||
// SuggestsClientDelay returns true if this error suggests a client delay as well as the
|
||||
// suggested seconds to wait, or false if the error does not imply a wait. It does not
|
||||
// address whether the error *should* be retried, since some errors (like a 3xx) may
|
||||
// request delay without retry.
|
||||
// It supports wrapped errors.
|
||||
func SuggestsClientDelay(err error) (int, bool) {
|
||||
if t := APIStatus(nil); errors.As(err, &t) && t.Status().Details != nil {
|
||||
switch t.Status().Reason {
|
||||
// this StatusReason explicitly requests the caller to delay the action
|
||||
case metav1.StatusReasonServerTimeout:
|
||||
return int(t.Status().Details.RetryAfterSeconds), true
|
||||
}
|
||||
// If the client requests that we retry after a certain number of seconds
|
||||
if t.Status().Details.RetryAfterSeconds > 0 {
|
||||
return int(t.Status().Details.RetryAfterSeconds), true
|
||||
switch t := err.(type) {
|
||||
case APIStatus:
|
||||
if t.Status().Details != nil {
|
||||
switch t.Status().Reason {
|
||||
// this StatusReason explicitly requests the caller to delay the action
|
||||
case metav1.StatusReasonServerTimeout:
|
||||
return int(t.Status().Details.RetryAfterSeconds), true
|
||||
}
|
||||
// If the client requests that we retry after a certain number of seconds
|
||||
if t.Status().Details.RetryAfterSeconds > 0 {
|
||||
return int(t.Status().Details.RetryAfterSeconds), true
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
|
||||
// ReasonForError returns the HTTP status for a particular error.
|
||||
// It supports wrapped errors.
|
||||
func ReasonForError(err error) metav1.StatusReason {
|
||||
if status := APIStatus(nil); errors.As(err, &status) {
|
||||
return status.Status().Reason
|
||||
switch t := err.(type) {
|
||||
case APIStatus:
|
||||
return t.Status().Reason
|
||||
}
|
||||
return metav1.StatusReasonUnknown
|
||||
}
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS
generated
vendored
@ -14,8 +14,10 @@ reviewers:
|
||||
- gmarek
|
||||
- janetkuo
|
||||
- ncdc
|
||||
- eparis
|
||||
- dims
|
||||
- krousey
|
||||
- resouer
|
||||
- david-mcmahon
|
||||
- mfojtik
|
||||
- jianhuiz
|
||||
|
101
vendor/k8s.io/apimachinery/pkg/api/meta/conditions.go
generated
vendored
101
vendor/k8s.io/apimachinery/pkg/api/meta/conditions.go
generated
vendored
@ -1,101 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package meta
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// SetStatusCondition sets the corresponding condition in conditions to newCondition.
|
||||
// conditions must be non-nil.
|
||||
// 1. if the condition of the specified type already exists (all fields of the existing condition are updated to
|
||||
// newCondition, LastTransitionTime is set to now if the new status differs from the old status)
|
||||
// 2. if a condition of the specified type does not exist (LastTransitionTime is set to now() if unset, and newCondition is appended)
|
||||
func SetStatusCondition(conditions *[]metav1.Condition, newCondition metav1.Condition) {
|
||||
if conditions == nil {
|
||||
return
|
||||
}
|
||||
existingCondition := FindStatusCondition(*conditions, newCondition.Type)
|
||||
if existingCondition == nil {
|
||||
if newCondition.LastTransitionTime.IsZero() {
|
||||
newCondition.LastTransitionTime = metav1.NewTime(time.Now())
|
||||
}
|
||||
*conditions = append(*conditions, newCondition)
|
||||
return
|
||||
}
|
||||
|
||||
if existingCondition.Status != newCondition.Status {
|
||||
existingCondition.Status = newCondition.Status
|
||||
if !newCondition.LastTransitionTime.IsZero() {
|
||||
existingCondition.LastTransitionTime = newCondition.LastTransitionTime
|
||||
} else {
|
||||
existingCondition.LastTransitionTime = metav1.NewTime(time.Now())
|
||||
}
|
||||
}
|
||||
|
||||
existingCondition.Reason = newCondition.Reason
|
||||
existingCondition.Message = newCondition.Message
|
||||
}
|
||||
|
||||
// RemoveStatusCondition removes the corresponding conditionType from conditions.
|
||||
// conditions must be non-nil.
|
||||
func RemoveStatusCondition(conditions *[]metav1.Condition, conditionType string) {
|
||||
if conditions == nil {
|
||||
return
|
||||
}
|
||||
newConditions := make([]metav1.Condition, 0, len(*conditions)-1)
|
||||
for _, condition := range *conditions {
|
||||
if condition.Type != conditionType {
|
||||
newConditions = append(newConditions, condition)
|
||||
}
|
||||
}
|
||||
|
||||
*conditions = newConditions
|
||||
}
|
||||
|
||||
// FindStatusCondition finds the conditionType in conditions.
|
||||
func FindStatusCondition(conditions []metav1.Condition, conditionType string) *metav1.Condition {
|
||||
for i := range conditions {
|
||||
if conditions[i].Type == conditionType {
|
||||
return &conditions[i]
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsStatusConditionTrue returns true when the conditionType is present and set to `metav1.ConditionTrue`
|
||||
func IsStatusConditionTrue(conditions []metav1.Condition, conditionType string) bool {
|
||||
return IsStatusConditionPresentAndEqual(conditions, conditionType, metav1.ConditionTrue)
|
||||
}
|
||||
|
||||
// IsStatusConditionFalse returns true when the conditionType is present and set to `metav1.ConditionFalse`
|
||||
func IsStatusConditionFalse(conditions []metav1.Condition, conditionType string) bool {
|
||||
return IsStatusConditionPresentAndEqual(conditions, conditionType, metav1.ConditionFalse)
|
||||
}
|
||||
|
||||
// IsStatusConditionPresentAndEqual returns true when conditionType is present and equal to status.
|
||||
func IsStatusConditionPresentAndEqual(conditions []metav1.Condition, conditionType string, status metav1.ConditionStatus) bool {
|
||||
for _, condition := range conditions {
|
||||
if condition.Type == conditionType {
|
||||
return condition.Status == status
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
2
vendor/k8s.io/apimachinery/pkg/api/meta/meta.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/api/meta/meta.go
generated
vendored
@ -25,7 +25,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// errNotList is returned when an object implements the Object style interfaces but not the List style
|
||||
|
3
vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS
generated
vendored
3
vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS
generated
vendored
@ -9,5 +9,8 @@ reviewers:
|
||||
- mikedanese
|
||||
- saad-ali
|
||||
- janetkuo
|
||||
- tallclair
|
||||
- eparis
|
||||
- xiang90
|
||||
- mbohlool
|
||||
- david-mcmahon
|
||||
|
1
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS
generated
vendored
1
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS
generated
vendored
@ -25,6 +25,7 @@ reviewers:
|
||||
- krousey
|
||||
- mml
|
||||
- mbohlool
|
||||
- david-mcmahon
|
||||
- therc
|
||||
- mqliang
|
||||
- kevin-wangzefeng
|
||||
|
8
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go
generated
vendored
8
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go
generated
vendored
@ -345,11 +345,3 @@ func Convert_url_Values_To_v1_DeleteOptions(in *url.Values, out *DeleteOptions,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_Slice_string_To_v1_ResourceVersionMatch allows converting a URL query parameter to ResourceVersionMatch
|
||||
func Convert_Slice_string_To_v1_ResourceVersionMatch(in *[]string, out *ResourceVersionMatch, s conversion.Scope) error {
|
||||
if len(*in) > 0 {
|
||||
*out = ResourceVersionMatch((*in)[0])
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
830
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go
generated
vendored
830
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
101
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto
generated
vendored
101
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto
generated
vendored
@ -134,73 +134,6 @@ message APIVersions {
|
||||
repeated ServerAddressByClientCIDR serverAddressByClientCIDRs = 2;
|
||||
}
|
||||
|
||||
// Condition contains details for one aspect of the current state of this API Resource.
|
||||
// ---
|
||||
// This struct is intended for direct use as an array at the field path .status.conditions. For example,
|
||||
// type FooStatus struct{
|
||||
// // Represents the observations of a foo's current state.
|
||||
// // Known .status.conditions.type are: "Available", "Progressing", and "Degraded"
|
||||
// // +patchMergeKey=type
|
||||
// // +patchStrategy=merge
|
||||
// // +listType=map
|
||||
// // +listMapKey=type
|
||||
// Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
|
||||
//
|
||||
// // other fields
|
||||
// }
|
||||
message Condition {
|
||||
// type of condition in CamelCase or in foo.example.com/CamelCase.
|
||||
// ---
|
||||
// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
|
||||
// useful (see .node.status.conditions), the ability to deconflict is important.
|
||||
// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
|
||||
// +required
|
||||
// +kubebuilder:validation:Required
|
||||
// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
|
||||
// +kubebuilder:validation:MaxLength=316
|
||||
optional string type = 1;
|
||||
|
||||
// status of the condition, one of True, False, Unknown.
|
||||
// +required
|
||||
// +kubebuilder:validation:Required
|
||||
// +kubebuilder:validation:Enum=True;False;Unknown
|
||||
optional string status = 2;
|
||||
|
||||
// observedGeneration represents the .metadata.generation that the condition was set based upon.
|
||||
// For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
|
||||
// with respect to the current state of the instance.
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
optional int64 observedGeneration = 3;
|
||||
|
||||
// lastTransitionTime is the last time the condition transitioned from one status to another.
|
||||
// This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
|
||||
// +required
|
||||
// +kubebuilder:validation:Required
|
||||
// +kubebuilder:validation:Type=string
|
||||
// +kubebuilder:validation:Format=date-time
|
||||
optional Time lastTransitionTime = 4;
|
||||
|
||||
// reason contains a programmatic identifier indicating the reason for the condition's last transition.
|
||||
// Producers of specific condition types may define expected values and meanings for this field,
|
||||
// and whether the values are considered a guaranteed API.
|
||||
// The value should be a CamelCase string.
|
||||
// This field may not be empty.
|
||||
// +required
|
||||
// +kubebuilder:validation:Required
|
||||
// +kubebuilder:validation:MaxLength=1024
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$`
|
||||
optional string reason = 5;
|
||||
|
||||
// message is a human readable message indicating details about the transition.
|
||||
// This may be an empty string.
|
||||
// +required
|
||||
// +kubebuilder:validation:Required
|
||||
// +kubebuilder:validation:MaxLength=32768
|
||||
optional string message = 6;
|
||||
}
|
||||
|
||||
// CreateOptions may be provided when creating an API object.
|
||||
message CreateOptions {
|
||||
// When present, indicates that modifications should not be
|
||||
@ -291,7 +224,6 @@ message ExportOptions {
|
||||
// If a key maps to an empty Fields value, the field that key represents is part of the set.
|
||||
//
|
||||
// The exact format is defined in sigs.k8s.io/structured-merge-diff
|
||||
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
||||
message FieldsV1 {
|
||||
// Raw is the underlying serialization of this object.
|
||||
optional bytes Raw = 1;
|
||||
@ -299,12 +231,10 @@ message FieldsV1 {
|
||||
|
||||
// GetOptions is the standard query options to the standard REST get call.
|
||||
message GetOptions {
|
||||
// resourceVersion sets a constraint on what resource versions a request may be served from.
|
||||
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for
|
||||
// details.
|
||||
//
|
||||
// Defaults to unset
|
||||
// +optional
|
||||
// When specified:
|
||||
// - if unset, then the result is returned from remote storage based on quorum-read flag;
|
||||
// - if it's 0, then we simply return what we currently have in cache, no guarantee;
|
||||
// - if set to non zero, then the result is at least as fresh as given rv.
|
||||
optional string resourceVersion = 1;
|
||||
}
|
||||
|
||||
@ -490,24 +420,15 @@ message ListOptions {
|
||||
// +optional
|
||||
optional bool allowWatchBookmarks = 9;
|
||||
|
||||
// resourceVersion sets a constraint on what resource versions a request may be served from.
|
||||
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for
|
||||
// details.
|
||||
//
|
||||
// Defaults to unset
|
||||
// When specified with a watch call, shows changes that occur after that particular version of a resource.
|
||||
// Defaults to changes from the beginning of history.
|
||||
// When specified for list:
|
||||
// - if unset, then the result is returned from remote storage based on quorum-read flag;
|
||||
// - if it's 0, then we simply return what we currently have in cache, no guarantee;
|
||||
// - if set to non zero, then the result is at least as fresh as given rv.
|
||||
// +optional
|
||||
optional string resourceVersion = 4;
|
||||
|
||||
// resourceVersionMatch determines how resourceVersion is applied to list calls.
|
||||
// It is highly recommended that resourceVersionMatch be set for list calls where
|
||||
// resourceVersion is set
|
||||
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for
|
||||
// details.
|
||||
//
|
||||
// Defaults to unset
|
||||
// +optional
|
||||
optional string resourceVersionMatch = 10;
|
||||
|
||||
// Timeout for the list/watch call.
|
||||
// This limits the duration of the call, regardless of any activity or inactivity.
|
||||
// +optional
|
||||
@ -625,7 +546,7 @@ message ObjectMeta {
|
||||
// +optional
|
||||
optional string generateName = 2;
|
||||
|
||||
// Namespace defines the space within which each name must be unique. An empty namespace is
|
||||
// Namespace defines the space within each name must be unique. An empty namespace is
|
||||
// equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
// Not all objects are required to be scoped to a namespace - the value of this field for
|
||||
// those objects will be empty.
|
||||
|
4
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go
generated
vendored
4
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go
generated
vendored
@ -156,9 +156,7 @@ func (meta *ObjectMeta) GetDeletionTimestamp() *Time { return meta.DeletionTimes
|
||||
func (meta *ObjectMeta) SetDeletionTimestamp(deletionTimestamp *Time) {
|
||||
meta.DeletionTimestamp = deletionTimestamp
|
||||
}
|
||||
func (meta *ObjectMeta) GetDeletionGracePeriodSeconds() *int64 {
|
||||
return meta.DeletionGracePeriodSeconds
|
||||
}
|
||||
func (meta *ObjectMeta) GetDeletionGracePeriodSeconds() *int64 { return meta.DeletionGracePeriodSeconds }
|
||||
func (meta *ObjectMeta) SetDeletionGracePeriodSeconds(deletionGracePeriodSeconds *int64) {
|
||||
meta.DeletionGracePeriodSeconds = deletionGracePeriodSeconds
|
||||
}
|
||||
|
119
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
generated
vendored
119
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
generated
vendored
@ -135,7 +135,7 @@ type ObjectMeta struct {
|
||||
// +optional
|
||||
GenerateName string `json:"generateName,omitempty" protobuf:"bytes,2,opt,name=generateName"`
|
||||
|
||||
// Namespace defines the space within which each name must be unique. An empty namespace is
|
||||
// Namespace defines the space within each name must be unique. An empty namespace is
|
||||
// equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
// Not all objects are required to be scoped to a namespace - the value of this field for
|
||||
// those objects will be empty.
|
||||
@ -355,23 +355,14 @@ type ListOptions struct {
|
||||
// +optional
|
||||
AllowWatchBookmarks bool `json:"allowWatchBookmarks,omitempty" protobuf:"varint,9,opt,name=allowWatchBookmarks"`
|
||||
|
||||
// resourceVersion sets a constraint on what resource versions a request may be served from.
|
||||
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for
|
||||
// details.
|
||||
//
|
||||
// Defaults to unset
|
||||
// When specified with a watch call, shows changes that occur after that particular version of a resource.
|
||||
// Defaults to changes from the beginning of history.
|
||||
// When specified for list:
|
||||
// - if unset, then the result is returned from remote storage based on quorum-read flag;
|
||||
// - if it's 0, then we simply return what we currently have in cache, no guarantee;
|
||||
// - if set to non zero, then the result is at least as fresh as given rv.
|
||||
// +optional
|
||||
ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,4,opt,name=resourceVersion"`
|
||||
|
||||
// resourceVersionMatch determines how resourceVersion is applied to list calls.
|
||||
// It is highly recommended that resourceVersionMatch be set for list calls where
|
||||
// resourceVersion is set
|
||||
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for
|
||||
// details.
|
||||
//
|
||||
// Defaults to unset
|
||||
// +optional
|
||||
ResourceVersionMatch ResourceVersionMatch `json:"resourceVersionMatch,omitempty" protobuf:"bytes,10,opt,name=resourceVersionMatch,casttype=ResourceVersionMatch"`
|
||||
// Timeout for the list/watch call.
|
||||
// This limits the duration of the call, regardless of any activity or inactivity.
|
||||
// +optional
|
||||
@ -411,25 +402,6 @@ type ListOptions struct {
|
||||
Continue string `json:"continue,omitempty" protobuf:"bytes,8,opt,name=continue"`
|
||||
}
|
||||
|
||||
// resourceVersionMatch specifies how the resourceVersion parameter is applied. resourceVersionMatch
|
||||
// may only be set if resourceVersion is also set.
|
||||
//
|
||||
// "NotOlderThan" matches data at least as new as the provided resourceVersion.
|
||||
// "Exact" matches data at the exact resourceVersion provided.
|
||||
//
|
||||
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for
|
||||
// details.
|
||||
type ResourceVersionMatch string
|
||||
|
||||
const (
|
||||
// ResourceVersionMatchNotOlderThan matches data at least as new as the provided
|
||||
// resourceVersion.
|
||||
ResourceVersionMatchNotOlderThan ResourceVersionMatch = "NotOlderThan"
|
||||
// ResourceVersionMatchExact matches data at the exact resourceVersion
|
||||
// provided.
|
||||
ResourceVersionMatchExact ResourceVersionMatch = "Exact"
|
||||
)
|
||||
|
||||
// +k8s:conversion-gen:explicit-from=net/url.Values
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
@ -451,12 +423,10 @@ type ExportOptions struct {
|
||||
// GetOptions is the standard query options to the standard REST get call.
|
||||
type GetOptions struct {
|
||||
TypeMeta `json:",inline"`
|
||||
// resourceVersion sets a constraint on what resource versions a request may be served from.
|
||||
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for
|
||||
// details.
|
||||
//
|
||||
// Defaults to unset
|
||||
// +optional
|
||||
// When specified:
|
||||
// - if unset, then the result is returned from remote storage based on quorum-read flag;
|
||||
// - if it's 0, then we simply return what we currently have in cache, no guarantee;
|
||||
// - if set to non zero, then the result is at least as fresh as given rv.
|
||||
ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,1,opt,name=resourceVersion"`
|
||||
// +k8s:deprecated=includeUninitialized,protobuf=2
|
||||
}
|
||||
@ -1178,16 +1148,11 @@ const (
|
||||
// If a key maps to an empty Fields value, the field that key represents is part of the set.
|
||||
//
|
||||
// The exact format is defined in sigs.k8s.io/structured-merge-diff
|
||||
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
||||
type FieldsV1 struct {
|
||||
// Raw is the underlying serialization of this object.
|
||||
Raw []byte `json:"-" protobuf:"bytes,1,opt,name=Raw"`
|
||||
}
|
||||
|
||||
func (f FieldsV1) String() string {
|
||||
return string(f.Raw)
|
||||
}
|
||||
|
||||
// TODO: Table does not generate to protobuf because of the interface{} - fix protobuf
|
||||
// generation to support a meta type that can accept any valid JSON. This can be introduced
|
||||
// in a v1 because clients a) receive an error if they try to access proto today, and b)
|
||||
@ -1349,65 +1314,3 @@ type PartialObjectMetadataList struct {
|
||||
// items contains each of the included items.
|
||||
Items []PartialObjectMetadata `json:"items" protobuf:"bytes,2,rep,name=items"`
|
||||
}
|
||||
|
||||
// Condition contains details for one aspect of the current state of this API Resource.
|
||||
// ---
|
||||
// This struct is intended for direct use as an array at the field path .status.conditions. For example,
|
||||
// type FooStatus struct{
|
||||
// // Represents the observations of a foo's current state.
|
||||
// // Known .status.conditions.type are: "Available", "Progressing", and "Degraded"
|
||||
// // +patchMergeKey=type
|
||||
// // +patchStrategy=merge
|
||||
// // +listType=map
|
||||
// // +listMapKey=type
|
||||
// Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
|
||||
//
|
||||
// // other fields
|
||||
// }
|
||||
type Condition struct {
|
||||
// type of condition in CamelCase or in foo.example.com/CamelCase.
|
||||
// ---
|
||||
// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
|
||||
// useful (see .node.status.conditions), the ability to deconflict is important.
|
||||
// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
|
||||
// +required
|
||||
// +kubebuilder:validation:Required
|
||||
// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
|
||||
// +kubebuilder:validation:MaxLength=316
|
||||
Type string `json:"type" protobuf:"bytes,1,opt,name=type"`
|
||||
// status of the condition, one of True, False, Unknown.
|
||||
// +required
|
||||
// +kubebuilder:validation:Required
|
||||
// +kubebuilder:validation:Enum=True;False;Unknown
|
||||
Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status"`
|
||||
// observedGeneration represents the .metadata.generation that the condition was set based upon.
|
||||
// For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
|
||||
// with respect to the current state of the instance.
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"`
|
||||
// lastTransitionTime is the last time the condition transitioned from one status to another.
|
||||
// This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
|
||||
// +required
|
||||
// +kubebuilder:validation:Required
|
||||
// +kubebuilder:validation:Type=string
|
||||
// +kubebuilder:validation:Format=date-time
|
||||
LastTransitionTime Time `json:"lastTransitionTime" protobuf:"bytes,4,opt,name=lastTransitionTime"`
|
||||
// reason contains a programmatic identifier indicating the reason for the condition's last transition.
|
||||
// Producers of specific condition types may define expected values and meanings for this field,
|
||||
// and whether the values are considered a guaranteed API.
|
||||
// The value should be a CamelCase string.
|
||||
// This field may not be empty.
|
||||
// +required
|
||||
// +kubebuilder:validation:Required
|
||||
// +kubebuilder:validation:MaxLength=1024
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$`
|
||||
Reason string `json:"reason" protobuf:"bytes,5,opt,name=reason"`
|
||||
// message is a human readable message indicating details about the transition.
|
||||
// This may be an empty string.
|
||||
// +required
|
||||
// +kubebuilder:validation:Required
|
||||
// +kubebuilder:validation:MaxLength=32768
|
||||
Message string `json:"message" protobuf:"bytes,6,opt,name=message"`
|
||||
}
|
||||
|
37
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go
generated
vendored
37
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go
generated
vendored
@ -86,20 +86,6 @@ func (APIVersions) SwaggerDoc() map[string]string {
|
||||
return map_APIVersions
|
||||
}
|
||||
|
||||
var map_Condition = map[string]string{
|
||||
"": "Condition contains details for one aspect of the current state of this API Resource.",
|
||||
"type": "type of condition in CamelCase or in foo.example.com/CamelCase.",
|
||||
"status": "status of the condition, one of True, False, Unknown.",
|
||||
"observedGeneration": "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.",
|
||||
"lastTransitionTime": "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.",
|
||||
"reason": "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.",
|
||||
"message": "message is a human readable message indicating details about the transition. This may be an empty string.",
|
||||
}
|
||||
|
||||
func (Condition) SwaggerDoc() map[string]string {
|
||||
return map_Condition
|
||||
}
|
||||
|
||||
var map_CreateOptions = map[string]string{
|
||||
"": "CreateOptions may be provided when creating an API object.",
|
||||
"dryRun": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
|
||||
@ -143,7 +129,7 @@ func (FieldsV1) SwaggerDoc() map[string]string {
|
||||
|
||||
var map_GetOptions = map[string]string{
|
||||
"": "GetOptions is the standard query options to the standard REST get call.",
|
||||
"resourceVersion": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
|
||||
"resourceVersion": "When specified: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
|
||||
}
|
||||
|
||||
func (GetOptions) SwaggerDoc() map[string]string {
|
||||
@ -204,16 +190,15 @@ func (ListMeta) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_ListOptions = map[string]string{
|
||||
"": "ListOptions is the query options to a standard REST list call.",
|
||||
"labelSelector": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
|
||||
"fieldSelector": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
|
||||
"watch": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
|
||||
"allowWatchBookmarks": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.",
|
||||
"resourceVersion": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
|
||||
"resourceVersionMatch": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
|
||||
"timeoutSeconds": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
|
||||
"limit": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
|
||||
"continue": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
|
||||
"": "ListOptions is the query options to a standard REST list call.",
|
||||
"labelSelector": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
|
||||
"fieldSelector": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
|
||||
"watch": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
|
||||
"allowWatchBookmarks": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.",
|
||||
"resourceVersion": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
|
||||
"timeoutSeconds": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
|
||||
"limit": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
|
||||
"continue": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
|
||||
}
|
||||
|
||||
func (ListOptions) SwaggerDoc() map[string]string {
|
||||
@ -238,7 +223,7 @@ var map_ObjectMeta = map[string]string{
|
||||
"": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.",
|
||||
"name": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names",
|
||||
"generateName": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency",
|
||||
"namespace": "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces",
|
||||
"namespace": "Namespace defines the space within each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces",
|
||||
"selfLink": "SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.",
|
||||
"uid": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids",
|
||||
"resourceVersion": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency",
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go
generated
vendored
@ -27,7 +27,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// NestedFieldCopy returns a deep copy of the value of a nested field.
|
||||
|
12
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go
generated
vendored
12
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go
generated
vendored
@ -145,11 +145,6 @@ func RegisterConversions(s *runtime.Scheme) error {
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*[]string)(nil), (*ResourceVersionMatch)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_Slice_string_To_v1_ResourceVersionMatch(a.(*[]string), b.(*ResourceVersionMatch), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*[]string)(nil), (*Time)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_Slice_string_To_v1_Time(a.(*[]string), b.(*Time), scope)
|
||||
}); err != nil {
|
||||
@ -420,13 +415,6 @@ func autoConvert_url_Values_To_v1_ListOptions(in *url.Values, out *ListOptions,
|
||||
} else {
|
||||
out.ResourceVersion = ""
|
||||
}
|
||||
if values, ok := map[string][]string(*in)["resourceVersionMatch"]; ok && len(values) > 0 {
|
||||
if err := Convert_Slice_string_To_v1_ResourceVersionMatch(&values, &out.ResourceVersionMatch, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.ResourceVersionMatch = ""
|
||||
}
|
||||
if values, ok := map[string][]string(*in)["timeoutSeconds"]; ok && len(values) > 0 {
|
||||
if err := runtime.Convert_Slice_string_To_Pointer_int64(&values, &out.TimeoutSeconds, s); err != nil {
|
||||
return err
|
||||
|
17
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go
generated
vendored
17
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go
generated
vendored
@ -191,23 +191,6 @@ func (in *APIVersions) DeepCopyObject() runtime.Object {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Condition) DeepCopyInto(out *Condition) {
|
||||
*out = *in
|
||||
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
|
||||
func (in *Condition) DeepCopy() *Condition {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Condition)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CreateOptions) DeepCopyInto(out *CreateOptions) {
|
||||
*out = *in
|
||||
|
10
vendor/k8s.io/apimachinery/pkg/conversion/converter.go
generated
vendored
10
vendor/k8s.io/apimachinery/pkg/conversion/converter.go
generated
vendored
@ -442,20 +442,20 @@ func (c *Converter) doConversion(src, dest interface{}, flags FieldMatchingFlags
|
||||
if fn, ok := c.generatedConversionFuncs.untyped[pair]; ok {
|
||||
return fn(src, dest, scope)
|
||||
}
|
||||
// TODO: consider everything past this point deprecated - we want to support only point to point top level
|
||||
// conversions
|
||||
|
||||
dv, err := EnforcePtr(dest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !dv.CanAddr() && !dv.CanSet() {
|
||||
return fmt.Errorf("can't write to dest")
|
||||
}
|
||||
sv, err := EnforcePtr(src)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return fmt.Errorf("converting (%s) to (%s): unknown conversion", sv.Type(), dv.Type())
|
||||
|
||||
// TODO: Everything past this point is deprecated.
|
||||
// Remove in 1.20 once we're sure it didn't break anything.
|
||||
|
||||
// Leave something on the stack, so that calls to struct tag getters never fail.
|
||||
scope.srcStack.push(scopeStackElem{})
|
||||
scope.destStack.push(scopeStackElem{})
|
||||
|
16
vendor/k8s.io/apimachinery/pkg/fields/selector.go
generated
vendored
16
vendor/k8s.io/apimachinery/pkg/fields/selector.go
generated
vendored
@ -57,15 +57,13 @@ type Selector interface {
|
||||
|
||||
type nothingSelector struct{}
|
||||
|
||||
func (n nothingSelector) Matches(_ Fields) bool { return false }
|
||||
func (n nothingSelector) Empty() bool { return false }
|
||||
func (n nothingSelector) String() string { return "" }
|
||||
func (n nothingSelector) Requirements() Requirements { return nil }
|
||||
func (n nothingSelector) DeepCopySelector() Selector { return n }
|
||||
func (n nothingSelector) RequiresExactMatch(field string) (value string, found bool) {
|
||||
return "", false
|
||||
}
|
||||
func (n nothingSelector) Transform(fn TransformFunc) (Selector, error) { return n, nil }
|
||||
func (n nothingSelector) Matches(_ Fields) bool { return false }
|
||||
func (n nothingSelector) Empty() bool { return false }
|
||||
func (n nothingSelector) String() string { return "" }
|
||||
func (n nothingSelector) Requirements() Requirements { return nil }
|
||||
func (n nothingSelector) DeepCopySelector() Selector { return n }
|
||||
func (n nothingSelector) RequiresExactMatch(field string) (value string, found bool) { return "", false }
|
||||
func (n nothingSelector) Transform(fn TransformFunc) (Selector, error) { return n, nil }
|
||||
|
||||
// Nothing returns a selector that matches no fields
|
||||
func Nothing() Selector {
|
||||
|
14
vendor/k8s.io/apimachinery/pkg/labels/labels.go
generated
vendored
14
vendor/k8s.io/apimachinery/pkg/labels/labels.go
generated
vendored
@ -57,22 +57,14 @@ func (ls Set) Get(label string) string {
|
||||
return ls[label]
|
||||
}
|
||||
|
||||
// AsSelector converts labels into a selectors. It does not
|
||||
// perform any validation, which means the server will reject
|
||||
// the request if the Set contains invalid values.
|
||||
// AsSelector converts labels into a selectors.
|
||||
func (ls Set) AsSelector() Selector {
|
||||
return SelectorFromSet(ls)
|
||||
}
|
||||
|
||||
// AsValidatedSelector converts labels into a selectors.
|
||||
// The Set is validated client-side, which allows to catch errors early.
|
||||
func (ls Set) AsValidatedSelector() (Selector, error) {
|
||||
return ValidatedSelectorFromSet(ls)
|
||||
}
|
||||
|
||||
// AsSelectorPreValidated converts labels into a selector, but
|
||||
// assumes that labels are already validated and thus doesn't
|
||||
// perform any validation.
|
||||
// assumes that labels are already validated and thus don't
|
||||
// preform any validation.
|
||||
// According to our measurements this is significantly faster
|
||||
// in codepaths that matter at high scale.
|
||||
func (ls Set) AsSelectorPreValidated() Selector {
|
||||
|
41
vendor/k8s.io/apimachinery/pkg/labels/selector.go
generated
vendored
41
vendor/k8s.io/apimachinery/pkg/labels/selector.go
generated
vendored
@ -26,7 +26,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/selection"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/validation"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// Requirements is AND of all requirements.
|
||||
@ -68,15 +68,13 @@ func Everything() Selector {
|
||||
|
||||
type nothingSelector struct{}
|
||||
|
||||
func (n nothingSelector) Matches(_ Labels) bool { return false }
|
||||
func (n nothingSelector) Empty() bool { return false }
|
||||
func (n nothingSelector) String() string { return "" }
|
||||
func (n nothingSelector) Add(_ ...Requirement) Selector { return n }
|
||||
func (n nothingSelector) Requirements() (Requirements, bool) { return nil, false }
|
||||
func (n nothingSelector) DeepCopySelector() Selector { return n }
|
||||
func (n nothingSelector) RequiresExactMatch(label string) (value string, found bool) {
|
||||
return "", false
|
||||
}
|
||||
func (n nothingSelector) Matches(_ Labels) bool { return false }
|
||||
func (n nothingSelector) Empty() bool { return false }
|
||||
func (n nothingSelector) String() string { return "" }
|
||||
func (n nothingSelector) Add(_ ...Requirement) Selector { return n }
|
||||
func (n nothingSelector) Requirements() (Requirements, bool) { return nil, false }
|
||||
func (n nothingSelector) DeepCopySelector() Selector { return n }
|
||||
func (n nothingSelector) RequiresExactMatch(label string) (value string, found bool) { return "", false }
|
||||
|
||||
// Nothing returns a selector that matches no labels
|
||||
func Nothing() Selector {
|
||||
@ -223,7 +221,7 @@ func (r *Requirement) Matches(ls Labels) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// There should be only one strValue in r.strValues, and can be converted to an integer.
|
||||
// There should be only one strValue in r.strValues, and can be converted to a integer.
|
||||
if len(r.strValues) != 1 {
|
||||
klog.V(10).Infof("Invalid values count %+v of requirement %#v, for 'Gt', 'Lt' operators, exactly one value is required", len(r.strValues), r)
|
||||
return false
|
||||
@ -871,30 +869,23 @@ func validateLabelValue(k, v string) error {
|
||||
|
||||
// SelectorFromSet returns a Selector which will match exactly the given Set. A
|
||||
// nil and empty Sets are considered equivalent to Everything().
|
||||
// It does not perform any validation, which means the server will reject
|
||||
// the request if the Set contains invalid values.
|
||||
func SelectorFromSet(ls Set) Selector {
|
||||
return SelectorFromValidatedSet(ls)
|
||||
}
|
||||
|
||||
// ValidatedSelectorFromSet returns a Selector which will match exactly the given Set. A
|
||||
// nil and empty Sets are considered equivalent to Everything().
|
||||
// The Set is validated client-side, which allows to catch errors early.
|
||||
func ValidatedSelectorFromSet(ls Set) (Selector, error) {
|
||||
if ls == nil || len(ls) == 0 {
|
||||
return internalSelector{}, nil
|
||||
return internalSelector{}
|
||||
}
|
||||
requirements := make([]Requirement, 0, len(ls))
|
||||
for label, value := range ls {
|
||||
r, err := NewRequirement(label, selection.Equals, []string{value})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if err == nil {
|
||||
requirements = append(requirements, *r)
|
||||
} else {
|
||||
//TODO: double check errors when input comes from serialization?
|
||||
return internalSelector{}
|
||||
}
|
||||
requirements = append(requirements, *r)
|
||||
}
|
||||
// sort to have deterministic string representation
|
||||
sort.Sort(ByKey(requirements))
|
||||
return internalSelector(requirements), nil
|
||||
return internalSelector(requirements)
|
||||
}
|
||||
|
||||
// SelectorFromValidatedSet returns a Selector which will match exactly the given Set.
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/runtime/codec.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/runtime/codec.go
generated
vendored
@ -29,7 +29,7 @@ import (
|
||||
|
||||
"k8s.io/apimachinery/pkg/conversion/queryparams"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// codec binds an encoder and decoder.
|
||||
|
10
vendor/k8s.io/apimachinery/pkg/runtime/codec_check.go
generated
vendored
10
vendor/k8s.io/apimachinery/pkg/runtime/codec_check.go
generated
vendored
@ -21,7 +21,6 @@ import (
|
||||
"reflect"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
)
|
||||
|
||||
// CheckCodec makes sure that the codec can encode objects like internalType,
|
||||
@ -33,14 +32,7 @@ func CheckCodec(c Codec, internalType Object, externalTypes ...schema.GroupVersi
|
||||
return fmt.Errorf("Internal type not encodable: %v", err)
|
||||
}
|
||||
for _, et := range externalTypes {
|
||||
typeMeta := TypeMeta{
|
||||
Kind: et.Kind,
|
||||
APIVersion: et.GroupVersion().String(),
|
||||
}
|
||||
exBytes, err := json.Marshal(&typeMeta)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
exBytes := []byte(fmt.Sprintf(`{"kind":"%v","apiVersion":"%v"}`, et.Kind, et.GroupVersion().String()))
|
||||
obj, err := Decode(c, exBytes)
|
||||
if err != nil {
|
||||
return fmt.Errorf("external type %s not interpretable: %v", et, err)
|
||||
|
4
vendor/k8s.io/apimachinery/pkg/runtime/converter.go
generated
vendored
4
vendor/k8s.io/apimachinery/pkg/runtime/converter.go
generated
vendored
@ -31,9 +31,9 @@ import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"sigs.k8s.io/structured-merge-diff/v4/value"
|
||||
"sigs.k8s.io/structured-merge-diff/v3/value"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// UnstructuredConverter is an interface for converting between interface{}
|
||||
|
17
vendor/k8s.io/apimachinery/pkg/runtime/schema/group_version.go
generated
vendored
17
vendor/k8s.io/apimachinery/pkg/runtime/schema/group_version.go
generated
vendored
@ -176,6 +176,15 @@ func (gv GroupVersion) Empty() bool {
|
||||
// String puts "group" and "version" into a single "group/version" string. For the legacy v1
|
||||
// it returns "v1".
|
||||
func (gv GroupVersion) String() string {
|
||||
// special case the internal apiVersion for the legacy kube types
|
||||
if gv.Empty() {
|
||||
return ""
|
||||
}
|
||||
|
||||
// special case of "v1" for backward compatibility
|
||||
if len(gv.Group) == 0 && gv.Version == "v1" {
|
||||
return gv.Version
|
||||
}
|
||||
if len(gv.Group) > 0 {
|
||||
return gv.Group + "/" + gv.Version
|
||||
}
|
||||
@ -243,10 +252,10 @@ func (gv GroupVersion) WithResource(resource string) GroupVersionResource {
|
||||
type GroupVersions []GroupVersion
|
||||
|
||||
// Identifier implements runtime.GroupVersioner interface.
|
||||
func (gvs GroupVersions) Identifier() string {
|
||||
groupVersions := make([]string, 0, len(gvs))
|
||||
for i := range gvs {
|
||||
groupVersions = append(groupVersions, gvs[i].String())
|
||||
func (gv GroupVersions) Identifier() string {
|
||||
groupVersions := make([]string, 0, len(gv))
|
||||
for i := range gv {
|
||||
groupVersions = append(groupVersions, gv[i].String())
|
||||
}
|
||||
return fmt.Sprintf("[%s]", strings.Join(groupVersions, ","))
|
||||
}
|
||||
|
13
vendor/k8s.io/apimachinery/pkg/runtime/scheme.go
generated
vendored
13
vendor/k8s.io/apimachinery/pkg/runtime/scheme.go
generated
vendored
@ -211,19 +211,6 @@ func (s *Scheme) AddKnownTypeWithName(gvk schema.GroupVersionKind, obj Object) {
|
||||
}
|
||||
}
|
||||
s.typeToGVK[t] = append(s.typeToGVK[t], gvk)
|
||||
|
||||
// if the type implements DeepCopyInto(<obj>), register a self-conversion
|
||||
if m := reflect.ValueOf(obj).MethodByName("DeepCopyInto"); m.IsValid() && m.Type().NumIn() == 1 && m.Type().NumOut() == 0 && m.Type().In(0) == reflect.TypeOf(obj) {
|
||||
if err := s.AddGeneratedConversionFunc(obj, obj, func(a, b interface{}, scope conversion.Scope) error {
|
||||
// copy a to b
|
||||
reflect.ValueOf(a).MethodByName("DeepCopyInto").Call([]reflect.Value{reflect.ValueOf(b)})
|
||||
// clear TypeMeta to match legacy reflective conversion
|
||||
b.(Object).GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{})
|
||||
return nil
|
||||
}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// KnownTypes returns the types known for the given version.
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go
generated
vendored
@ -31,7 +31,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer/recognizer"
|
||||
"k8s.io/apimachinery/pkg/util/framer"
|
||||
utilyaml "k8s.io/apimachinery/pkg/util/yaml"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// NewSerializer creates a JSON serializer that handles encoding versioned objects into the proper JSON form. If typer
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go
generated
vendored
@ -25,7 +25,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// NewDefaultingCodecForScheme is a convenience method for callers that are using a scheme.
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go
generated
vendored
@ -26,7 +26,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/google/gofuzz"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// IntOrString is a type that can hold an int32 or a string. When used in
|
||||
|
299
vendor/k8s.io/apimachinery/pkg/util/net/http.go
generated
vendored
299
vendor/k8s.io/apimachinery/pkg/util/net/http.go
generated
vendored
@ -21,24 +21,18 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"mime"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"golang.org/x/net/http2"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// JoinPreservingTrailingSlash does a path.Join of the specified elements,
|
||||
@ -63,11 +57,8 @@ func JoinPreservingTrailingSlash(elem ...string) string {
|
||||
|
||||
// IsTimeout returns true if the given error is a network timeout error
|
||||
func IsTimeout(err error) bool {
|
||||
var neterr net.Error
|
||||
if errors.As(err, &neterr) {
|
||||
return neterr != nil && neterr.Timeout()
|
||||
}
|
||||
return false
|
||||
neterr, ok := err.(net.Error)
|
||||
return ok && neterr != nil && neterr.Timeout()
|
||||
}
|
||||
|
||||
// IsProbableEOF returns true if the given error resembles a connection termination
|
||||
@ -80,16 +71,13 @@ func IsProbableEOF(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
var uerr *url.Error
|
||||
if errors.As(err, &uerr) {
|
||||
if uerr, ok := err.(*url.Error); ok {
|
||||
err = uerr.Err
|
||||
}
|
||||
msg := err.Error()
|
||||
switch {
|
||||
case err == io.EOF:
|
||||
return true
|
||||
case err == io.ErrUnexpectedEOF:
|
||||
return true
|
||||
case msg == "http: can't write HTTP request on broken connection":
|
||||
return true
|
||||
case strings.Contains(msg, "http2: server sent GOAWAY and closed the connection"):
|
||||
@ -133,61 +121,13 @@ func SetTransportDefaults(t *http.Transport) *http.Transport {
|
||||
if s := os.Getenv("DISABLE_HTTP2"); len(s) > 0 {
|
||||
klog.Infof("HTTP2 has been explicitly disabled")
|
||||
} else if allowsHTTP2(t) {
|
||||
if err := configureHTTP2Transport(t); err != nil {
|
||||
if err := http2.ConfigureTransport(t); err != nil {
|
||||
klog.Warningf("Transport failed http2 configuration: %v", err)
|
||||
}
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
func readIdleTimeoutSeconds() int {
|
||||
ret := 30
|
||||
// User can set the readIdleTimeout to 0 to disable the HTTP/2
|
||||
// connection health check.
|
||||
if s := os.Getenv("HTTP2_READ_IDLE_TIMEOUT_SECONDS"); len(s) > 0 {
|
||||
i, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
klog.Warningf("Illegal HTTP2_READ_IDLE_TIMEOUT_SECONDS(%q): %v."+
|
||||
" Default value %d is used", s, err, ret)
|
||||
return ret
|
||||
}
|
||||
ret = i
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func pingTimeoutSeconds() int {
|
||||
ret := 15
|
||||
if s := os.Getenv("HTTP2_PING_TIMEOUT_SECONDS"); len(s) > 0 {
|
||||
i, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
klog.Warningf("Illegal HTTP2_PING_TIMEOUT_SECONDS(%q): %v."+
|
||||
" Default value %d is used", s, err, ret)
|
||||
return ret
|
||||
}
|
||||
ret = i
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func configureHTTP2Transport(t *http.Transport) error {
|
||||
t2, err := http2.ConfigureTransports(t)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// The following enables the HTTP/2 connection health check added in
|
||||
// https://github.com/golang/net/pull/55. The health check detects and
|
||||
// closes broken transport layer connections. Without the health check,
|
||||
// a broken connection can linger too long, e.g., a broken TCP
|
||||
// connection will be closed by the Linux kernel after 13 to 30 minutes
|
||||
// by default, which caused
|
||||
// https://github.com/kubernetes/client-go/issues/374 and
|
||||
// https://github.com/kubernetes/kubernetes/issues/87615.
|
||||
t2.ReadIdleTimeout = time.Duration(readIdleTimeoutSeconds()) * time.Second
|
||||
t2.PingTimeout = time.Duration(pingTimeoutSeconds()) * time.Second
|
||||
return nil
|
||||
}
|
||||
|
||||
func allowsHTTP2(t *http.Transport) bool {
|
||||
if t.TLSClientConfig == nil || len(t.TLSClientConfig.NextProtos) == 0 {
|
||||
// the transport expressed no NextProto preference, allow
|
||||
@ -542,232 +482,3 @@ func CloneHeader(in http.Header) http.Header {
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// WarningHeader contains a single RFC2616 14.46 warnings header
|
||||
type WarningHeader struct {
|
||||
// Codeindicates the type of warning. 299 is a miscellaneous persistent warning
|
||||
Code int
|
||||
// Agent contains the name or pseudonym of the server adding the Warning header.
|
||||
// A single "-" is recommended when agent is unknown.
|
||||
Agent string
|
||||
// Warning text
|
||||
Text string
|
||||
}
|
||||
|
||||
// ParseWarningHeaders extract RFC2616 14.46 warnings headers from the specified set of header values.
|
||||
// Multiple comma-separated warnings per header are supported.
|
||||
// If errors are encountered on a header, the remainder of that header are skipped and subsequent headers are parsed.
|
||||
// Returns successfully parsed warnings and any errors encountered.
|
||||
func ParseWarningHeaders(headers []string) ([]WarningHeader, []error) {
|
||||
var (
|
||||
results []WarningHeader
|
||||
errs []error
|
||||
)
|
||||
for _, header := range headers {
|
||||
for len(header) > 0 {
|
||||
result, remainder, err := ParseWarningHeader(header)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
break
|
||||
}
|
||||
results = append(results, result)
|
||||
header = remainder
|
||||
}
|
||||
}
|
||||
return results, errs
|
||||
}
|
||||
|
||||
var (
|
||||
codeMatcher = regexp.MustCompile(`^[0-9]{3}$`)
|
||||
wordDecoder = &mime.WordDecoder{}
|
||||
)
|
||||
|
||||
// ParseWarningHeader extracts one RFC2616 14.46 warning from the specified header,
|
||||
// returning an error if the header does not contain a correctly formatted warning.
|
||||
// Any remaining content in the header is returned.
|
||||
func ParseWarningHeader(header string) (result WarningHeader, remainder string, err error) {
|
||||
// https://tools.ietf.org/html/rfc2616#section-14.46
|
||||
// updated by
|
||||
// https://tools.ietf.org/html/rfc7234#section-5.5
|
||||
// https://tools.ietf.org/html/rfc7234#appendix-A
|
||||
// Some requirements regarding production and processing of the Warning
|
||||
// header fields have been relaxed, as it is not widely implemented.
|
||||
// Furthermore, the Warning header field no longer uses RFC 2047
|
||||
// encoding, nor does it allow multiple languages, as these aspects were
|
||||
// not implemented.
|
||||
//
|
||||
// Format is one of:
|
||||
// warn-code warn-agent "warn-text"
|
||||
// warn-code warn-agent "warn-text" "warn-date"
|
||||
//
|
||||
// warn-code is a three digit number
|
||||
// warn-agent is unquoted and contains no spaces
|
||||
// warn-text is quoted with backslash escaping (RFC2047-encoded according to RFC2616, not encoded according to RFC7234)
|
||||
// warn-date is optional, quoted, and in HTTP-date format (no embedded or escaped quotes)
|
||||
//
|
||||
// additional warnings can optionally be included in the same header by comma-separating them:
|
||||
// warn-code warn-agent "warn-text" "warn-date"[, warn-code warn-agent "warn-text" "warn-date", ...]
|
||||
|
||||
// tolerate leading whitespace
|
||||
header = strings.TrimSpace(header)
|
||||
|
||||
parts := strings.SplitN(header, " ", 3)
|
||||
if len(parts) != 3 {
|
||||
return WarningHeader{}, "", errors.New("invalid warning header: fewer than 3 segments")
|
||||
}
|
||||
code, agent, textDateRemainder := parts[0], parts[1], parts[2]
|
||||
|
||||
// verify code format
|
||||
if !codeMatcher.Match([]byte(code)) {
|
||||
return WarningHeader{}, "", errors.New("invalid warning header: code segment is not 3 digits between 100-299")
|
||||
}
|
||||
codeInt, _ := strconv.ParseInt(code, 10, 64)
|
||||
|
||||
// verify agent presence
|
||||
if len(agent) == 0 {
|
||||
return WarningHeader{}, "", errors.New("invalid warning header: empty agent segment")
|
||||
}
|
||||
if !utf8.ValidString(agent) || hasAnyRunes(agent, unicode.IsControl) {
|
||||
return WarningHeader{}, "", errors.New("invalid warning header: invalid agent")
|
||||
}
|
||||
|
||||
// verify textDateRemainder presence
|
||||
if len(textDateRemainder) == 0 {
|
||||
return WarningHeader{}, "", errors.New("invalid warning header: empty text segment")
|
||||
}
|
||||
|
||||
// extract text
|
||||
text, dateAndRemainder, err := parseQuotedString(textDateRemainder)
|
||||
if err != nil {
|
||||
return WarningHeader{}, "", fmt.Errorf("invalid warning header: %v", err)
|
||||
}
|
||||
// tolerate RFC2047-encoded text from warnings produced according to RFC2616
|
||||
if decodedText, err := wordDecoder.DecodeHeader(text); err == nil {
|
||||
text = decodedText
|
||||
}
|
||||
if !utf8.ValidString(text) || hasAnyRunes(text, unicode.IsControl) {
|
||||
return WarningHeader{}, "", errors.New("invalid warning header: invalid text")
|
||||
}
|
||||
result = WarningHeader{Code: int(codeInt), Agent: agent, Text: text}
|
||||
|
||||
if len(dateAndRemainder) > 0 {
|
||||
if dateAndRemainder[0] == '"' {
|
||||
// consume date
|
||||
foundEndQuote := false
|
||||
for i := 1; i < len(dateAndRemainder); i++ {
|
||||
if dateAndRemainder[i] == '"' {
|
||||
foundEndQuote = true
|
||||
remainder = strings.TrimSpace(dateAndRemainder[i+1:])
|
||||
break
|
||||
}
|
||||
}
|
||||
if !foundEndQuote {
|
||||
return WarningHeader{}, "", errors.New("invalid warning header: unterminated date segment")
|
||||
}
|
||||
} else {
|
||||
remainder = dateAndRemainder
|
||||
}
|
||||
}
|
||||
if len(remainder) > 0 {
|
||||
if remainder[0] == ',' {
|
||||
// consume comma if present
|
||||
remainder = strings.TrimSpace(remainder[1:])
|
||||
} else {
|
||||
return WarningHeader{}, "", errors.New("invalid warning header: unexpected token after warn-date")
|
||||
}
|
||||
}
|
||||
|
||||
return result, remainder, nil
|
||||
}
|
||||
|
||||
func parseQuotedString(quotedString string) (string, string, error) {
|
||||
if len(quotedString) == 0 {
|
||||
return "", "", errors.New("invalid quoted string: 0-length")
|
||||
}
|
||||
|
||||
if quotedString[0] != '"' {
|
||||
return "", "", errors.New("invalid quoted string: missing initial quote")
|
||||
}
|
||||
|
||||
quotedString = quotedString[1:]
|
||||
var remainder string
|
||||
escaping := false
|
||||
closedQuote := false
|
||||
result := &bytes.Buffer{}
|
||||
loop:
|
||||
for i := 0; i < len(quotedString); i++ {
|
||||
b := quotedString[i]
|
||||
switch b {
|
||||
case '"':
|
||||
if escaping {
|
||||
result.WriteByte(b)
|
||||
escaping = false
|
||||
} else {
|
||||
closedQuote = true
|
||||
remainder = strings.TrimSpace(quotedString[i+1:])
|
||||
break loop
|
||||
}
|
||||
case '\\':
|
||||
if escaping {
|
||||
result.WriteByte(b)
|
||||
escaping = false
|
||||
} else {
|
||||
escaping = true
|
||||
}
|
||||
default:
|
||||
result.WriteByte(b)
|
||||
escaping = false
|
||||
}
|
||||
}
|
||||
|
||||
if !closedQuote {
|
||||
return "", "", errors.New("invalid quoted string: missing closing quote")
|
||||
}
|
||||
return result.String(), remainder, nil
|
||||
}
|
||||
|
||||
func NewWarningHeader(code int, agent, text string) (string, error) {
|
||||
if code < 0 || code > 999 {
|
||||
return "", errors.New("code must be between 0 and 999")
|
||||
}
|
||||
if len(agent) == 0 {
|
||||
agent = "-"
|
||||
} else if !utf8.ValidString(agent) || strings.ContainsAny(agent, `\"`) || hasAnyRunes(agent, unicode.IsSpace, unicode.IsControl) {
|
||||
return "", errors.New("agent must be valid UTF-8 and must not contain spaces, quotes, backslashes, or control characters")
|
||||
}
|
||||
if !utf8.ValidString(text) || hasAnyRunes(text, unicode.IsControl) {
|
||||
return "", errors.New("text must be valid UTF-8 and must not contain control characters")
|
||||
}
|
||||
return fmt.Sprintf("%03d %s %s", code, agent, makeQuotedString(text)), nil
|
||||
}
|
||||
|
||||
func hasAnyRunes(s string, runeCheckers ...func(rune) bool) bool {
|
||||
for _, r := range s {
|
||||
for _, checker := range runeCheckers {
|
||||
if checker(r) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func makeQuotedString(s string) string {
|
||||
result := &bytes.Buffer{}
|
||||
// opening quote
|
||||
result.WriteRune('"')
|
||||
for _, c := range s {
|
||||
switch c {
|
||||
case '"', '\\':
|
||||
// escape " and \
|
||||
result.WriteRune('\\')
|
||||
result.WriteRune(c)
|
||||
default:
|
||||
// write everything else as-is
|
||||
result.WriteRune(c)
|
||||
}
|
||||
}
|
||||
// closing quote
|
||||
result.WriteRune('"')
|
||||
return result.String()
|
||||
}
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/util/net/interface.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/util/net/interface.go
generated
vendored
@ -26,7 +26,7 @@ import (
|
||||
|
||||
"strings"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
type AddressFamily uint
|
||||
|
31
vendor/k8s.io/apimachinery/pkg/util/net/util.go
generated
vendored
31
vendor/k8s.io/apimachinery/pkg/util/net/util.go
generated
vendored
@ -17,8 +17,9 @@ limitations under the License.
|
||||
package net
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"net/url"
|
||||
"os"
|
||||
"reflect"
|
||||
"syscall"
|
||||
)
|
||||
@ -39,18 +40,34 @@ func IPNetEqual(ipnet1, ipnet2 *net.IPNet) bool {
|
||||
|
||||
// Returns if the given err is "connection reset by peer" error.
|
||||
func IsConnectionReset(err error) bool {
|
||||
var errno syscall.Errno
|
||||
if errors.As(err, &errno) {
|
||||
return errno == syscall.ECONNRESET
|
||||
if urlErr, ok := err.(*url.Error); ok {
|
||||
err = urlErr.Err
|
||||
}
|
||||
if opErr, ok := err.(*net.OpError); ok {
|
||||
err = opErr.Err
|
||||
}
|
||||
if osErr, ok := err.(*os.SyscallError); ok {
|
||||
err = osErr.Err
|
||||
}
|
||||
if errno, ok := err.(syscall.Errno); ok && errno == syscall.ECONNRESET {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Returns if the given err is "connection refused" error
|
||||
func IsConnectionRefused(err error) bool {
|
||||
var errno syscall.Errno
|
||||
if errors.As(err, &errno) {
|
||||
return errno == syscall.ECONNREFUSED
|
||||
if urlErr, ok := err.(*url.Error); ok {
|
||||
err = urlErr.Err
|
||||
}
|
||||
if opErr, ok := err.(*net.OpError); ok {
|
||||
err = opErr.Err
|
||||
}
|
||||
if osErr, ok := err.(*os.SyscallError); ok {
|
||||
err = osErr.Err
|
||||
}
|
||||
if errno, ok := err.(syscall.Errno); ok && errno == syscall.ECONNREFUSED {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go
generated
vendored
@ -23,7 +23,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
var (
|
||||
|
5
vendor/k8s.io/apimachinery/pkg/util/validation/validation.go
generated
vendored
5
vendor/k8s.io/apimachinery/pkg/util/validation/validation.go
generated
vendored
@ -106,11 +106,6 @@ func IsFullyQualifiedDomainName(fldPath *field.Path, name string) field.ErrorLis
|
||||
if len(strings.Split(name, ".")) < 2 {
|
||||
return append(allErrors, field.Invalid(fldPath, name, "should be a domain with at least two segments separated by dots"))
|
||||
}
|
||||
for _, label := range strings.Split(name, ".") {
|
||||
if errs := IsDNS1123Label(label); len(errs) > 0 {
|
||||
return append(allErrors, field.Invalid(fldPath, label, strings.Join(errs, ",")))
|
||||
}
|
||||
}
|
||||
return allErrors
|
||||
}
|
||||
|
||||
|
6
vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go
generated
vendored
6
vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go
generated
vendored
@ -26,7 +26,7 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
@ -92,10 +92,6 @@ type YAMLDecoder struct {
|
||||
// the caller in framing the chunk.
|
||||
func NewDocumentDecoder(r io.ReadCloser) io.ReadCloser {
|
||||
scanner := bufio.NewScanner(r)
|
||||
// the size of initial allocation for buffer 4k
|
||||
buf := make([]byte, 4*1024)
|
||||
// the maximum size used to buffer a token 5M
|
||||
scanner.Buffer(buf, 5*1024*1024)
|
||||
scanner.Split(splitYAMLDocument)
|
||||
return &YAMLDecoder{
|
||||
r: r,
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/watch/streamwatcher.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/watch/streamwatcher.go
generated
vendored
@ -21,7 +21,7 @@ import (
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/net"
|
||||
|
8
vendor/k8s.io/apimachinery/pkg/watch/watch.go
generated
vendored
8
vendor/k8s.io/apimachinery/pkg/watch/watch.go
generated
vendored
@ -20,7 +20,7 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
@ -32,8 +32,8 @@ type Interface interface {
|
||||
Stop()
|
||||
|
||||
// Returns a chan which will receive all the events. If an error occurs
|
||||
// or Stop() is called, the implementation will close this channel and
|
||||
// release any resources used by the watch.
|
||||
// or Stop() is called, this channel will be closed, in which case the
|
||||
// watch should be completely cleaned up.
|
||||
ResultChan() <-chan Event
|
||||
}
|
||||
|
||||
@ -46,9 +46,7 @@ const (
|
||||
Deleted EventType = "DELETED"
|
||||
Bookmark EventType = "BOOKMARK"
|
||||
Error EventType = "ERROR"
|
||||
)
|
||||
|
||||
var (
|
||||
DefaultChanSize int32 = 100
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user