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
7edea2b7
Commit
7edea2b7
authored
Feb 13, 2019
by
SataQiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubeadm cleanup: master -> control-plane
parent
5c780c8c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
certs.go
cmd/kubeadm/app/phases/certs/certs.go
+1
-1
local_test.go
cmd/kubeadm/app/phases/etcd/local_test.go
+1
-1
doc.go
cmd/kubeadm/app/phases/kubeconfig/doc.go
+1
-1
kubeconfig_test.go
cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go
+5
-5
No files found.
cmd/kubeadm/app/phases/certs/certs.go
View file @
7edea2b7
...
@@ -328,7 +328,7 @@ type certKeyLocation struct {
...
@@ -328,7 +328,7 @@ type certKeyLocation struct {
}
}
// SharedCertificateExists verifies if the shared certificates - the certificates that must be
// SharedCertificateExists verifies if the shared certificates - the certificates that must be
// equal across
master
s: ca.key, ca.crt, sa.key, sa.pub + etcd/ca.key, etcd/ca.crt if local/stacked etcd
// equal across
control-plane node
s: ca.key, ca.crt, sa.key, sa.pub + etcd/ca.key, etcd/ca.crt if local/stacked etcd
func
SharedCertificateExists
(
cfg
*
kubeadmapi
.
ClusterConfiguration
)
(
bool
,
error
)
{
func
SharedCertificateExists
(
cfg
*
kubeadmapi
.
ClusterConfiguration
)
(
bool
,
error
)
{
if
err
:=
validateCACertAndKey
(
certKeyLocation
{
cfg
.
CertificatesDir
,
kubeadmconstants
.
CACertAndKeyBaseName
,
""
,
"CA"
});
err
!=
nil
{
if
err
:=
validateCACertAndKey
(
certKeyLocation
{
cfg
.
CertificatesDir
,
kubeadmconstants
.
CACertAndKeyBaseName
,
""
,
"CA"
});
err
!=
nil
{
...
...
cmd/kubeadm/app/phases/etcd/local_test.go
View file @
7edea2b7
...
@@ -31,7 +31,7 @@ import (
...
@@ -31,7 +31,7 @@ import (
)
)
func
TestGetEtcdPodSpec
(
t
*
testing
.
T
)
{
func
TestGetEtcdPodSpec
(
t
*
testing
.
T
)
{
// Creates a
Master
Configuration
// Creates a
Cluster
Configuration
cfg
:=
&
kubeadmapi
.
ClusterConfiguration
{
cfg
:=
&
kubeadmapi
.
ClusterConfiguration
{
KubernetesVersion
:
"v1.7.0"
,
KubernetesVersion
:
"v1.7.0"
,
Etcd
:
kubeadmapi
.
Etcd
{
Etcd
:
kubeadmapi
.
Etcd
{
...
...
cmd/kubeadm/app/phases/kubeconfig/doc.go
View file @
7edea2b7
...
@@ -22,7 +22,7 @@ package kubeconfig
...
@@ -22,7 +22,7 @@ package kubeconfig
INPUTS:
INPUTS:
From InitConfiguration
From InitConfiguration
The
Master API Server endpoint (AdvertiseAddress + BindPort) is required so the kubeconfig file knows where to find the master
The
API Server endpoint (AdvertiseAddress + BindPort) is required so the kubeconfig file knows where to find the control-plane
The KubernetesDir path is required for knowing where to put the kubeconfig files
The KubernetesDir path is required for knowing where to put the kubeconfig files
The PKIPath is required for knowing where all certificates should be stored
The PKIPath is required for knowing where all certificates should be stored
...
...
cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go
View file @
7edea2b7
...
@@ -45,7 +45,7 @@ func TestGetKubeConfigSpecsFailsIfCADoesntExists(t *testing.T) {
...
@@ -45,7 +45,7 @@ func TestGetKubeConfigSpecsFailsIfCADoesntExists(t *testing.T) {
tmpdir
:=
testutil
.
SetupTempDir
(
t
)
tmpdir
:=
testutil
.
SetupTempDir
(
t
)
defer
os
.
RemoveAll
(
tmpdir
)
defer
os
.
RemoveAll
(
tmpdir
)
// Creates a
Master
Configuration pointing to the pkidir folder
// Creates a
n Init
Configuration pointing to the pkidir folder
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
CertificatesDir
:
tmpdir
,
CertificatesDir
:
tmpdir
,
...
@@ -66,7 +66,7 @@ func TestGetKubeConfigSpecs(t *testing.T) {
...
@@ -66,7 +66,7 @@ func TestGetKubeConfigSpecs(t *testing.T) {
// Adds a pki folder with a ca certs to the temp folder
// Adds a pki folder with a ca certs to the temp folder
pkidir
:=
testutil
.
SetupPkiDirWithCertificateAuthorithy
(
t
,
tmpdir
)
pkidir
:=
testutil
.
SetupPkiDirWithCertificateAuthorithy
(
t
,
tmpdir
)
// Creates
Master
Configurations pointing to the pkidir folder
// Creates
Init
Configurations pointing to the pkidir folder
cfgs
:=
[]
*
kubeadmapi
.
InitConfiguration
{
cfgs
:=
[]
*
kubeadmapi
.
InitConfiguration
{
{
{
LocalAPIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
LocalAPIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
...
@@ -305,7 +305,7 @@ func TestCreateKubeconfigFilesAndWrappers(t *testing.T) {
...
@@ -305,7 +305,7 @@ func TestCreateKubeconfigFilesAndWrappers(t *testing.T) {
// Adds a pki folder with a ca certs to the temp folder
// Adds a pki folder with a ca certs to the temp folder
pkidir
:=
testutil
.
SetupPkiDirWithCertificateAuthorithy
(
t
,
tmpdir
)
pkidir
:=
testutil
.
SetupPkiDirWithCertificateAuthorithy
(
t
,
tmpdir
)
// Creates a
Master
Configuration pointing to the pkidir folder
// Creates a
n Init
Configuration pointing to the pkidir folder
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
LocalAPIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
LocalAPIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
...
@@ -335,7 +335,7 @@ func TestWriteKubeConfigFailsIfCADoesntExists(t *testing.T) {
...
@@ -335,7 +335,7 @@ func TestWriteKubeConfigFailsIfCADoesntExists(t *testing.T) {
tmpdir
:=
testutil
.
SetupTempDir
(
t
)
tmpdir
:=
testutil
.
SetupTempDir
(
t
)
defer
os
.
RemoveAll
(
tmpdir
)
defer
os
.
RemoveAll
(
tmpdir
)
// Creates a
Master
Configuration pointing to the tmpdir folder
// Creates a
n Init
Configuration pointing to the tmpdir folder
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
CertificatesDir
:
tmpdir
,
CertificatesDir
:
tmpdir
,
...
@@ -382,7 +382,7 @@ func TestWriteKubeConfig(t *testing.T) {
...
@@ -382,7 +382,7 @@ func TestWriteKubeConfig(t *testing.T) {
t
.
Fatalf
(
"couldn't retrieve ca cert: %v"
,
err
)
t
.
Fatalf
(
"couldn't retrieve ca cert: %v"
,
err
)
}
}
// Creates a
Master
Configuration pointing to the pkidir folder
// Creates a
n Init
Configuration pointing to the pkidir folder
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
cfg
:=
&
kubeadmapi
.
InitConfiguration
{
LocalAPIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
LocalAPIEndpoint
:
kubeadmapi
.
APIEndpoint
{
AdvertiseAddress
:
"1.2.3.4"
,
BindPort
:
1234
},
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
ClusterConfiguration
:
kubeadmapi
.
ClusterConfiguration
{
...
...
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