From c294e3df585fe7dcdff9e85fae8c87f49470c23a Mon Sep 17 00:00:00 2001 From: Bharath Vedartham Date: Sun, 15 Nov 2020 01:21:19 +0530 Subject: [PATCH] dockerconfig: Add default runtime and runtimes fields --- k8s/crds/kops.k8s.io_clusters.yaml | 8 ++++++++ pkg/apis/kops/dockerconfig.go | 4 ++++ pkg/apis/kops/v1alpha2/dockerconfig.go | 4 ++++ pkg/apis/kops/v1alpha2/zz_generated.conversion.go | 4 ++++ pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go | 10 ++++++++++ pkg/apis/kops/zz_generated.deepcopy.go | 10 ++++++++++ 6 files changed, 40 insertions(+) diff --git a/k8s/crds/kops.k8s.io_clusters.yaml b/k8s/crds/kops.k8s.io_clusters.yaml index c4016280d9995..74e79c63e77de 100644 --- a/k8s/crds/kops.k8s.io_clusters.yaml +++ b/k8s/crds/kops.k8s.io_clusters.yaml @@ -437,6 +437,9 @@ spec: dataRoot: description: DataRoot is the root directory of persistent docker state (default "/var/lib/docker") type: string + defaultRuntime: + description: DefaultRuntime is the default OCI runtime for containers (default "runc") + type: string defaultUlimit: description: DefaultUlimit is the ulimits for containers items: @@ -501,6 +504,11 @@ spec: items: type: string type: array + runtimes: + description: Runtimes registers an additional OCI compatible runtime (default []) + items: + type: string + type: array selinuxEnabled: description: SelinuxEnabled enables SELinux support type: boolean diff --git a/pkg/apis/kops/dockerconfig.go b/pkg/apis/kops/dockerconfig.go index 67ea678ba3f69..d79b5d308fc28 100644 --- a/pkg/apis/kops/dockerconfig.go +++ b/pkg/apis/kops/dockerconfig.go @@ -28,6 +28,8 @@ type DockerConfig struct { DataRoot *string `json:"dataRoot,omitempty" flag:"data-root"` // DefaultUlimit is the ulimits for containers DefaultUlimit []string `json:"defaultUlimit,omitempty" flag:"default-ulimit,repeat"` + // DefaultRuntime is the default OCI runtime for containers (default "runc") + DefaultRuntime *string `json:"defaultRuntime,omitempty" flag:"default-runtime"` // ExecOpt is a series of options passed to the runtime ExecOpt []string `json:"execOpt,omitempty" flag:"exec-opt,repeat"` // ExecRoot is the root directory for execution state files (default "/var/run/docker") @@ -60,6 +62,8 @@ type DockerConfig struct { MTU *int32 `json:"mtu,omitempty" flag:"mtu"` // RegistryMirrors is a referred list of docker registry mirror RegistryMirrors []string `json:"registryMirrors,omitempty" flag:"registry-mirror,repeat"` + // Runtimes registers an additional OCI compatible runtime (default []) + Runtimes []string `json:"runtimes,omitempty" flag:"add-runtime,repeat"` // SelinuxEnabled enables SELinux support SelinuxEnabled *bool `json:"selinuxEnabled,omitempty" flag:"selinux-enabled"` // SkipInstall when set to true will prevent kops from installing and modifying Docker in any way diff --git a/pkg/apis/kops/v1alpha2/dockerconfig.go b/pkg/apis/kops/v1alpha2/dockerconfig.go index 840a252c47821..1d014e75d9102 100644 --- a/pkg/apis/kops/v1alpha2/dockerconfig.go +++ b/pkg/apis/kops/v1alpha2/dockerconfig.go @@ -28,6 +28,8 @@ type DockerConfig struct { DataRoot *string `json:"dataRoot,omitempty" flag:"data-root"` // DefaultUlimit is the ulimits for containers DefaultUlimit []string `json:"defaultUlimit,omitempty" flag:"default-ulimit,repeat"` + // DefaultRuntime is the default OCI runtime for containers (default "runc") + DefaultRuntime *string `json:"defaultRuntime,omitempty" flag:"default-runtime"` // ExecOpt is a series of options passed to the runtime ExecOpt []string `json:"execOpt,omitempty" flag:"exec-opt,repeat"` // ExecRoot is the root directory for execution state files (default "/var/run/docker") @@ -60,6 +62,8 @@ type DockerConfig struct { MTU *int32 `json:"mtu,omitempty" flag:"mtu"` // RegistryMirrors is a referred list of docker registry mirror RegistryMirrors []string `json:"registryMirrors,omitempty" flag:"registry-mirror,repeat"` + // Runtimes registers an additional OCI compatible runtime (default []) + Runtimes []string `json:"runtimes,omitempty" flag:"add-runtime,repeat"` // SelinuxEnabled enables SELinux support SelinuxEnabled *bool `json:"selinuxEnabled,omitempty" flag:"selinux-enabled"` // SkipInstall when set to true will prevent kops from installing and modifying Docker in any way diff --git a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go index 0adc3dae77baf..be54ebc6739ee 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go @@ -2712,6 +2712,7 @@ func autoConvert_v1alpha2_DockerConfig_To_kops_DockerConfig(in *DockerConfig, ou out.BridgeIP = in.BridgeIP out.DataRoot = in.DataRoot out.DefaultUlimit = in.DefaultUlimit + out.DefaultRuntime = in.DefaultRuntime out.ExecOpt = in.ExecOpt out.ExecRoot = in.ExecRoot out.Experimental = in.Experimental @@ -2728,6 +2729,7 @@ func autoConvert_v1alpha2_DockerConfig_To_kops_DockerConfig(in *DockerConfig, ou out.MetricsAddress = in.MetricsAddress out.MTU = in.MTU out.RegistryMirrors = in.RegistryMirrors + out.Runtimes = in.Runtimes out.SelinuxEnabled = in.SelinuxEnabled out.SkipInstall = in.SkipInstall out.Storage = in.Storage @@ -2748,6 +2750,7 @@ func autoConvert_kops_DockerConfig_To_v1alpha2_DockerConfig(in *kops.DockerConfi out.BridgeIP = in.BridgeIP out.DataRoot = in.DataRoot out.DefaultUlimit = in.DefaultUlimit + out.DefaultRuntime = in.DefaultRuntime out.ExecOpt = in.ExecOpt out.ExecRoot = in.ExecRoot out.Experimental = in.Experimental @@ -2764,6 +2767,7 @@ func autoConvert_kops_DockerConfig_To_v1alpha2_DockerConfig(in *kops.DockerConfi out.MetricsAddress = in.MetricsAddress out.MTU = in.MTU out.RegistryMirrors = in.RegistryMirrors + out.Runtimes = in.Runtimes out.SelinuxEnabled = in.SelinuxEnabled out.SkipInstall = in.SkipInstall out.Storage = in.Storage diff --git a/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go index 88250c5b709bf..7818d804596a2 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go @@ -1105,6 +1105,11 @@ func (in *DockerConfig) DeepCopyInto(out *DockerConfig) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.DefaultRuntime != nil { + in, out := &in.DefaultRuntime, &out.DefaultRuntime + *out = new(string) + **out = **in + } if in.ExecOpt != nil { in, out := &in.ExecOpt, &out.ExecOpt *out = make([]string, len(*in)) @@ -1180,6 +1185,11 @@ func (in *DockerConfig) DeepCopyInto(out *DockerConfig) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.Runtimes != nil { + in, out := &in.Runtimes, &out.Runtimes + *out = make([]string, len(*in)) + copy(*out, *in) + } if in.SelinuxEnabled != nil { in, out := &in.SelinuxEnabled, &out.SelinuxEnabled *out = new(bool) diff --git a/pkg/apis/kops/zz_generated.deepcopy.go b/pkg/apis/kops/zz_generated.deepcopy.go index 454dbb5a3b70b..2e6bd12af2920 100644 --- a/pkg/apis/kops/zz_generated.deepcopy.go +++ b/pkg/apis/kops/zz_generated.deepcopy.go @@ -1228,6 +1228,11 @@ func (in *DockerConfig) DeepCopyInto(out *DockerConfig) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.DefaultRuntime != nil { + in, out := &in.DefaultRuntime, &out.DefaultRuntime + *out = new(string) + **out = **in + } if in.ExecOpt != nil { in, out := &in.ExecOpt, &out.ExecOpt *out = make([]string, len(*in)) @@ -1303,6 +1308,11 @@ func (in *DockerConfig) DeepCopyInto(out *DockerConfig) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.Runtimes != nil { + in, out := &in.Runtimes, &out.Runtimes + *out = make([]string, len(*in)) + copy(*out, *in) + } if in.SelinuxEnabled != nil { in, out := &in.SelinuxEnabled, &out.SelinuxEnabled *out = new(bool)