Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for NewErr (0.18 sec)

  1. staging/src/k8s.io/apiserver/pkg/cel/common/values.go

    			return types.NullValue
    		}
    		return types.NewErr("invalid data, got null for schema with nullable=false")
    	}
    	if schema.IsXIntOrString() {
    		switch v := unstructured.(type) {
    		case string:
    			return types.String(v)
    		case int:
    			return types.Int(v)
    		case int32:
    			return types.Int(v)
    		case int64:
    			return types.Int(v)
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 23 22:30:17 UTC 2023
    - 20.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/composition.go

    	if a.result.Error != nil {
    		return types.NewErr("composited variable %q fails to compile: %v", a.name, a.result.Error)
    	}
    
    	v, details, err := a.result.Program.ContextEval(a.context, a.activation)
    	if details == nil {
    		return types.NewErr("unable to get evaluation details of variable %q", a.name)
    	}
    	costPtr := details.ActualCost()
    	if costPtr == nil {
    		return types.NewErr("unable to calculate cost of variable %q", a.name)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Feb 13 21:06:39 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  3. pkg/structured/structured.go

    		return ""
    	}
    	return fmt.Sprintf("\tmoreInfo=%s impact=%s action=%s likelyCause=%s err=%v",
    		e.MoreInfo, e.Impact, e.Action, e.LikelyCause, e.Err)
    }
    
    // NewErr creates a new copy of an Error with the content of serr and err and returns a ptr to it.
    func NewErr(serr *Error, err error) *Error {
    	// Make a copy so that dictionary entry is not modified.
    	ne := *serr
    	ne.Err = err
    	return &ne
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Jul 15 23:58:50 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/cel/library/authz.go

    	}
    
    	if errors := apimachineryvalidation.ValidateServiceAccountName(name, false); len(errors) > 0 {
    		return types.NewErr("Invalid service account name")
    	}
    	if errors := apimachineryvalidation.ValidateNamespaceName(namespace, false); len(errors) > 0 {
    		return types.NewErr("Invalid service account namespace")
    	}
    	return authz.serviceAccount(namespace, name)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Aug 23 21:31:27 UTC 2023
    - 21.1K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/cel/lazy/lazy.go

    func (m *MapValue) ConvertToType(typeVal ref.Type) ref.Val {
    	switch typeVal {
    	case m.typeValue:
    		return m
    	case types.TypeType:
    		return m.typeValue
    	}
    	return types.NewErr("disallowed conversion from %q to %q", m.typeValue.TypeName(), typeVal.TypeName())
    }
    
    // Equal returns true if the other object is the same pointer-wise.
    func (m *MapValue) Equal(other ref.Val) ref.Val {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Aug 23 21:31:27 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/cel/library/ip.go

    	if !ok {
    		return types.MaybeNoSuchOverloadErr(arg)
    	}
    
    	addr, err := parseIPAddr(s)
    	if err != nil {
    		// Don't add context, we control the error message already.
    		return types.NewErr("%v", err)
    	}
    
    	return apiservercel.IP{
    		Addr: addr,
    	}
    }
    
    func ipToString(arg ref.Val) ref.Val {
    	ip, ok := arg.(apiservercel.IP)
    	if !ok {
    		return types.MaybeNoSuchOverloadErr(arg)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Dec 15 11:02:34 UTC 2023
    - 9.8K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/cel/quantity.go

    }
    
    func (d Quantity) ConvertToType(typeVal ref.Type) ref.Val {
    	switch typeVal {
    	case quantityTypeValue:
    		return d
    	case types.TypeType:
    		return quantityTypeValue
    	default:
    		return types.NewErr("type conversion error from '%s' to '%s'", quantityTypeValue, typeVal)
    	}
    }
    
    func (d Quantity) Equal(other ref.Val) ref.Val {
    	otherDur, ok := other.(Quantity)
    	if !ok {
    		return types.MaybeNoSuchOverloadErr(other)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 04 11:23:54 UTC 2024
    - 2K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/cel/library/regex.go

    	}
    	regex, ok := regexVal.Value().(string)
    	if !ok {
    		return types.MaybeNoSuchOverloadErr(regexVal)
    	}
    	re, err := regexp.Compile(regex)
    	if err != nil {
    		return types.NewErr("Illegal regex: %v", err.Error())
    	}
    	result := re.FindString(str)
    	return types.String(result)
    }
    
    func findAll(args ...ref.Val) ref.Val {
    	argn := len(args)
    	if argn < 2 || argn > 3 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Aug 23 21:31:27 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/runtime/converter.go

    	}
    	if c.mismatchDetection {
    		newUnstr := map[string]interface{}{}
    		newErr := toUnstructuredViaJSON(obj, &newUnstr)
    		if (err != nil) != (newErr != nil) {
    			klog.Fatalf("ToUnstructured unexpected error for %v: error: %v; newErr: %v", obj, err, newErr)
    		}
    		if err == nil && !c.comparison.DeepEqual(u, newUnstr) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 11 16:02:13 UTC 2023
    - 24.9K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/cel/ip.go

    func (d IP) ConvertToType(typeVal ref.Type) ref.Val {
    	switch typeVal {
    	case IPType:
    		return d
    	case types.TypeType:
    		return IPType
    	case types.StringType:
    		return types.String(d.Addr.String())
    	}
    	return types.NewErr("type conversion error from '%s' to '%s'", IPType, typeVal)
    }
    
    // Equal implements ref.Val.Equal.
    func (d IP) Equal(other ref.Val) ref.Val {
    	otherD, ok := other.(IP)
    	if !ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Dec 15 11:02:33 UTC 2023
    - 2.1K bytes
    - Viewed (0)
Back to top