Skip to content

Commit

Permalink
Rename Runner.Spec.dockerWithinRunnerContainer to docker"d"WithinRunn…
Browse files Browse the repository at this point in the history
…erContainer (#134)

* Rename Runner.Spec.dockerWithinRunnerContainer to dockerdWithinRunnerContainer

Ref #126 (comment)
  • Loading branch information
Yusuke Kuoka authored Oct 21, 2020
1 parent d16dfac commit faaca10
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ spec:
template:
spec:
image: summerwind/actions-runner-dind
dockerWithinRunnerContainer: true
dockerdWithinRunnerContainer: true
repository: mumoshu/actions-runner-controller-ci
env: []
```
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/runner_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 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 @@ -399,8 +399,6 @@ spec:
- name
type: object
type: array
dockerWithinRunnerContainer:
type: boolean
dockerdContainerResources:
description: ResourceRequirements describes the compute resource requirements.
properties:
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,6 @@ spec:
- name
type: object
type: array
dockerWithinRunnerContainer:
type: boolean
dockerdContainerResources:
description: ResourceRequirements describes the compute resource requirements.
properties:
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/actions.summerwind.dev_runners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,6 @@ spec:
- name
type: object
type: array
dockerWithinRunnerContainer:
type: boolean
dockerdContainerResources:
description: ResourceRequirements describes the compute resource requirements.
properties:
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions controllers/runner_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit faaca10

Please sign in to comment.