Remove code for unsupported k8s versions from pkg/model

This commit is contained in:
John Gardiner Myers 2020-01-12 14:53:22 -08:00
parent 6e9dc8fc0f
commit e428903871
2 changed files with 9 additions and 11 deletions

View File

@ -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

View File

@ -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