Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for NoKindMatchError (0.23 sec)

  1. staging/src/k8s.io/apimachinery/pkg/api/meta/multirestmapper_test.go

    			err:       &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}},
    		},
    		{
    			name:      "ignore not found with version not exist",
    			mapper:    MultiRESTMapper{fixedRESTMapper{err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}, SearchedVersions: []string{"v1"}}}},
    			groupKind: schema.GroupKind{Kind: "Foo"},
    			versions:  []string{"v1beta"},
    			result:    nil,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 05 01:49:02 UTC 2018
    - 13.6K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/api/meta/errors.go

    	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
    	GroupKind schema.GroupKind
    	// SearchedVersions is the optional list of versions the search was restricted to
    	SearchedVersions []string
    }
    
    func (e *NoKindMatchError) Error() string {
    	searchedVersions := sets.NewString()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 11 22:50:51 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/api/meta/errors_test.go

    			new:         func() error { return &NoResourceMatchError{} },
    			matcherFunc: IsNoMatchError,
    		},
    		{
    			name:        "NoKindMatchError",
    			input:       &NoKindMatchError{SearchedVersions: []string{"foo"}},
    			new:         func() error { return &NoKindMatchError{} },
    			matcherFunc: IsNoMatchError,
    		},
    	}
    
    	for _, tc := range testCases {
    		t.Run(tc.name, func(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 11 22:50:51 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/api/meta/multirestmapper.go

    		}
    		return nil, &AmbiguousKindError{PartialKind: gk.WithVersion(""), MatchingKinds: kinds}
    	}
    	if len(errors) > 0 {
    		return nil, utilerrors.NewAggregate(errors)
    	}
    	return nil, &NoKindMatchError{GroupKind: gk, SearchedVersions: versions}
    }
    
    // RESTMappings returns all possible RESTMappings for the provided group kind, or an error
    // if the type is not recognized.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 05 23:44:02 UTC 2021
    - 5.8K bytes
    - Viewed (0)
  5. pkg/registry/admissionregistration/resolver/resolver.go

    		}
    		if resource.Version != "" && resource.Version != gvk.Version {
    			// version didn't match
    			continue
    		}
    		return gv.WithResource(resource.Name), nil
    	}
    	return schema.GroupVersionResource{}, &meta.NoKindMatchError{GroupKind: gvk.GroupKind(), SearchedVersions: []string{gvk.Version}}
    }
    
    func NewDiscoveryResourceResolver(client discovery.DiscoveryInterface) (ResourceResolver, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Nov 07 21:29:56 UTC 2022
    - 2.2K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/api/meta/priority_test.go

    			input:  schema.GroupKind{Kind: "Foo"},
    			err:    &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}},
    		},
    		{
    			name:   "ignore not found",
    			mapper: PriorityRESTMapper{Delegate: MultiRESTMapper{fixedRESTMapper{err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "IGNORE_THIS"}}}}},
    			input:  schema.GroupKind{Kind: "Foo"},
    			err:    &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}},
    		},
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 06 15:24:58 UTC 2018
    - 13.6K bytes
    - Viewed (0)
  7. staging/src/k8s.io/cli-runtime/pkg/resource/mapper.go

    		restMapper, err := m.restMapperFn()
    		if err != nil {
    			return nil, err
    		}
    		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: %w\nensure CRDs are installed first",
    					name, namespace, source, err)
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 03 10:53:18 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/api/meta/restmapper.go

    	mappings, err := m.RESTMappings(gk, versions...)
    	if err != nil {
    		return nil, err
    	}
    	if len(mappings) == 0 {
    		return nil, &NoKindMatchError{GroupKind: gk, SearchedVersions: versions}
    	}
    	// since we rely on RESTMappings method
    	// take the first match and return to the caller
    	// as this was the existing behavior.
    	return mappings[0], nil
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 17 01:55:47 UTC 2021
    - 16.1K bytes
    - Viewed (0)
  9. staging/src/k8s.io/cli-runtime/pkg/resource/builder.go

    		// for the given argument. To maintain consistency with previous behavior,
    		// announce that a resource type could not be found.
    		// if the error is _not_ a *meta.NoKindMatchError, then we had trouble doing discovery,
    		// so we should return the original error since it may help a user diagnose what is actually wrong
    		if meta.IsNoMatchError(err) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 10:17:56 UTC 2023
    - 37.2K bytes
    - Viewed (0)
  10. staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go

    	}
    
    	test := &testVisitor{}
    	singleItemImplied := false
    
    	b.ResourceTypeOrNameArgs(true, "foo", "bar")
    
    	// ensure that requesting a resource we _know_ not to exist results in an expected *meta.NoKindMatchError
    	err := b.Do().IntoSingleItemImplied(&singleItemImplied).Visit(test.Handle)
    	if err != nil {
    		if !strings.Contains(err.Error(), "server doesn't have a resource type \"foo\"") {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 11:58:41 UTC 2023
    - 56.1K bytes
    - Viewed (0)
Back to top