Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for validateSysctl (0.17 sec)

  1. pkg/kubelet/sysctl/allowlist.go

    		}
    		if prefixed {
    			w.prefixes[sysctlOrPrefix] = ns
    		} else {
    			w.sysctls[sysctlOrPrefix] = ns
    		}
    	}
    	return w, nil
    }
    
    // validateSysctl checks that a sysctl is allowlisted because it is known
    // to be namespaced by the Linux kernel. Note that being allowlisted is required, but not
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 27 22:58:54 UTC 2023
    - 4K bytes
    - Viewed (0)
  2. pkg/kubelet/sysctl/allowlist_test.go

    	w, err := NewAllowlist(append(SafeSysctlAllowlist(), "kernel.msg*", "kernel.sem", "net.b.*"))
    	if err != nil {
    		t.Fatalf("failed to create allowlist: %v", err)
    	}
    
    	for _, test := range valid {
    		if err := w.validateSysctl(test.sysctl, test.hostNet, test.hostIPC); err != nil {
    			t.Errorf("expected to be allowlisted: %+v, got: %v", test, err)
    		}
    		pod.Spec.SecurityContext.Sysctls = []v1.Sysctl{{Name: test.sysctl, Value: test.sysctl}}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 27 22:58:54 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  3. pkg/apis/core/validation/validation_test.go

    		Sysctls:     sysctls,
    		HostIPC:     false,
    		HostNetwork: true,
    	}
    	errs = validateSysctls(invalidSecurityContextWithHostNet, field.NewPath("foo"), opts)
    	if len(errs) != 2 {
    		t.Errorf("unexpected validation errors: %v", errs)
    	}
    	opts.AllowNamespacedSysctlsForHostNetAndHostIPC = true
    	errs = validateSysctls(invalidSecurityContextWithHostNet, field.NewPath("foo"), opts)
    	if len(errs) != 0 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 857.7K bytes
    - Viewed (0)
  4. pkg/apis/core/validation/validation.go

    func IsValidSysctlName(name string) bool {
    	if len(name) > SysctlMaxLength {
    		return false
    	}
    	return sysctlContainSlashRegexp.MatchString(name)
    }
    
    func validateSysctls(securityContext *core.PodSecurityContext, fldPath *field.Path, opts PodValidationOptions) field.ErrorList {
    	allErrs := field.ErrorList{}
    	names := make(map[string]struct{})
    	for i, s := range securityContext.Sysctls {
    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