Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for IsConfigMapKey (0.21 sec)

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

    var configMapKeyRegexp = regexp.MustCompile("^" + configMapKeyFmt + "$")
    
    // IsConfigMapKey tests for a string that is a valid key for a ConfigMap or Secret
    func IsConfigMapKey(value string) []string {
    	var errs []string
    	if len(value) > DNS1123SubdomainMaxLength {
    		errs = append(errs, MaxLenError(DNS1123SubdomainMaxLength))
    	}
    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

    		"so_is_this_17",
    	}
    
    	for i := range successCases {
    		if errs := IsConfigMapKey(successCases[i]); len(errs) != 0 {
    			t.Errorf("[%d] expected success: %v", i, errs)
    		}
    	}
    
    	failureCases := []string{
    		".",
    		"..",
    		"..bad",
    		"b*d",
    		"bad!&bad",
    	}
    
    	for i := range failureCases {
    		if errs := IsConfigMapKey(failureCases[i]); len(errs) == 0 {
    			t.Errorf("[%d] expected failure", i)
    		}
    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/core/validation/validation.go

    	}
    	if len(s.Key) == 0 {
    		allErrs = append(allErrs, field.Required(fldPath.Child("key"), ""))
    	} else {
    		for _, msg := range validation.IsConfigMapKey(s.Key) {
    			allErrs = append(allErrs, field.Invalid(fldPath.Child("key"), s.Key, msg))
    		}
    	}
    
    	return allErrs
    }
    
    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