Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for VisitContainers (0.28 sec)

  1. pkg/api/v1/pod/util.go

    		}
    		// delegate to visitor
    		return visitor(name)
    	}
    }
    
    // VisitContainers invokes the visitor function with a pointer to every container
    // spec in the given pod spec with type set in mask. If visitor returns false,
    // visiting is short-circuited. VisitContainers returns true if visiting completes,
    // false if visiting was short-circuited.
    func VisitContainers(podSpec *v1.PodSpec, mask ContainerType, visitor ContainerVisitor) bool {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Feb 24 17:18:04 UTC 2023
    - 13.2K bytes
    - Viewed (0)
  2. pkg/api/pod/util.go

    // VisitContainers invokes the visitor function with a pointer to every container
    // spec in the given pod spec with type set in mask. If visitor returns false,
    // visiting is short-circuited. VisitContainers returns true if visiting completes,
    // false if visiting was short-circuited.
    func VisitContainers(podSpec *api.PodSpec, mask ContainerType, visitor ContainerVisitor) bool {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 41.3K bytes
    - Viewed (0)
  3. pkg/kubelet/container/helpers.go

    	return ContainerStateUnknown
    }
    
    // GetContainerSpec gets the container spec by containerName.
    func GetContainerSpec(pod *v1.Pod, containerName string) *v1.Container {
    	var containerSpec *v1.Container
    	podutil.VisitContainers(&pod.Spec, podutil.AllFeatureEnabledContainers(), func(c *v1.Container, containerType podutil.ContainerType) bool {
    		if containerName == c.Name {
    			containerSpec = c
    			return false
    		}
    		return true
    	})
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:25:43 UTC 2024
    - 14.3K bytes
    - Viewed (0)
  4. pkg/security/apparmor/validate.go

    }
    
    func (v *validator) Validate(pod *v1.Pod) error {
    	if !isRequired(pod) {
    		return nil
    	}
    
    	if v.ValidateHost() != nil {
    		return v.validateHostErr
    	}
    
    	var retErr error
    	podutil.VisitContainers(&pod.Spec, podutil.AllContainers, func(container *v1.Container, containerType podutil.ContainerType) bool {
    		profile := GetProfile(pod, container)
    		if profile == nil {
    			return true
    		}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 05 20:22:50 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  5. pkg/api/v1/pod/util_test.go

    			}
    
    			gotContainers := []string{}
    			VisitContainers(tc.spec, tc.mask, func(c *v1.Container, containerType ContainerType) bool {
    				gotContainers = append(gotContainers, c.Name)
    				if c.SecurityContext != nil {
    					c.SecurityContext = nil
    				}
    				return true
    			})
    			if !cmp.Equal(gotContainers, tc.wantContainers) {
    				t.Errorf("VisitContainers() = %+v, want %+v", gotContainers, tc.wantContainers)
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Sep 25 11:04:08 UTC 2023
    - 32.1K bytes
    - Viewed (0)
  6. pkg/security/apparmor/helpers.go

    	if pod.Spec.SecurityContext != nil && pod.Spec.SecurityContext.AppArmorProfile != nil &&
    		pod.Spec.SecurityContext.AppArmorProfile.Type != v1.AppArmorProfileTypeUnconfined {
    		return true
    	}
    
    	inUse := !podutil.VisitContainers(&pod.Spec, podutil.AllContainers, func(c *v1.Container, _ podutil.ContainerType) bool {
    		if c.SecurityContext != nil && c.SecurityContext.AppArmorProfile != nil &&
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 18:46:32 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  7. pkg/volume/util/nested_volumes.go

    				prevNestedMPs = append(prevNestedMPs, mp+string(os.PathSeparator))
    				retval = append(retval, mp[len(myMPSlash):])
    			}
    		}
    		return nil
    	}
    
    	var retErr error
    	podutil.VisitContainers(&pod.Spec, podutil.AllFeatureEnabledContainers(), func(c *v1.Container, containerType podutil.ContainerType) bool {
    		retErr = checkContainer(c)
    		return retErr == nil
    	})
    	if retErr != nil {
    		return nil, retErr
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 18 12:19:17 UTC 2022
    - 4.1K bytes
    - Viewed (0)
  8. pkg/registry/core/pod/strategy.go

    		return loc, nodeInfo.InsecureSkipTLSVerifyTransport, nil
    	}
    	return loc, nodeInfo.Transport, nil
    }
    
    func podHasContainerWithName(pod *api.Pod, containerName string) bool {
    	var hasContainer bool
    	podutil.VisitContainers(&pod.Spec, podutil.AllFeatureEnabledContainers(), func(c *api.Container, containerType podutil.ContainerType) bool {
    		if c.Name == containerName {
    			hasContainer = true
    			return false
    		}
    		return true
    	})
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 17:51:48 UTC 2024
    - 29.8K bytes
    - Viewed (0)
  9. pkg/api/pod/util_test.go

    			}
    
    			gotContainers := []string{}
    			VisitContainers(tc.spec, tc.mask, func(c *api.Container, containerType ContainerType) bool {
    				gotContainers = append(gotContainers, c.Name)
    				if c.SecurityContext != nil {
    					c.SecurityContext = nil
    				}
    				return true
    			})
    			if !cmp.Equal(gotContainers, tc.wantContainers) {
    				t.Errorf("VisitContainers() = %+v, want %+v", gotContainers, tc.wantContainers)
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 108.8K bytes
    - Viewed (0)
  10. pkg/volume/util/util.go

    	mounts = sets.New[string]()
    	devices = sets.New[string]()
    	seLinuxContainerContexts = make(map[string][]*v1.SELinuxOptions)
    
    	podutil.VisitContainers(&pod.Spec, podutil.AllFeatureEnabledContainers(), func(container *v1.Container, containerType podutil.ContainerType) bool {
    		var seLinuxOptions *v1.SELinuxOptions
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 31 12:32:15 UTC 2024
    - 28.8K bytes
    - Viewed (0)
Back to top