mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Add Ephemeral Containers to the Kubernetes core API
This commit is contained in:
		@@ -45,6 +45,13 @@ func VisitContainers(podSpec *api.PodSpec, visitor ContainerVisitor) bool {
 | 
			
		||||
			return false
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if utilfeature.DefaultFeatureGate.Enabled(features.EphemeralContainers) {
 | 
			
		||||
		for i := range podSpec.EphemeralContainers {
 | 
			
		||||
			if !visitor((*api.Container)(&podSpec.EphemeralContainers[i].EphemeralContainerCommon)) {
 | 
			
		||||
				return false
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -362,6 +369,9 @@ func dropDisabledFields(
 | 
			
		||||
			return true
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
	if !utilfeature.DefaultFeatureGate.Enabled(features.EphemeralContainers) {
 | 
			
		||||
		podSpec.EphemeralContainers = nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!utilfeature.DefaultFeatureGate.Enabled(features.VolumeSubpath) || !utilfeature.DefaultFeatureGate.Enabled(features.VolumeSubpathEnvExpansion)) && !subpathExprInUse(oldPodSpec) {
 | 
			
		||||
		// drop subpath env expansion from the pod if either of the subpath features is disabled and the old spec did not specify subpath env expansion
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user