Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Rke
Commits
32e10710
Commit
32e10710
authored
6 years ago
by
galal-hussein
Committed by
Craig Jellick
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Handle missing service account token key when fetching certs from nodes
parent
9fccbfa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cluster/certificates.go
+6
-0
cluster/certificates.go
with
6 additions
and
0 deletions
+6
-0
cluster/certificates.go
+
6
-
0
View file @
32e10710
...
...
@@ -212,6 +212,12 @@ func GetClusterCertsFromNodes(ctx context.Context, kubeCluster *Cluster) (map[st
for
_
,
host
:=
range
backupHosts
{
certificates
,
err
=
pki
.
FetchCertificatesFromHost
(
ctx
,
kubeCluster
.
EtcdHosts
,
host
,
kubeCluster
.
SystemImages
.
Alpine
,
kubeCluster
.
LocalKubeConfigPath
,
kubeCluster
.
PrivateRegistriesMap
)
if
certificates
!=
nil
{
// Handle service account token key issue
kubeAPICert
:=
certificates
[
pki
.
KubeAPICertName
]
if
certificates
[
pki
.
ServiceAccountTokenKeyName
]
.
Key
==
nil
{
log
.
Infof
(
ctx
,
"[certificates] Creating service account token key"
)
certificates
[
pki
.
ServiceAccountTokenKeyName
]
=
pki
.
ToCertObject
(
pki
.
ServiceAccountTokenKeyName
,
pki
.
ServiceAccountTokenKeyName
,
""
,
kubeAPICert
.
Certificate
,
kubeAPICert
.
Key
,
nil
)
}
return
certificates
,
nil
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help