update dependencies (#6267)
Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
19
vendor/k8s.io/cli-runtime/pkg/genericclioptions/builder_flags_fake.go
generated
vendored
19
vendor/k8s.io/cli-runtime/pkg/genericclioptions/builder_flags_fake.go
generated
vendored
@@ -21,29 +21,40 @@ import (
|
||||
)
|
||||
|
||||
// NewSimpleFakeResourceFinder builds a super simple ResourceFinder that just iterates over the objects you provided
|
||||
func NewSimpleFakeResourceFinder(infos ...*resource.Info) ResourceFinder {
|
||||
return &fakeResourceFinder{
|
||||
func NewSimpleFakeResourceFinder(infos ...*resource.Info) *FakeResourceFinder {
|
||||
return &FakeResourceFinder{
|
||||
Infos: infos,
|
||||
}
|
||||
}
|
||||
|
||||
type fakeResourceFinder struct {
|
||||
func (f *FakeResourceFinder) WithError(err error) *FakeResourceFinder {
|
||||
f.err = err
|
||||
return f
|
||||
}
|
||||
|
||||
type FakeResourceFinder struct {
|
||||
Infos []*resource.Info
|
||||
err error
|
||||
}
|
||||
|
||||
// Do implements the interface
|
||||
func (f *fakeResourceFinder) Do() resource.Visitor {
|
||||
func (f *FakeResourceFinder) Do() resource.Visitor {
|
||||
return &fakeResourceResult{
|
||||
Infos: f.Infos,
|
||||
err: f.err,
|
||||
}
|
||||
}
|
||||
|
||||
type fakeResourceResult struct {
|
||||
Infos []*resource.Info
|
||||
err error
|
||||
}
|
||||
|
||||
// Visit just iterates over info
|
||||
func (r *fakeResourceResult) Visit(fn resource.VisitorFunc) error {
|
||||
if r.err != nil {
|
||||
return r.err
|
||||
}
|
||||
for _, info := range r.Infos {
|
||||
err := fn(info, nil)
|
||||
if err != nil {
|
||||
|
||||
2
vendor/k8s.io/cli-runtime/pkg/genericclioptions/record_flags.go
generated
vendored
2
vendor/k8s.io/cli-runtime/pkg/genericclioptions/record_flags.go
generated
vendored
@@ -21,9 +21,9 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
jsonpatch "github.com/evanphx/json-patch"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
jsonpatch "gopkg.in/evanphx/json-patch.v4"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
2
vendor/k8s.io/cli-runtime/pkg/resource/mapper.go
generated
vendored
2
vendor/k8s.io/cli-runtime/pkg/resource/mapper.go
generated
vendored
@@ -66,7 +66,7 @@ func (m *mapper) infoForData(data []byte, source string) (*Info, error) {
|
||||
mapping, err := restMapper.RESTMapping(gvk.GroupKind(), gvk.Version)
|
||||
if err != nil {
|
||||
if _, ok := err.(*meta.NoKindMatchError); ok {
|
||||
return nil, fmt.Errorf("resource mapping not found for name: %q namespace: %q from %q: %v\nensure CRDs are installed first",
|
||||
return nil, fmt.Errorf("resource mapping not found for name: %q namespace: %q from %q: %w\nensure CRDs are installed first",
|
||||
name, namespace, source, err)
|
||||
}
|
||||
return nil, fmt.Errorf("unable to recognize %q: %v", source, err)
|
||||
|
||||
Reference in New Issue
Block a user