mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 11:41:27 +00:00
Added support to enable and disable enableServiceLinks. (#628)
This option expose internally some `KUBERNETES_*` environment variables that doesn't allow the runner to use KinD (Kubernetes in Docker) since it will try to connect to the Kubernetes cluster where the runner it's running. This option it's set by default to `true` in any Kubernetes deployment. Signed-off-by: Jonathan Gonzalez V <jonathan.gonzalez@enterprisedb.com>
This commit is contained in:
committed by
GitHub
parent
1084a37174
commit
a277489003
@@ -100,6 +100,9 @@ type RunnerPodSpec struct {
|
||||
// +optional
|
||||
Volumes []corev1.Volume `json:"volumes,omitempty"`
|
||||
|
||||
// +optional
|
||||
EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"`
|
||||
|
||||
// +optional
|
||||
InitContainers []corev1.Container `json:"initContainers,omitempty"`
|
||||
|
||||
|
||||
@@ -624,6 +624,11 @@ func (in *RunnerPodSpec) DeepCopyInto(out *RunnerPodSpec) {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.EnableServiceLinks != nil {
|
||||
in, out := &in.EnableServiceLinks, &out.EnableServiceLinks
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.InitContainers != nil {
|
||||
in, out := &in.InitContainers, &out.InitContainers
|
||||
*out = make([]v1.Container, len(*in))
|
||||
|
||||
@@ -632,6 +632,8 @@ spec:
|
||||
type: object
|
||||
dockerdWithinRunnerContainer:
|
||||
type: boolean
|
||||
enableServiceLinks:
|
||||
type: boolean
|
||||
enterprise:
|
||||
pattern: ^[^/]+$
|
||||
type: string
|
||||
|
||||
@@ -629,6 +629,8 @@ spec:
|
||||
type: object
|
||||
dockerdWithinRunnerContainer:
|
||||
type: boolean
|
||||
enableServiceLinks:
|
||||
type: boolean
|
||||
enterprise:
|
||||
pattern: ^[^/]+$
|
||||
type: string
|
||||
|
||||
@@ -577,6 +577,8 @@ spec:
|
||||
type: object
|
||||
dockerdWithinRunnerContainer:
|
||||
type: boolean
|
||||
enableServiceLinks:
|
||||
type: boolean
|
||||
enterprise:
|
||||
pattern: ^[^/]+$
|
||||
type: string
|
||||
|
||||
@@ -632,6 +632,8 @@ spec:
|
||||
type: object
|
||||
dockerdWithinRunnerContainer:
|
||||
type: boolean
|
||||
enableServiceLinks:
|
||||
type: boolean
|
||||
enterprise:
|
||||
pattern: ^[^/]+$
|
||||
type: string
|
||||
|
||||
@@ -629,6 +629,8 @@ spec:
|
||||
type: object
|
||||
dockerdWithinRunnerContainer:
|
||||
type: boolean
|
||||
enableServiceLinks:
|
||||
type: boolean
|
||||
enterprise:
|
||||
pattern: ^[^/]+$
|
||||
type: string
|
||||
|
||||
@@ -577,6 +577,8 @@ spec:
|
||||
type: object
|
||||
dockerdWithinRunnerContainer:
|
||||
type: boolean
|
||||
enableServiceLinks:
|
||||
type: boolean
|
||||
enterprise:
|
||||
pattern: ^[^/]+$
|
||||
type: string
|
||||
|
||||
@@ -622,6 +622,7 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
|
||||
}
|
||||
|
||||
template.Spec.SecurityContext = runner.Spec.SecurityContext
|
||||
template.Spec.EnableServiceLinks = runner.Spec.EnableServiceLinks
|
||||
|
||||
registrationOnly := metav1.HasAnnotation(runner.ObjectMeta, annotationKeyRegistrationOnly)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user