Files
kubernetes/cmd/kubeadm/app/cmd/phases/addons_test.go
Lubomir I. Ivanov ebc254c40f kubeadm: rename the kube-dns phases addon
The command `kubeadm alpha phases addon` has a property
called `kube-dns` which would install kube-dns, pre 1.11.

In the case of 1.11 this property will install CoreDNS,
because the property is also bound to the `CoreDNS` feature gate,
which is now `true` by default.

Fix that by renaming the property to `coredns`, updating the Cobra
info and also updating the unit tests.
2018-05-24 22:08:31 +03:00

72 lines
1.6 KiB
Go

/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package phases
import (
"testing"
cmdtestutil "k8s.io/kubernetes/cmd/kubeadm/test/cmd"
)
func TestAddonsSubCommandsHasFlags(t *testing.T) {
subCmds := getAddonsSubCommands()
commonFlags := []string{
"kubeconfig",
"config",
"kubernetes-version",
"image-repository",
}
var tests = []struct {
command string
additionalFlags []string
}{
{
command: "all",
additionalFlags: []string{
"apiserver-advertise-address",
"apiserver-bind-port",
"pod-network-cidr",
"service-dns-domain",
"service-cidr",
},
},
{
command: "kube-proxy",
additionalFlags: []string{
"apiserver-advertise-address",
"apiserver-bind-port",
"pod-network-cidr",
},
},
{
command: "coredns",
additionalFlags: []string{
"service-dns-domain",
"service-cidr",
},
},
}
for _, test := range tests {
expectedFlags := append(commonFlags, test.additionalFlags...)
cmdtestutil.AssertSubCommandHasFlags(t, subCmds, test.command, expectedFlags...)
}
}