Skip to content

Commit

Permalink
Added support to enable and disable enableServiceLinks. (actions#628)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sxd authored Jun 22, 2021
1 parent 1084a37 commit a277489
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/runner_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ spec:
type: object
dockerdWithinRunnerContainer:
type: boolean
enableServiceLinks:
type: boolean
enterprise:
pattern: ^[^/]+$
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,8 @@ spec:
type: object
dockerdWithinRunnerContainer:
type: boolean
enableServiceLinks:
type: boolean
enterprise:
pattern: ^[^/]+$
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ spec:
type: object
dockerdWithinRunnerContainer:
type: boolean
enableServiceLinks:
type: boolean
enterprise:
pattern: ^[^/]+$
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ spec:
type: object
dockerdWithinRunnerContainer:
type: boolean
enableServiceLinks:
type: boolean
enterprise:
pattern: ^[^/]+$
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,8 @@ spec:
type: object
dockerdWithinRunnerContainer:
type: boolean
enableServiceLinks:
type: boolean
enterprise:
pattern: ^[^/]+$
type: string
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/actions.summerwind.dev_runners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ spec:
type: object
dockerdWithinRunnerContainer:
type: boolean
enableServiceLinks:
type: boolean
enterprise:
pattern: ^[^/]+$
type: string
Expand Down
1 change: 1 addition & 0 deletions controllers/runner_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a277489

Please sign in to comment.