mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 21:47:13 +08:00
go.mod: update k8s deps to v0.26.2 (remove "replace" rule)
Replace rules are not inherited by consumers of buildx as a module, and as such would default to use the v0.26.2 version. Removing the replace rules also removes various (indirect) dependencies (although brings in some new packages from k8s itself). The "azure" and "gcp" authentication packages in k8s.io/go-client are now no longer functional, so removing those imports. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
35
vendor/k8s.io/apimachinery/pkg/api/meta/errors.go
generated
vendored
35
vendor/k8s.io/apimachinery/pkg/api/meta/errors.go
generated
vendored
@ -17,6 +17,7 @@ limitations under the License.
|
||||
package meta
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
@ -43,6 +44,11 @@ func (e *AmbiguousResourceError) Error() string {
|
||||
return fmt.Sprintf("%v matches multiple resources or kinds", e.PartialResource)
|
||||
}
|
||||
|
||||
func (*AmbiguousResourceError) Is(target error) bool {
|
||||
_, ok := target.(*AmbiguousResourceError)
|
||||
return ok
|
||||
}
|
||||
|
||||
// AmbiguousKindError is returned if the RESTMapper finds multiple matches for a kind
|
||||
type AmbiguousKindError struct {
|
||||
PartialKind schema.GroupVersionKind
|
||||
@ -63,16 +69,16 @@ func (e *AmbiguousKindError) Error() string {
|
||||
return fmt.Sprintf("%v matches multiple resources or kinds", e.PartialKind)
|
||||
}
|
||||
|
||||
func (*AmbiguousKindError) Is(target error) bool {
|
||||
_, ok := target.(*AmbiguousKindError)
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsAmbiguousError(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
switch err.(type) {
|
||||
case *AmbiguousResourceError, *AmbiguousKindError:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
return errors.Is(err, &AmbiguousResourceError{}) || errors.Is(err, &AmbiguousKindError{})
|
||||
}
|
||||
|
||||
// NoResourceMatchError is returned if the RESTMapper can't find any match for a resource
|
||||
@ -84,6 +90,11 @@ func (e *NoResourceMatchError) Error() string {
|
||||
return fmt.Sprintf("no matches for %v", e.PartialResource)
|
||||
}
|
||||
|
||||
func (*NoResourceMatchError) Is(target error) bool {
|
||||
_, ok := target.(*NoResourceMatchError)
|
||||
return ok
|
||||
}
|
||||
|
||||
// NoKindMatchError is returned if the RESTMapper can't find any match for a kind
|
||||
type NoKindMatchError struct {
|
||||
// GroupKind is the API group and kind that was searched
|
||||
@ -108,14 +119,14 @@ func (e *NoKindMatchError) Error() string {
|
||||
}
|
||||
}
|
||||
|
||||
func (*NoKindMatchError) Is(target error) bool {
|
||||
_, ok := target.(*NoKindMatchError)
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsNoMatchError(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
switch err.(type) {
|
||||
case *NoResourceMatchError, *NoKindMatchError:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
return errors.Is(err, &NoResourceMatchError{}) || errors.Is(err, &NoKindMatchError{})
|
||||
}
|
||||
|
Reference in New Issue
Block a user