Skip to content

Commit

Permalink
Remove unused DNSAddOnType constants from kubeadm/v1alpha4
Browse files Browse the repository at this point in the history
  • Loading branch information
ludusrusso committed Apr 29, 2021
1 parent 9d82562 commit 0eb7406
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
11 changes: 0 additions & 11 deletions bootstrap/kubeadm/api/v1alpha4/kubeadm_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,6 @@ type APIServer struct {
TimeoutForControlPlane *metav1.Duration `json:"timeoutForControlPlane,omitempty"`
}

// DNSAddOnType defines string identifying DNS add-on types.
type DNSAddOnType string

const (
// CoreDNS add-on type.
CoreDNS DNSAddOnType = "CoreDNS"

// KubeDNS add-on type.
KubeDNS DNSAddOnType = "kube-dns"
)

// DNS defines the DNS addon that should be used in the cluster.
type DNS struct {
// ImageMeta allows to customize the image used for the DNS component
Expand Down
2 changes: 0 additions & 2 deletions controlplane/kubeadm/internal/kubeadm_config_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const (
statusAPIEndpointsKey = "apiEndpoints"
configVersionKey = "kubernetesVersion"
dnsKey = "dns"
dnsTypeKey = "type"
dnsImageRepositoryKey = "imageRepository"
dnsImageTagKey = "imageTag"
configImageRepositoryKey = "imageRepository"
Expand Down Expand Up @@ -205,7 +204,6 @@ func (k *kubeadmConfig) UpdateCoreDNSImageInfo(repository, tag string) error {
return errors.Wrapf(err, "unable to decode kubeadm ConfigMap's %q to Unstructured object", clusterConfigurationKey)
}
dnsMap := map[string]string{
dnsTypeKey: string(bootstrapv1.CoreDNS),
dnsImageRepositoryKey: repository,
dnsImageTagKey: tag,
}
Expand Down
9 changes: 4 additions & 5 deletions controlplane/kubeadm/internal/kubeadm_config_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ scheduler: {}`,

g.Expect(yaml.Unmarshal([]byte(kc.ConfigMap.Data[clusterConfigurationKey]), &actualClusterConfig)).To(Succeed())
actualDNS := actualClusterConfig.DNS
g.Expect(actualDNS.Type).To(BeEquivalentTo(bootstrapv1.CoreDNS))
g.Expect(actualDNS.ImageRepository).To(Equal(imageRepository))
g.Expect(actualDNS.ImageTag).To(Equal(imageTag))
})
Expand Down Expand Up @@ -576,8 +575,8 @@ kind: ClusterConfiguration
name: mount1
- hostPath: /a/b
mountPath: /c/d
name: mount2
timeoutForControlPlane: 3m0s
name: mount2
timeoutForControlPlane: 3m0s
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
`},
Expand Down Expand Up @@ -612,8 +611,8 @@ kind: ClusterConfiguration
name: mount1
- hostPath: /a/b
mountPath: /c/d
name: mount2
timeoutForControlPlane: 3m0s
name: mount2
timeoutForControlPlane: 3m0s
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
`,
Expand Down

0 comments on commit 0eb7406

Please sign in to comment.