Rename Runner.Spec.dockerWithinRunnerContainer to docker"d"WithinRunnerContainer (#134)
* Rename Runner.Spec.dockerWithinRunnerContainer to dockerdWithinRunnerContainer Ref https://github.com/summerwind/actions-runner-controller/pull/126#issuecomment-712501790
This commit is contained in:
parent
d16dfac0f8
commit
faaca10fba
|
|
@ -265,7 +265,7 @@ spec:
|
||||||
template:
|
template:
|
||||||
spec:
|
spec:
|
||||||
image: summerwind/actions-runner-dind
|
image: summerwind/actions-runner-dind
|
||||||
dockerWithinRunnerContainer: true
|
dockerdWithinRunnerContainer: true
|
||||||
repository: mumoshu/actions-runner-controller-ci
|
repository: mumoshu/actions-runner-controller-ci
|
||||||
env: []
|
env: []
|
||||||
```
|
```
|
||||||
|
|
@ -306,8 +306,8 @@ spec:
|
||||||
memory: "4Gi"
|
memory: "4Gi"
|
||||||
# If set to true, runner pod container only 1 container that's expected to be able to run docker, too.
|
# 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
|
# image summerwind/actions-runner-dind or custom one should be used with true -value
|
||||||
dockerWithinRunnerContainer: false
|
dockerdWithinRunnerContainer: false
|
||||||
# Valid if dockerWithinRunnerContainer is not true
|
# Valid if dockerdWithinRunnerContainer is not true
|
||||||
dockerdContainerResources:
|
dockerdContainerResources:
|
||||||
limits:
|
limits:
|
||||||
cpu: "4.0"
|
cpu: "4.0"
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ type RunnerSpec struct {
|
||||||
// +optional
|
// +optional
|
||||||
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
|
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
DockerWithinRunnerContainer *bool `json:"dockerWithinRunnerContainer,omitempty"`
|
DockerdWithinRunnerContainer *bool `json:"dockerdWithinRunnerContainer,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidateRepository validates repository field.
|
// ValidateRepository validates repository field.
|
||||||
|
|
|
||||||
|
|
@ -525,8 +525,8 @@ func (in *RunnerSpec) DeepCopyInto(out *RunnerSpec) {
|
||||||
*out = new(int64)
|
*out = new(int64)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
if in.DockerWithinRunnerContainer != nil {
|
if in.DockerdWithinRunnerContainer != nil {
|
||||||
in, out := &in.DockerWithinRunnerContainer, &out.DockerWithinRunnerContainer
|
in, out := &in.DockerdWithinRunnerContainer, &out.DockerdWithinRunnerContainer
|
||||||
*out = new(bool)
|
*out = new(bool)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -399,8 +399,6 @@ spec:
|
||||||
- name
|
- name
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
dockerWithinRunnerContainer:
|
|
||||||
type: boolean
|
|
||||||
dockerdContainerResources:
|
dockerdContainerResources:
|
||||||
description: ResourceRequirements describes the compute resource requirements.
|
description: ResourceRequirements describes the compute resource requirements.
|
||||||
properties:
|
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/'
|
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
|
||||||
type: object
|
type: object
|
||||||
|
dockerdWithinRunnerContainer:
|
||||||
|
type: boolean
|
||||||
env:
|
env:
|
||||||
items:
|
items:
|
||||||
description: EnvVar represents an environment variable present in a Container.
|
description: EnvVar represents an environment variable present in a Container.
|
||||||
|
|
|
||||||
|
|
@ -399,8 +399,6 @@ spec:
|
||||||
- name
|
- name
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
dockerWithinRunnerContainer:
|
|
||||||
type: boolean
|
|
||||||
dockerdContainerResources:
|
dockerdContainerResources:
|
||||||
description: ResourceRequirements describes the compute resource requirements.
|
description: ResourceRequirements describes the compute resource requirements.
|
||||||
properties:
|
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/'
|
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
|
||||||
type: object
|
type: object
|
||||||
|
dockerdWithinRunnerContainer:
|
||||||
|
type: boolean
|
||||||
env:
|
env:
|
||||||
items:
|
items:
|
||||||
description: EnvVar represents an environment variable present in a Container.
|
description: EnvVar represents an environment variable present in a Container.
|
||||||
|
|
|
||||||
|
|
@ -393,8 +393,6 @@ spec:
|
||||||
- name
|
- name
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
dockerWithinRunnerContainer:
|
|
||||||
type: boolean
|
|
||||||
dockerdContainerResources:
|
dockerdContainerResources:
|
||||||
description: ResourceRequirements describes the compute resource requirements.
|
description: ResourceRequirements describes the compute resource requirements.
|
||||||
properties:
|
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/'
|
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
|
||||||
type: object
|
type: object
|
||||||
|
dockerdWithinRunnerContainer:
|
||||||
|
type: boolean
|
||||||
env:
|
env:
|
||||||
items:
|
items:
|
||||||
description: EnvVar represents an environment variable present in a Container.
|
description: EnvVar represents an environment variable present in a Container.
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ func (r *RunnerReconciler) unregisterRunner(ctx context.Context, org, repo, name
|
||||||
func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
|
func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
|
||||||
var (
|
var (
|
||||||
privileged bool = true
|
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
|
runnerImage := runner.Spec.Image
|
||||||
|
|
@ -338,7 +338,7 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
|
||||||
EnvFrom: runner.Spec.EnvFrom,
|
EnvFrom: runner.Spec.EnvFrom,
|
||||||
SecurityContext: &corev1.SecurityContext{
|
SecurityContext: &corev1.SecurityContext{
|
||||||
// Runner need to run privileged if it contains DinD
|
// Runner need to run privileged if it contains DinD
|
||||||
Privileged: runner.Spec.DockerWithinRunnerContainer,
|
Privileged: runner.Spec.DockerdWithinRunnerContainer,
|
||||||
},
|
},
|
||||||
Resources: runner.Spec.Resources,
|
Resources: runner.Spec.Resources,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue