diff --git a/README.md b/README.md index 238f348f1e..b4587cf572 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ spec: template: spec: image: summerwind/actions-runner-dind - dockerWithinRunnerContainer: true + dockerdWithinRunnerContainer: true repository: mumoshu/actions-runner-controller-ci env: [] ``` @@ -306,8 +306,8 @@ spec: memory: "4Gi" # If set to true, runner pod container only 1 container that's expected to be able to run docker, too. # image summerwind/actions-runner-dind or custom one should be used with true -value - dockerWithinRunnerContainer: false - # Valid if dockerWithinRunnerContainer is not true + dockerdWithinRunnerContainer: false + # Valid if dockerdWithinRunnerContainer is not true dockerdContainerResources: limits: cpu: "4.0" diff --git a/api/v1alpha1/runner_types.go b/api/v1alpha1/runner_types.go index 4eedc989bb..cf70280cef 100644 --- a/api/v1alpha1/runner_types.go +++ b/api/v1alpha1/runner_types.go @@ -80,7 +80,7 @@ type RunnerSpec struct { // +optional TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` // +optional - DockerWithinRunnerContainer *bool `json:"dockerWithinRunnerContainer,omitempty"` + DockerdWithinRunnerContainer *bool `json:"dockerdWithinRunnerContainer,omitempty"` } // ValidateRepository validates repository field. diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index aa23efd773..b0d758ed60 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -525,8 +525,8 @@ func (in *RunnerSpec) DeepCopyInto(out *RunnerSpec) { *out = new(int64) **out = **in } - if in.DockerWithinRunnerContainer != nil { - in, out := &in.DockerWithinRunnerContainer, &out.DockerWithinRunnerContainer + if in.DockerdWithinRunnerContainer != nil { + in, out := &in.DockerdWithinRunnerContainer, &out.DockerdWithinRunnerContainer *out = new(bool) **out = **in } diff --git a/config/crd/bases/actions.summerwind.dev_runnerdeployments.yaml b/config/crd/bases/actions.summerwind.dev_runnerdeployments.yaml index f126d3c261..e0f54864db 100644 --- a/config/crd/bases/actions.summerwind.dev_runnerdeployments.yaml +++ b/config/crd/bases/actions.summerwind.dev_runnerdeployments.yaml @@ -399,8 +399,6 @@ spec: - name type: object type: array - dockerWithinRunnerContainer: - type: boolean dockerdContainerResources: description: ResourceRequirements describes the compute resource requirements. properties: @@ -423,6 +421,8 @@ spec: description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object + dockerdWithinRunnerContainer: + type: boolean env: items: description: EnvVar represents an environment variable present in a Container. diff --git a/config/crd/bases/actions.summerwind.dev_runnerreplicasets.yaml b/config/crd/bases/actions.summerwind.dev_runnerreplicasets.yaml index 5344b1ed85..e0c6a2cc5b 100644 --- a/config/crd/bases/actions.summerwind.dev_runnerreplicasets.yaml +++ b/config/crd/bases/actions.summerwind.dev_runnerreplicasets.yaml @@ -399,8 +399,6 @@ spec: - name type: object type: array - dockerWithinRunnerContainer: - type: boolean dockerdContainerResources: description: ResourceRequirements describes the compute resource requirements. properties: @@ -423,6 +421,8 @@ spec: description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object + dockerdWithinRunnerContainer: + type: boolean env: items: description: EnvVar represents an environment variable present in a Container. diff --git a/config/crd/bases/actions.summerwind.dev_runners.yaml b/config/crd/bases/actions.summerwind.dev_runners.yaml index d10c1362a6..8e493f3cd9 100644 --- a/config/crd/bases/actions.summerwind.dev_runners.yaml +++ b/config/crd/bases/actions.summerwind.dev_runners.yaml @@ -393,8 +393,6 @@ spec: - name type: object type: array - dockerWithinRunnerContainer: - type: boolean dockerdContainerResources: description: ResourceRequirements describes the compute resource requirements. properties: @@ -417,6 +415,8 @@ spec: description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object + dockerdWithinRunnerContainer: + type: boolean env: items: description: EnvVar represents an environment variable present in a Container. diff --git a/controllers/runner_controller.go b/controllers/runner_controller.go index 4c10b0501a..bb4cc3dc77 100644 --- a/controllers/runner_controller.go +++ b/controllers/runner_controller.go @@ -279,7 +279,7 @@ func (r *RunnerReconciler) unregisterRunner(ctx context.Context, org, repo, name func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) { var ( privileged bool = true - dockerdInRunner bool = runner.Spec.DockerWithinRunnerContainer != nil && *runner.Spec.DockerWithinRunnerContainer + dockerdInRunner bool = runner.Spec.DockerdWithinRunnerContainer != nil && *runner.Spec.DockerdWithinRunnerContainer ) runnerImage := runner.Spec.Image @@ -338,7 +338,7 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) { EnvFrom: runner.Spec.EnvFrom, SecurityContext: &corev1.SecurityContext{ // Runner need to run privileged if it contains DinD - Privileged: runner.Spec.DockerWithinRunnerContainer, + Privileged: runner.Spec.DockerdWithinRunnerContainer, }, Resources: runner.Spec.Resources, },