convertToCapabilities converts a slice of strings to a slice of v1.Capability
(config Config)
| 8 | |
| 9 | // convertToCapabilities converts a slice of strings to a slice of v1.Capability |
| 10 | func ephemeralContainerForPodDebug(config Config) v1.EphemeralContainer { |
| 11 | return v1.EphemeralContainer{ |
| 12 | EphemeralContainerCommon: v1.EphemeralContainerCommon{ |
| 13 | Name: randomRetinaShellContainerName(), |
| 14 | Image: config.RetinaShellImage, |
| 15 | Stdin: true, |
| 16 | TTY: true, |
| 17 | SecurityContext: &v1.SecurityContext{ |
| 18 | Capabilities: &v1.Capabilities{ |
| 19 | Drop: []v1.Capability{"ALL"}, |
| 20 | Add: stringSliceToCapabilities(config.Capabilities), |
| 21 | }, |
| 22 | }, |
| 23 | }, |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func hostNetworkPodForNodeDebug(config Config, debugPodNamespace, nodeName string) *v1.Pod { |
| 28 | pod := &v1.Pod{ |