From fdc128fda4ab253dceae77b92d6e581ad2eb5ec2 Mon Sep 17 00:00:00 2001 From: John Gardiner Myers Date: Tue, 26 Oct 2021 15:53:34 -0700 Subject: [PATCH] Remove vestigial Cilium ContainerRuntimeLabels code --- pkg/apis/kops/networking.go | 6 ------ pkg/apis/kops/v1alpha2/networking.go | 7 ++----- pkg/apis/kops/v1alpha3/networking.go | 6 ------ pkg/apis/kops/validation/validation.go | 4 ---- pkg/model/components/cilium.go | 4 ---- .../networking.cilium.io/k8s-1.12-v1.8.yaml.template | 1 - .../networking.cilium.io/k8s-1.12-v1.9.yaml.template | 1 - .../networking.cilium.io/k8s-1.16-v1.10.yaml.template | 1 - 8 files changed, 2 insertions(+), 28 deletions(-) diff --git a/pkg/apis/kops/networking.go b/pkg/apis/kops/networking.go index b15c26490a..8c44aff039 100644 --- a/pkg/apis/kops/networking.go +++ b/pkg/apis/kops/networking.go @@ -513,12 +513,6 @@ type CiliumNetworkingSpec struct { // with the less powerful legacy implementation. // Default: false ToFqdnsEnablePoller bool `json:"toFqdnsEnablePoller,omitempty"` - // ContainerRuntimeLabels enables fetching of container-runtime labels from the specified container runtime and associating them with endpoints. - // Supported values are: "none", "containerd", "crio", "docker", "auto" - // As of Cilium 1.7.0, Cilium no longer fetches information from the - // container runtime and this field is ignored. - // Default: none - ContainerRuntimeLabels string `json:"containerRuntimeLabels,omitempty"` // Ipam specifies the IP address allocation mode to use. // Possible values are "crd" and "eni". // "eni" will use AWS native networking for pods. Eni requires masquerade to be set to false. diff --git a/pkg/apis/kops/v1alpha2/networking.go b/pkg/apis/kops/v1alpha2/networking.go index 323f36355f..ff05b6c79d 100644 --- a/pkg/apis/kops/v1alpha2/networking.go +++ b/pkg/apis/kops/v1alpha2/networking.go @@ -522,11 +522,8 @@ type CiliumNetworkingSpec struct { // with the less powerful legacy implementation. // Default: false ToFqdnsEnablePoller bool `json:"toFqdnsEnablePoller,omitempty"` - // ContainerRuntimeLabels enables fetching of container-runtime labels from the specified container runtime and associating them with endpoints. - // Supported values are: "none", "containerd", "crio", "docker", "auto" - // As of Cilium 1.7.0, Cilium no longer fetches information from the - // container runtime and this field is ignored. - // Default: none + // ContainerRuntimeLabels is unused. + // +k8s:conversion-gen=false ContainerRuntimeLabels string `json:"containerRuntimeLabels,omitempty"` // Ipam specifies the IP address allocation mode to use. // Possible values are "crd" and "eni". diff --git a/pkg/apis/kops/v1alpha3/networking.go b/pkg/apis/kops/v1alpha3/networking.go index 23313bd300..6f7a4f7aeb 100644 --- a/pkg/apis/kops/v1alpha3/networking.go +++ b/pkg/apis/kops/v1alpha3/networking.go @@ -502,12 +502,6 @@ type CiliumNetworkingSpec struct { // with the less powerful legacy implementation. // Default: false ToFqdnsEnablePoller bool `json:"toFqdnsEnablePoller,omitempty"` - // ContainerRuntimeLabels enables fetching of container-runtime labels from the specified container runtime and associating them with endpoints. - // Supported values are: "none", "containerd", "crio", "docker", "auto" - // As of Cilium 1.7.0, Cilium no longer fetches information from the - // container runtime and this field is ignored. - // Default: none - ContainerRuntimeLabels string `json:"containerRuntimeLabels,omitempty"` // Ipam specifies the IP address allocation mode to use. // Possible values are "crd" and "eni". // "eni" will use AWS native networking for pods. Eni requires masquerade to be set to false. diff --git a/pkg/apis/kops/validation/validation.go b/pkg/apis/kops/validation/validation.go index 83e9873860..f0b370d19b 100644 --- a/pkg/apis/kops/validation/validation.go +++ b/pkg/apis/kops/validation/validation.go @@ -871,10 +871,6 @@ func validateNetworkingCilium(cluster *kops.Cluster, v *kops.CiliumNetworkingSpe allErrs = append(allErrs, IsValidValue(fldPath.Child("monitorAggregation"), &v.MonitorAggregation, []string{"low", "medium", "maximum"})...) } - if v.ContainerRuntimeLabels != "" { - allErrs = append(allErrs, IsValidValue(fldPath.Child("containerRuntimeLabels"), &v.ContainerRuntimeLabels, []string{"none", "containerd", "crio", "docker", "auto"})...) - } - if v.IdentityAllocationMode != "" { allErrs = append(allErrs, IsValidValue(fldPath.Child("identityAllocationMode"), &v.IdentityAllocationMode, []string{"crd", "kvstore"})...) diff --git a/pkg/model/components/cilium.go b/pkg/model/components/cilium.go index 86a8312c63..6e37104282 100644 --- a/pkg/model/components/cilium.go +++ b/pkg/model/components/cilium.go @@ -103,10 +103,6 @@ func (b *CiliumOptionsBuilder) BuildOptions(o interface{}) error { c.ToFqdnsDNSRejectResponseCode = "refused" } - if c.ContainerRuntimeLabels == "" { - c.ContainerRuntimeLabels = "none" - } - if c.AgentPrometheusPort == 0 { c.AgentPrometheusPort = wellknownports.CiliumPrometheusPort } diff --git a/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12-v1.8.yaml.template b/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12-v1.8.yaml.template index feb86d3ca6..fd9a4e09a3 100644 --- a/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12-v1.8.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12-v1.8.yaml.template @@ -148,7 +148,6 @@ data: # - none # - auto (automatically detect the container runtime) # - container-runtime: "{{ .ContainerRuntimeLabels }}" masquerade: "{{- if WithDefaultBool .DisableMasquerade false -}}false{{- else -}}true{{- end -}}" install-iptables-rules: "{{- if .IPTablesRulesNoinstall -}}false{{- else -}}true{{- end -}}" auto-direct-node-routes: "{{ .AutoDirectNodeRoutes }}" diff --git a/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12-v1.9.yaml.template b/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12-v1.9.yaml.template index 78cc040eae..6898f272b8 100644 --- a/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12-v1.9.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12-v1.9.yaml.template @@ -201,7 +201,6 @@ data: # - none # - auto (automatically detect the container runtime) # - container-runtime: "{{ .ContainerRuntimeLabels }}" masquerade: "{{- if WithDefaultBool .DisableMasquerade false -}}false{{- else -}}true{{- end -}}" install-iptables-rules: "{{- if .IPTablesRulesNoinstall -}}false{{- else -}}true{{- end -}}" auto-direct-node-routes: "{{ .AutoDirectNodeRoutes }}" diff --git a/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.16-v1.10.yaml.template b/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.16-v1.10.yaml.template index 59e5cb5b06..d082107c75 100644 --- a/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.16-v1.10.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.16-v1.10.yaml.template @@ -221,7 +221,6 @@ data: # - none # - auto (automatically detect the container runtime) # - container-runtime: "{{ .ContainerRuntimeLabels }}" masquerade: "{{- if WithDefaultBool .DisableMasquerade false -}}false{{- else -}}true{{- end -}}" enable-ipv6-masquerade: "{{- if WithDefaultBool .DisableMasquerade false -}}false{{- else -}}true{{- end -}}" install-iptables-rules: "{{- if .IPTablesRulesNoinstall -}}false{{- else -}}true{{- end -}}"