Allow migration from Gossip DNS to no DNS

This commit is contained in:
Ciprian Hacman 2022-12-21 18:26:36 +02:00
parent 1c0e17340a
commit 362601cd66
2 changed files with 7 additions and 7 deletions

View File

@ -820,10 +820,10 @@ func (c *Cluster) IsSharedAzureRouteTable() bool {
}
func (c *Cluster) IsGossip() bool {
if dns.IsGossipClusterName(c.Name) {
return true
if c.UsesNoneDNS() || !dns.IsGossipClusterName(c.Name) {
return false
}
return false
return true
}
func (c *Cluster) UsesPublicDNS() bool {

View File

@ -45,15 +45,14 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog/v2"
"k8s.io/kops/pkg/flagbuilder"
"sigs.k8s.io/yaml"
kopscontrollerconfig "k8s.io/kops/cmd/kops-controller/pkg/config"
"k8s.io/kops/pkg/apis/kops"
apiModel "k8s.io/kops/pkg/apis/kops/model"
"k8s.io/kops/pkg/apis/kops/util"
"k8s.io/kops/pkg/apis/nodeup"
"k8s.io/kops/pkg/dns"
"k8s.io/kops/pkg/featureflag"
"k8s.io/kops/pkg/flagbuilder"
"k8s.io/kops/pkg/kubemanifest"
"k8s.io/kops/pkg/model"
"k8s.io/kops/pkg/model/components/kopscontroller"
@ -66,6 +65,7 @@ import (
gcetpm "k8s.io/kops/upup/pkg/fi/cloudup/gce/tpm"
"k8s.io/kops/upup/pkg/fi/cloudup/hetzner"
"k8s.io/kops/util/pkg/env"
"sigs.k8s.io/yaml"
)
// TemplateFunctions provides a collection of methods used throughout the templates
@ -127,7 +127,7 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
dest["GossipDomains"] = func() []string {
var names []string
if cluster.IsGossip() {
if dns.IsGossipClusterName(cluster.Name) {
names = append(names, "k8s.local")
}