Allow `RunnerDeployment`s to configure `dnsPolicy` for runners (#1892)

* Add DnsPolicy field to RunnerPodSpec struct

* Ensure the runnerSpec's DNSPolicy is mirrored to the pod.Spec

* Run `make manifests`
This commit is contained in:
Nicholas Farley 2022-10-04 19:16:11 -04:00 committed by GitHub
parent 6eadb03669
commit a389292478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 0 deletions

View File

@ -170,6 +170,9 @@ type RunnerPodSpec struct {
// +optional
RuntimeClassName *string `json:"runtimeClassName,omitempty"`
// +optional
DnsPolicy corev1.DNSPolicy `json:"dnsPolicy,omitempty"`
// +optional
DnsConfig *corev1.PodDNSConfig `json:"dnsConfig,omitempty"`

View File

@ -1381,6 +1381,9 @@ spec:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
dockerEnabled:
type: boolean
dockerEnv:

View File

@ -1378,6 +1378,9 @@ spec:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
dockerEnabled:
type: boolean
dockerEnv:

View File

@ -1325,6 +1325,9 @@ spec:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
dockerEnabled:
type: boolean
dockerEnv:

View File

@ -1381,6 +1381,9 @@ spec:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
dockerEnabled:
type: boolean
dockerEnv:

View File

@ -1378,6 +1378,9 @@ spec:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
dockerEnabled:
type: boolean
dockerEnv:

View File

@ -1325,6 +1325,9 @@ spec:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
dockerEnabled:
type: boolean
dockerEnv:

View File

@ -650,6 +650,10 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
pod.Spec.HostAliases = runnerSpec.HostAliases
}
if runnerSpec.DnsPolicy != "" {
pod.Spec.DNSPolicy = runnerSpec.DnsPolicy
}
if runnerSpec.DnsConfig != nil {
pod.Spec.DNSConfig = runnerSpec.DnsConfig
}