From e4289038717bf05bea0ce16d25cef294935ed2e4 Mon Sep 17 00:00:00 2001 From: John Gardiner Myers Date: Sun, 12 Jan 2020 14:53:22 -0800 Subject: [PATCH] Remove code for unsupported k8s versions from pkg/model --- pkg/model/context.go | 12 +++++------- pkg/model/network.go | 8 ++++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/pkg/model/context.go b/pkg/model/context.go index efd85cc1d8..be3020b2ad 100644 --- a/pkg/model/context.go +++ b/pkg/model/context.go @@ -244,13 +244,11 @@ func (m *KopsModelContext) CloudTags(name string, shared bool) map[string]string // Kubernetes 1.6 introduced the shared ownership tag; that replaces TagClusterName setLegacyTag := true - if m.IsKubernetesGTE("1.6") { - // For the moment, we only skip the legacy tag for shared resources - // (other people may be using it) - if shared { - klog.V(4).Infof("Skipping %q tag for shared resource", awsup.TagClusterName) - setLegacyTag = false - } + // For the moment, we only skip the legacy tag for shared resources + // (other people may be using it) + if shared { + klog.V(4).Infof("Skipping %q tag for shared resource", awsup.TagClusterName) + setLegacyTag = false } if setLegacyTag { tags[awsup.TagClusterName] = m.Cluster.ObjectMeta.Name diff --git a/pkg/model/network.go b/pkg/model/network.go index c8103831ca..bc58ecb8db 100644 --- a/pkg/model/network.go +++ b/pkg/model/network.go @@ -64,10 +64,10 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error { Tags: vpcTags, } - if sharedVPC && b.IsKubernetesGTE("1.5") { - // If we're running k8s 1.5, and we have e.g. --kubelet-preferred-address-types=InternalIP,Hostname,ExternalIP,LegacyHostIP - // then we don't need EnableDNSHostnames any more - klog.V(4).Infof("Kubernetes version %q; skipping EnableDNSHostnames requirement on VPC", b.KubernetesVersion()) + if sharedVPC { + // If we have e.g. --kubelet-preferred-address-types=InternalIP,Hostname,ExternalIP,LegacyHostIP + // then we don't need EnableDNSHostnames + klog.V(4).Info("Skipping EnableDNSHostnames requirement on VPC") } else { // In theory we don't need to enable it for >= 1.5, // but seems safer to stick with existing behaviour