applyHostNetworkConfig sets hostNetwork and the corresponding DNSPolicy on a pod spec if the provided hostNetwork bool pointer is non-nil and true.
(podSpec *corev1.PodSpec, hostNetwork *bool)
| 56 | // applyHostNetworkConfig sets hostNetwork and the corresponding DNSPolicy on a pod spec |
| 57 | // if the provided hostNetwork bool pointer is non-nil and true. |
| 58 | func applyHostNetworkConfig(podSpec *corev1.PodSpec, hostNetwork *bool) { |
| 59 | if hostNetwork != nil && *hostNetwork { |
| 60 | podSpec.HostNetwork = true |
| 61 | podSpec.DNSPolicy = corev1.DNSClusterFirstWithHostNet |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | const ( |
| 66 | // DefaultContainerdConfigFile indicates default config file path for containerd |
no outgoing calls