mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Code Refactoring of Pod under pkg/api (#112085)
* Code Refactoring - added some function comments - spelling errors Signed-off-by: Dipankar Das <dipankardas0115@gmail.com> * Some typo fix in resource under pkg/api/v1 Signed-off-by: Dipankar Das <dipankardas0115@gmail.com> * Grammer corrections in api/v1/pod Signed-off-by: Dipankar Das <dipankardas0115@gmail.com> * Function description changes in pkg/api/v1 - pod - resource Signed-off-by: Dipankar Das <dipankardas0115@gmail.com> Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>
This commit is contained in:
		@@ -61,7 +61,7 @@ const (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// AllContainers specifies that all containers be visited
 | 
			
		||||
const AllContainers ContainerType = (InitContainers | Containers | EphemeralContainers)
 | 
			
		||||
const AllContainers ContainerType = InitContainers | Containers | EphemeralContainers
 | 
			
		||||
 | 
			
		||||
// AllFeatureEnabledContainers returns a ContainerType mask which includes all container
 | 
			
		||||
// types except for the ones guarded by feature gate.
 | 
			
		||||
@@ -188,6 +188,7 @@ func VisitPodSecretNames(pod *v1.Pod, visitor Visitor) bool {
 | 
			
		||||
	return true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// visitContainerSecretNames returns true unless the visitor returned false when invoked with a secret reference
 | 
			
		||||
func visitContainerSecretNames(container *v1.Container, visitor Visitor) bool {
 | 
			
		||||
	for _, env := range container.EnvFrom {
 | 
			
		||||
		if env.SecretRef != nil {
 | 
			
		||||
@@ -236,6 +237,7 @@ func VisitPodConfigmapNames(pod *v1.Pod, visitor Visitor) bool {
 | 
			
		||||
	return true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// visitContainerConfigmapNames returns true unless the visitor returned false when invoked with a configmap reference
 | 
			
		||||
func visitContainerConfigmapNames(container *v1.Container, visitor Visitor) bool {
 | 
			
		||||
	for _, env := range container.EnvFrom {
 | 
			
		||||
		if env.ConfigMapRef != nil {
 | 
			
		||||
@@ -300,7 +302,7 @@ func IsPodTerminal(pod *v1.Pod) bool {
 | 
			
		||||
	return IsPodPhaseTerminal(pod.Status.Phase)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsPhaseTerminal returns true if the pod's phase is terminal.
 | 
			
		||||
// IsPodPhaseTerminal returns true if the pod's phase is terminal.
 | 
			
		||||
func IsPodPhaseTerminal(phase v1.PodPhase) bool {
 | 
			
		||||
	return phase == v1.PodFailed || phase == v1.PodSucceeded
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user