Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for KindFor (0.68 sec)

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

    	o.loaded = true
    	return o.err
    }
    
    var _ ResettableRESTMapper = &lazyObject{}
    
    func (o *lazyObject) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) {
    	if err := o.init(); err != nil {
    		return schema.GroupVersionKind{}, err
    	}
    	return o.mapper.KindFor(resource)
    }
    
    func (o *lazyObject) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 05 23:44:02 UTC 2021
    - 3.1K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/api/meta/firsthit_restmapper.go

    		errors = append(errors, err)
    	}
    
    	return schema.GroupVersionResource{}, collapseAggregateErrors(errors)
    }
    
    func (m FirstHitRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) {
    	errors := []error{}
    	for _, t := range m.MultiRESTMapper {
    		ret, err := t.KindFor(resource)
    		if err == nil {
    			return ret, nil
    		}
    		errors = append(errors, err)
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 05 23:44:02 UTC 2021
    - 2.8K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/api/meta/interfaces.go

    // unique across groups.
    //
    // TODO: split into sub-interfaces
    type RESTMapper interface {
    	// KindFor takes a partial resource and returns the single match.  Returns an error if there are multiple matches
    	KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
    
    	// KindsFor takes a partial resource and returns the list of potential kinds in priority order
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 05 23:44:02 UTC 2021
    - 5.5K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/runtime/mapper_test.go

    				mapper.RegisterKindFor(data.gvr, data.subresource, data.gvk)
    			}
    			// verify
    			for _, data := range kindsToRegister {
    				if kind := mapper.KindFor(data.gvr, data.subresource); kind != data.gvk {
    					t.Errorf("KindFor(%#v, %v) returned %#v, expected %#v", data.gvr, data.subresource, kind, data.gvk)
    				}
    			}
    
    			// Verify equivalents to primary resource
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:48:03 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/api/meta/priority.go

    	}
    
    	return schema.GroupVersionResource{}, &AmbiguousResourceError{PartialResource: partiallySpecifiedResource, MatchingResources: originalGVRs}
    }
    
    // KindFor finds all kinds, then passes them through the KindPriority patterns to find a single matching hit.
    func (m PriorityRESTMapper) KindFor(partiallySpecifiedResource schema.GroupVersionResource) (schema.GroupVersionKind, error) {
    	originalGVKs, originalErr := m.Delegate.KindsFor(partiallySpecifiedResource)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 05 23:44:02 UTC 2021
    - 7.6K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/api/meta/multirestmapper.go

    	if len(resources) == 1 {
    		return resources[0], nil
    	}
    
    	return schema.GroupVersionResource{}, &AmbiguousResourceError{PartialResource: resource, MatchingResources: resources}
    }
    
    func (m MultiRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) {
    	kinds, err := m.KindsFor(resource)
    	if err != nil {
    		return schema.GroupVersionKind{}, err
    	}
    	if len(kinds) == 1 {
    		return kinds[0], nil
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 05 23:44:02 UTC 2021
    - 5.8K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/matching/matching.go

    			m := rules.Matcher{
    				Rule: rule,
    				Attr: attrWithOverride,
    			}
    			if !m.Matches() {
    				continue
    			}
    			matchKind = o.GetEquivalentResourceMapper().KindFor(equivalent, attr.GetSubresource())
    			if matchKind.Empty() {
    				return false, schema.GroupVersionResource{}, schema.GroupVersionKind{}, fmt.Errorf("unable to convert to %v: unknown kind", equivalent)
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/admission/initializer/initializer_test.go

    	mapper meta.RESTMapper
    }
    
    func (p *WantsRESTMapperAdmissionPlugin) SetRESTMapper(mapper meta.RESTMapper) {
    	p.mapper = mapper
    }
    
    type doNothingRESTMapper struct{}
    
    func (doNothingRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) {
    	return schema.GroupVersionKind{}, nil
    }
    func (doNothingRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go

    					continue
    				}
    				attrWithOverride.resource = equivalent
    				m := rules.Matcher{Rule: r, Attr: attrWithOverride}
    				if m.Matches() {
    					kind := o.GetEquivalentResourceMapper().KindFor(equivalent, attr.GetSubresource())
    					if kind.Empty() {
    						return nil, apierrors.NewInternalError(fmt.Errorf("unable to convert to %v: unknown kind", equivalent))
    					}
    					invocation = &WebhookInvocation{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  10. pkg/controller/storageversionmigrator/storageversionmigrator.go

    			ctx,
    			setStatusConditions(toBeProcessedSVM, svmv1alpha1.MigrationRunning, migrationRunningStatusReason),
    			metav1.UpdateOptions{},
    		)
    	if err != nil {
    		return err
    	}
    
    	gvk, err := svmc.restMapper.KindFor(gvr)
    	if err != nil {
    		return err
    	}
    	typeMeta := metav1.TypeMeta{}
    	typeMeta.APIVersion, typeMeta.Kind = gvk.ToAPIVersionAndKind()
    	data, err := json.Marshal(typeMeta)
    	if err != nil {
    		return err
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 9.5K bytes
    - Viewed (0)
Back to top