Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
5656338b
Unverified
Commit
5656338b
authored
Nov 09, 2018
by
Lucas Käldström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update unit tests after the rename
parent
731bcdc8
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
76 additions
and
76 deletions
+76
-76
validation_test.go
cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go
+6
-6
proxy_test.go
cmd/kubeadm/app/phases/addons/proxy/proxy_test.go
+3
-3
certs_test.go
cmd/kubeadm/app/phases/certs/certs_test.go
+2
-2
manifests_test.go
cmd/kubeadm/app/phases/controlplane/manifests_test.go
+15
-15
local_test.go
cmd/kubeadm/app/phases/etcd/local_test.go
+3
-3
kubeconfig_test.go
cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go
+8
-8
postupgrade_test.go
cmd/kubeadm/app/phases/upgrade/postupgrade_test.go
+1
-1
uploadconfig_test.go
cmd/kubeadm/app/phases/uploadconfig/uploadconfig_test.go
+2
-2
checks_test.go
cmd/kubeadm/app/preflight/checks_test.go
+2
-2
cluster_test.go
cmd/kubeadm/app/util/config/cluster_test.go
+4
-4
internal.yaml
.../app/util/config/testdata/conversion/master/internal.yaml
+3
-3
v1beta1.yaml
...m/app/util/config/testdata/conversion/master/v1beta1.yaml
+3
-3
defaulted.yaml
...app/util/config/testdata/defaulting/master/defaulted.yaml
+3
-3
incomplete.yaml
...pp/util/config/testdata/defaulting/master/incomplete.yaml
+2
-2
endpoint_test.go
cmd/kubeadm/app/util/endpoint_test.go
+11
-11
pki_helpers_test.go
cmd/kubeadm/app/util/pkiutil/pki_helpers_test.go
+4
-4
utils_test.go
cmd/kubeadm/app/util/staticpod/utils_test.go
+4
-4
No files found.
cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go
View file @
5656338b
...
...
@@ -359,7 +359,7 @@ func TestValidateInitConfiguration(t *testing.T) {
&
kubeadm
.
InitConfiguration
{},
false
},
{
"invalid missing token with IPv4 service subnet"
,
&
kubeadm
.
InitConfiguration
{
APIEndpoint
:
kubeadm
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadm
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
6443
,
},
...
...
@@ -374,7 +374,7 @@ func TestValidateInitConfiguration(t *testing.T) {
},
false
},
{
"invalid missing token with IPv6 service subnet"
,
&
kubeadm
.
InitConfiguration
{
APIEndpoint
:
kubeadm
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadm
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
6443
,
},
...
...
@@ -389,7 +389,7 @@ func TestValidateInitConfiguration(t *testing.T) {
},
false
},
{
"invalid missing node name"
,
&
kubeadm
.
InitConfiguration
{
APIEndpoint
:
kubeadm
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadm
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
6443
,
},
...
...
@@ -403,7 +403,7 @@ func TestValidateInitConfiguration(t *testing.T) {
},
false
},
{
"valid master configuration with incorrect IPv4 pod subnet"
,
&
kubeadm
.
InitConfiguration
{
APIEndpoint
:
kubeadm
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadm
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
6443
,
},
...
...
@@ -419,7 +419,7 @@ func TestValidateInitConfiguration(t *testing.T) {
},
false
},
{
"valid master configuration with IPv4 service subnet"
,
&
kubeadm
.
InitConfiguration
{
APIEndpoint
:
kubeadm
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadm
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
6443
,
},
...
...
@@ -466,7 +466,7 @@ func TestValidateInitConfiguration(t *testing.T) {
},
true
},
{
"valid master configuration using IPv6 service subnet"
,
&
kubeadm
.
InitConfiguration
{
APIEndpoint
:
kubeadm
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadm
.
APIEndpoint
{
AdvertiseAddress
:
"1:2:3::4"
,
BindPort
:
3446
,
},
...
...
cmd/kubeadm/app/phases/addons/proxy/proxy_test.go
View file @
5656338b
...
...
@@ -174,7 +174,7 @@ func TestEnsureProxyAddon(t *testing.T) {
client
:=
clientsetfake
.
NewSimpleClientset
()
// TODO: Consider using a YAML file instead for this that makes it possible to specify YAML documents for the ComponentConfigs
masterConfig
:=
&
kubeadmapiv1beta1
.
InitConfiguration
{
APIEndpoint
:
kubeadmapiv1beta1
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapiv1beta1
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
,
},
...
...
@@ -194,9 +194,9 @@ func TestEnsureProxyAddon(t *testing.T) {
return
true
,
nil
,
apierrors
.
NewUnauthorized
(
""
)
})
case
InvalidMasterEndpoint
:
masterConfig
.
APIEndpoint
.
AdvertiseAddress
=
"1.2.3"
masterConfig
.
Local
APIEndpoint
.
AdvertiseAddress
=
"1.2.3"
case
IPv6SetBindAddress
:
masterConfig
.
APIEndpoint
.
AdvertiseAddress
=
"1:2::3:4"
masterConfig
.
Local
APIEndpoint
.
AdvertiseAddress
=
"1:2::3:4"
masterConfig
.
Networking
.
PodSubnet
=
"2001:101::/96"
}
...
...
cmd/kubeadm/app/phases/certs/certs_test.go
View file @
5656338b
...
...
@@ -506,7 +506,7 @@ func TestUsingExternalCA(t *testing.T) {
defer
os
.
RemoveAll
(
dir
)
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"10.96.0.0/12"
,
DNSDomain
:
"cluster.local"
},
CertificatesDir
:
dir
,
...
...
@@ -675,7 +675,7 @@ func TestCreateCertificateFilesMethods(t *testing.T) {
defer
os
.
RemoveAll
(
tmpdir
)
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Etcd
:
kubeadmapi
.
Etcd
{
Local
:
&
kubeadmapi
.
LocalEtcd
{}},
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"10.96.0.0/12"
,
DNSDomain
:
"cluster.local"
},
...
...
cmd/kubeadm/app/phases/controlplane/manifests_test.go
View file @
5656338b
...
...
@@ -146,7 +146,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"testing defaults"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
CertificatesDir
:
testCertsDir
,
...
...
@@ -185,7 +185,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"ignores the audit policy if the feature gate is not enabled"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"4.3.2.1"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"4.3.2.1"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
CertificatesDir
:
testCertsDir
,
...
...
@@ -229,7 +229,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"ipv6 advertise address"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"2001:db8::1"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"2001:db8::1"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
CertificatesDir
:
testCertsDir
,
...
...
@@ -268,7 +268,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"an external etcd with custom ca, certs and keys"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"2001:db8::1"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"2001:db8::1"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
Etcd
:
kubeadmapi
.
Etcd
{
...
...
@@ -315,7 +315,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"an insecure etcd"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"2001:db8::1"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"2001:db8::1"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
Etcd
:
kubeadmapi
.
Etcd
{
...
...
@@ -356,7 +356,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"auditing is enabled with a custom log max age of 0"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"2001:db8::1"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"2001:db8::1"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
FeatureGates
:
map
[
string
]
bool
{
features
.
Auditing
:
true
},
...
...
@@ -402,7 +402,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"ensure the DynamicKubelet flag gets passed through"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
CertificatesDir
:
testCertsDir
,
...
...
@@ -443,7 +443,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"test APIServer.ExtraArgs works as expected"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
CertificatesDir
:
testCertsDir
,
...
...
@@ -497,7 +497,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"authorization-mode extra-args ABAC"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
CertificatesDir
:
testCertsDir
,
...
...
@@ -543,7 +543,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"insecure-port extra-args"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
CertificatesDir
:
testCertsDir
,
...
...
@@ -589,7 +589,7 @@ func TestGetAPIServerCommand(t *testing.T) {
{
name
:
"authorization-mode extra-args Webhook"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
CertificatesDir
:
testCertsDir
,
...
...
@@ -971,7 +971,7 @@ func TestGetControllerManagerCommandExternalCA(t *testing.T) {
{
name
:
"caKeyPresent-false for v1.12.0-beta.2"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
KubernetesVersion
:
"v1.12.0-beta.2"
,
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"10.96.0.0/12"
,
DNSDomain
:
"cluster.local"
},
...
...
@@ -1000,7 +1000,7 @@ func TestGetControllerManagerCommandExternalCA(t *testing.T) {
{
name
:
"caKeyPresent true for v1.12.0-beta.2"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
KubernetesVersion
:
"v1.12.0-beta.2"
,
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"10.96.0.0/12"
,
DNSDomain
:
"cluster.local"
},
...
...
@@ -1029,7 +1029,7 @@ func TestGetControllerManagerCommandExternalCA(t *testing.T) {
{
name
:
"caKeyPresent-false for v1.11.3"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
KubernetesVersion
:
"v1.11.3"
,
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"10.96.0.0/12"
,
DNSDomain
:
"cluster.local"
},
...
...
@@ -1054,7 +1054,7 @@ func TestGetControllerManagerCommandExternalCA(t *testing.T) {
{
name
:
"caKeyPresent true for v1.11.3"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
KubernetesVersion
:
"v1.11.3"
,
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"10.96.0.0/12"
,
DNSDomain
:
"cluster.local"
},
...
...
cmd/kubeadm/app/phases/etcd/local_test.go
View file @
5656338b
...
...
@@ -124,7 +124,7 @@ func TestGetEtcdCommand(t *testing.T) {
{
name
:
"Default args - with empty etcd initial cluster"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
},
NodeRegistration
:
kubeadmapi
.
NodeRegistrationOptions
{
...
...
@@ -161,7 +161,7 @@ func TestGetEtcdCommand(t *testing.T) {
{
name
:
"Default args - With an existing etcd cluster"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
},
NodeRegistration
:
kubeadmapi
.
NodeRegistrationOptions
{
...
...
@@ -203,7 +203,7 @@ func TestGetEtcdCommand(t *testing.T) {
{
name
:
"Extra args"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
},
NodeRegistration
:
kubeadmapi
.
NodeRegistrationOptions
{
...
...
cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go
View file @
5656338b
...
...
@@ -69,14 +69,14 @@ func TestGetKubeConfigSpecs(t *testing.T) {
// Creates Master Configurations pointing to the pkidir folder
cfgs
:=
[]
*
kubeadmapi
.
InitConfiguration
{
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
CertificatesDir
:
pkidir
,
},
NodeRegistration
:
kubeadmapi
.
NodeRegistrationOptions
{
Name
:
"valid-node-name"
},
},
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
ControlPlaneEndpoint
:
"api.k8s.io"
,
CertificatesDir
:
pkidir
,
...
...
@@ -84,7 +84,7 @@ func TestGetKubeConfigSpecs(t *testing.T) {
NodeRegistration
:
kubeadmapi
.
NodeRegistrationOptions
{
Name
:
"valid-node-name"
},
},
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
ControlPlaneEndpoint
:
"api.k8s.io:4321"
,
CertificatesDir
:
pkidir
,
...
...
@@ -92,7 +92,7 @@ func TestGetKubeConfigSpecs(t *testing.T) {
NodeRegistration
:
kubeadmapi
.
NodeRegistrationOptions
{
Name
:
"valid-node-name"
},
},
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
ControlPlaneEndpoint
:
"api.k8s.io"
,
CertificatesDir
:
pkidir
,
...
...
@@ -100,7 +100,7 @@ func TestGetKubeConfigSpecs(t *testing.T) {
NodeRegistration
:
kubeadmapi
.
NodeRegistrationOptions
{
Name
:
"valid-node-name"
},
},
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
ControlPlaneEndpoint
:
"api.k8s.io:4321"
,
CertificatesDir
:
pkidir
,
...
...
@@ -307,7 +307,7 @@ func TestCreateKubeconfigFilesAndWrappers(t *testing.T) {
// Creates a Master Configuration pointing to the pkidir folder
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
CertificatesDir
:
pkidir
,
},
...
...
@@ -384,7 +384,7 @@ func TestWriteKubeConfig(t *testing.T) {
// Creates a Master Configuration pointing to the pkidir folder
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
CertificatesDir
:
pkidir
,
},
...
...
@@ -506,7 +506,7 @@ func TestValidateKubeconfigsForExternalCA(t *testing.T) {
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
CertificatesDir
:
pkiDir
,
},
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
1234
,
AdvertiseAddress
:
"1.2.3.4"
,
},
...
...
cmd/kubeadm/app/phases/upgrade/postupgrade_test.go
View file @
5656338b
...
...
@@ -130,7 +130,7 @@ func TestRollbackFiles(t *testing.T) {
func
TestShouldBackupAPIServerCertAndKey
(
t
*
testing
.
T
)
{
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"10.96.0.0/12"
,
DNSDomain
:
"cluster.local"
},
},
...
...
cmd/kubeadm/app/phases/uploadconfig/uploadconfig_test.go
View file @
5656338b
...
...
@@ -65,7 +65,7 @@ func TestUploadConfiguration(t *testing.T) {
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t2
*
testing
.
T
)
{
initialcfg
:=
&
kubeadmapiv1beta1
.
InitConfiguration
{
APIEndpoint
:
kubeadmapiv1beta1
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapiv1beta1
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
},
ClusterConfiguration
:
kubeadmapiv1beta1
.
ClusterConfiguration
{
...
...
@@ -95,7 +95,7 @@ func TestUploadConfiguration(t *testing.T) {
status
:=
&
kubeadmapi
.
ClusterStatus
{
APIEndpoints
:
map
[
string
]
kubeadmapi
.
APIEndpoint
{
"node-foo"
:
cfg
.
APIEndpoint
,
"node-foo"
:
cfg
.
Local
APIEndpoint
,
},
}
...
...
cmd/kubeadm/app/preflight/checks_test.go
View file @
5656338b
...
...
@@ -191,7 +191,7 @@ func TestRunInitMasterChecks(t *testing.T) {
}{
{
name
:
"Test valid advertised address"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"foo"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"foo"
},
},
expected
:
false
,
},
...
...
@@ -224,7 +224,7 @@ func TestRunInitMasterChecks(t *testing.T) {
},
{
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"2001:1234::1:15"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"2001:1234::1:15"
},
},
expected
:
false
,
},
...
...
cmd/kubeadm/app/util/config/cluster_test.go
View file @
5656338b
...
...
@@ -459,7 +459,7 @@ func TestGetAPIEndpoint(t *testing.T) {
for
_
,
rt
:=
range
tests
{
t
.
Run
(
rt
.
name
,
func
(
t
*
testing
.
T
)
{
cfg
:=
&
kubeadmapi
.
InitConfiguration
{}
err
:=
getAPIEndpoint
(
rt
.
configMap
.
data
,
nodeName
,
&
cfg
.
APIEndpoint
)
err
:=
getAPIEndpoint
(
rt
.
configMap
.
data
,
nodeName
,
&
cfg
.
Local
APIEndpoint
)
if
rt
.
expectedError
!=
(
err
!=
nil
)
{
t
.
Errorf
(
"unexpected return err from getInitConfigurationFromCluster: %v"
,
err
)
return
...
...
@@ -468,7 +468,7 @@ func TestGetAPIEndpoint(t *testing.T) {
return
}
if
cfg
.
APIEndpoint
.
AdvertiseAddress
!=
"1.2.3.4"
||
cfg
.
APIEndpoint
.
BindPort
!=
1234
{
if
cfg
.
LocalAPIEndpoint
.
AdvertiseAddress
!=
"1.2.3.4"
||
cfg
.
Local
APIEndpoint
.
BindPort
!=
1234
{
t
.
Errorf
(
"invalid cfg.APIEndpoint"
)
}
})
...
...
@@ -757,8 +757,8 @@ func TestGetInitConfigurationFromCluster(t *testing.T) {
if
cfg
.
ClusterConfiguration
.
KubernetesVersion
!=
k8sVersionString
{
t
.
Errorf
(
"invalid ClusterConfiguration.KubernetesVersion"
)
}
if
!
rt
.
newControlPlane
&&
(
cfg
.
APIEndpoint
.
AdvertiseAddress
!=
"1.2.3.4"
||
cfg
.
APIEndpoint
.
BindPort
!=
1234
)
{
t
.
Errorf
(
"invalid cfg.APIEndpoint"
)
if
!
rt
.
newControlPlane
&&
(
cfg
.
LocalAPIEndpoint
.
AdvertiseAddress
!=
"1.2.3.4"
||
cfg
.
Local
APIEndpoint
.
BindPort
!=
1234
)
{
t
.
Errorf
(
"invalid cfg.
Local
APIEndpoint"
)
}
if
cfg
.
ComponentConfigs
.
Kubelet
==
nil
{
t
.
Errorf
(
"invalid cfg.ComponentConfigs.Kubelet"
)
...
...
cmd/kubeadm/app/util/config/testdata/conversion/master/internal.yaml
View file @
5656338b
APIEndpoint
:
AdvertiseAddress
:
192.168.2.2
BindPort
:
6443
APIServer
:
CertSANs
:
null
ExtraArgs
:
...
...
@@ -186,6 +183,9 @@ Etcd:
FeatureGates
:
null
ImageRepository
:
k8s.gcr.io
KubernetesVersion
:
v1.11.2
LocalAPIEndpoint
:
AdvertiseAddress
:
192.168.2.2
BindPort
:
6443
Networking
:
DNSDomain
:
cluster.local
PodSubnet
:
"
"
...
...
cmd/kubeadm/app/util/config/testdata/conversion/master/v1beta1.yaml
View file @
5656338b
apiEndpoint
:
advertiseAddress
:
192.168.2.2
bindPort
:
6443
apiVersion
:
kubeadm.k8s.io/v1beta1
bootstrapTokens
:
-
groups
:
...
...
@@ -11,6 +8,9 @@ bootstrapTokens:
-
signing
-
authentication
kind
:
InitConfiguration
localAPIEndpoint
:
advertiseAddress
:
192.168.2.2
bindPort
:
6443
nodeRegistration
:
criSocket
:
/var/run/dockershim.sock
name
:
master-1
...
...
cmd/kubeadm/app/util/config/testdata/defaulting/master/defaulted.yaml
View file @
5656338b
apiEndpoint
:
advertiseAddress
:
192.168.2.2
bindPort
:
6443
apiVersion
:
kubeadm.k8s.io/v1beta1
bootstrapTokens
:
-
groups
:
...
...
@@ -11,6 +8,9 @@ bootstrapTokens:
-
signing
-
authentication
kind
:
InitConfiguration
localAPIEndpoint
:
advertiseAddress
:
192.168.2.2
bindPort
:
6443
nodeRegistration
:
criSocket
:
/var/run/criruntime.sock
name
:
master-1
...
...
cmd/kubeadm/app/util/config/testdata/defaulting/master/incomplete.yaml
View file @
5656338b
apiVersion
:
kubeadm.k8s.io/v1beta1
kind
:
InitConfiguration
apiEndpoint
:
advertiseAddress
:
192.168.2.2
bootstrapTokens
:
-
token
:
s73ybu.6tw6wnqgp5z0wb77
localAPIEndpoint
:
advertiseAddress
:
192.168.2.2
nodeRegistration
:
criSocket
:
/var/run/criruntime.sock
name
:
master-1
...
...
cmd/kubeadm/app/util/endpoint_test.go
View file @
5656338b
...
...
@@ -32,7 +32,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"use ControlPlaneEndpoint (dns) if fully defined"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
4567
,
AdvertiseAddress
:
"4.5.6.7"
,
},
...
...
@@ -45,7 +45,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"use ControlPlaneEndpoint (ipv4) if fully defined"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
4567
,
AdvertiseAddress
:
"4.5.6.7"
,
},
...
...
@@ -58,7 +58,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"use ControlPlaneEndpoint (ipv6) if fully defined"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
4567
,
AdvertiseAddress
:
"4.5.6.7"
,
},
...
...
@@ -71,7 +71,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"use ControlPlaneEndpoint (dns) + BindPort if ControlPlaneEndpoint defined without port"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
4567
,
AdvertiseAddress
:
"4.5.6.7"
,
},
...
...
@@ -85,7 +85,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"use ControlPlaneEndpoint (ipv4) + BindPort if ControlPlaneEndpoint defined without port"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
4567
,
AdvertiseAddress
:
"4.5.6.7"
,
},
...
...
@@ -98,7 +98,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"use ControlPlaneEndpoint (ipv6) + BindPort if ControlPlaneEndpoint defined without port"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
4567
,
AdvertiseAddress
:
"4.5.6.7"
,
},
...
...
@@ -112,7 +112,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"use AdvertiseAddress (ipv4) + BindPort if ControlPlaneEndpoint is not defined"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
4567
,
AdvertiseAddress
:
"4.5.6.7"
,
},
...
...
@@ -122,7 +122,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"use AdvertiseAddress (ipv6) + BindPort if ControlPlaneEndpoint is not defined"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
4567
,
AdvertiseAddress
:
"2001:db8::1"
,
},
...
...
@@ -132,7 +132,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"fail if invalid BindPort"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
BindPort
:
0
,
},
},
...
...
@@ -177,7 +177,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"fail if invalid AdvertiseAddress (ip4)"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1..0"
,
BindPort
:
4567
,
},
...
...
@@ -187,7 +187,7 @@ func TestGetMasterEndpoint(t *testing.T) {
{
name
:
"fail if invalid AdvertiseAddress (ip6)"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1200::AB00:1234::2552:7777:1313"
,
BindPort
:
4567
,
},
...
...
cmd/kubeadm/app/util/pkiutil/pki_helpers_test.go
View file @
5656338b
...
...
@@ -446,7 +446,7 @@ func TestGetAPIServerAltNames(t *testing.T) {
{
name
:
"ControlPlaneEndpoint DNS"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
ControlPlaneEndpoint
:
"api.k8s.io:6443"
,
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"10.96.0.0/12"
,
DNSDomain
:
"cluster.local"
},
...
...
@@ -462,7 +462,7 @@ func TestGetAPIServerAltNames(t *testing.T) {
{
name
:
"ControlPlaneEndpoint IP"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
ControlPlaneEndpoint
:
"4.5.6.7:6443"
,
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"10.96.0.0/12"
,
DNSDomain
:
"cluster.local"
},
...
...
@@ -517,7 +517,7 @@ func TestGetEtcdAltNames(t *testing.T) {
proxy
:=
"user-etcd-proxy"
proxyIP
:=
"10.10.10.100"
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
},
NodeRegistration
:
kubeadmapi
.
NodeRegistrationOptions
{
...
...
@@ -579,7 +579,7 @@ func TestGetEtcdPeerAltNames(t *testing.T) {
proxyIP
:=
"10.10.10.100"
advertiseIP
:=
"1.2.3.4"
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
advertiseIP
},
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
advertiseIP
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
Etcd
:
kubeadmapi
.
Etcd
{
Local
:
&
kubeadmapi
.
LocalEtcd
{
...
...
cmd/kubeadm/app/util/staticpod/utils_test.go
View file @
5656338b
...
...
@@ -55,7 +55,7 @@ func TestComponentProbe(t *testing.T) {
{
name
:
"default apiserver advertise address with http"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
""
,
},
},
...
...
@@ -68,7 +68,7 @@ func TestComponentProbe(t *testing.T) {
{
name
:
"default apiserver advertise address with https"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
""
,
},
},
...
...
@@ -81,7 +81,7 @@ func TestComponentProbe(t *testing.T) {
{
name
:
"valid ipv4 apiserver advertise address with http"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
},
},
...
...
@@ -94,7 +94,7 @@ func TestComponentProbe(t *testing.T) {
{
name
:
"valid ipv6 apiserver advertise address with http"
,
cfg
:
&
kubeadmapi
.
InitConfiguration
{
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
Local
APIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"2001:db8::1"
,
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment