Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for IsValidPortName (0.19 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go

    	}
    	return []string{InclusiveRangeError(minUserID, maxUserID)}
    }
    
    var portNameCharsetRegex = regexp.MustCompile("^[-a-z0-9]+$")
    var portNameOneLetterRegexp = regexp.MustCompile("[a-z]")
    
    // IsValidPortName check that the argument is valid syntax. It must be
    // non-empty and no more than 15 characters long. It may contain only [-a-z0-9]
    // and must contain at least one letter [a-z]. It must not start or end with a
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 16:08:43 UTC 2024
    - 19K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/util/validation/validation_test.go

    	for _, val := range goodValues {
    		if msgs := IsValidPortName(val); len(msgs) != 0 {
    			t.Errorf("expected true for %q: %v", val, msgs)
    		}
    	}
    
    	badValues := []string{"longerthan15characters", "", strings.Repeat("a", 16), "12345", "1-2-3-4", "-begin", "end-", "two--hyphens", "whois++"}
    	for _, val := range badValues {
    		if msgs := IsValidPortName(val); len(msgs) == 0 {
    			t.Errorf("expected false for %q", val)
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 05 04:51:54 UTC 2024
    - 22.3K bytes
    - Viewed (0)
  3. pkg/apis/networking/validation/validation.go

    			}
    		} else {
    			if port.EndPort != nil {
    				allErrs = append(allErrs, field.Invalid(portPath.Child("endPort"), *port.EndPort, "may not be specified when `port` is non-numeric"))
    			}
    			for _, msg := range validation.IsValidPortName(port.Port.StrVal) {
    				allErrs = append(allErrs, field.Invalid(portPath.Child("port"), port.Port.StrVal, msg))
    			}
    		}
    	} else {
    		if port.EndPort != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Feb 07 14:48:01 UTC 2024
    - 31.5K bytes
    - Viewed (0)
  4. pkg/apis/core/validation/validation.go

    	allErrs := field.ErrorList{}
    
    	allNames := sets.Set[string]{}
    	for i, port := range ports {
    		idxPath := fldPath.Index(i)
    		if len(port.Name) > 0 {
    			if msgs := validation.IsValidPortName(port.Name); len(msgs) != 0 {
    				for i = range msgs {
    					allErrs = append(allErrs, field.Invalid(idxPath.Child("name"), port.Name, msgs[i]))
    				}
    			} else if allNames.Has(port.Name) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 349.5K bytes
    - Viewed (0)
Back to top