rebase: update kubernetes to v1.23.0

updating go dependency to latest kubernetes
released version i.e v1.23.0

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2021-12-08 19:20:47 +05:30
committed by mergify[bot]
parent 42403e2ba7
commit 5762da3e91
789 changed files with 49781 additions and 11501 deletions

View File

@ -19,6 +19,7 @@ package runtime
import (
"fmt"
"reflect"
"strings"
"k8s.io/apimachinery/pkg/runtime/schema"
)
@ -124,20 +125,30 @@ func IsMissingVersion(err error) bool {
// strictDecodingError is a base error type that is returned by a strict Decoder such
// as UniversalStrictDecoder.
type strictDecodingError struct {
message string
data string
errors []error
}
// NewStrictDecodingError creates a new strictDecodingError object.
func NewStrictDecodingError(message string, data string) error {
func NewStrictDecodingError(errors []error) error {
return &strictDecodingError{
message: message,
data: data,
errors: errors,
}
}
func (e *strictDecodingError) Error() string {
return fmt.Sprintf("strict decoder error for %s: %s", e.data, e.message)
var s strings.Builder
s.WriteString("strict decoding error: ")
for i, err := range e.errors {
if i != 0 {
s.WriteString(", ")
}
s.WriteString(err.Error())
}
return s.String()
}
func (e *strictDecodingError) Errors() []error {
return e.errors
}
// IsStrictDecodingError returns true if the error indicates that the provided object
@ -149,3 +160,13 @@ func IsStrictDecodingError(err error) bool {
_, ok := err.(*strictDecodingError)
return ok
}
// AsStrictDecodingError returns a strict decoding error
// containing all the strictness violations.
func AsStrictDecodingError(err error) (*strictDecodingError, bool) {
if err == nil {
return nil, false
}
strictErr, ok := err.(*strictDecodingError)
return strictErr, ok
}