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
fb3d1caf
Commit
fb3d1caf
authored
Nov 09, 2018
by
WanLinghao
Committed by
Mike Danese
Nov 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a typo error imported by
https://github.com/kubernetes/kubernetes/pull/68812
parent
bfb95290
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
publisher.go
pkg/controller/certificates/rootcacertpublisher/publisher.go
+7
-7
publisher_test.go
...roller/certificates/rootcacertpublisher/publisher_test.go
+5
-5
No files found.
pkg/controller/certificates/rootcacertpublisher/publisher.go
View file @
fb3d1caf
...
...
@@ -36,9 +36,9 @@ import (
"k8s.io/kubernetes/pkg/util/metrics"
)
// RootCACertCo
figMapName is name of the configmap which stores certificates to
// access api-server
const
RootCACertCofigMapName
=
"kube-root-ca.crt"
// RootCACertCo
nfigMapName is name of the configmap which stores certificates
//
to
access api-server
const
RootCACertCo
n
figMapName
=
"kube-root-ca.crt"
// NewPublisher construct a new controller which would manage the configmap
// which stores certificates in each namespace. It will make sure certificate
...
...
@@ -107,7 +107,7 @@ func (c *Publisher) configMapDeleted(obj interface{}) {
utilruntime
.
HandleError
(
err
)
return
}
if
cm
.
Name
!=
RootCACertCofigMapName
{
if
cm
.
Name
!=
RootCACertCo
n
figMapName
{
return
}
c
.
queue
.
Add
(
cm
.
Namespace
)
...
...
@@ -119,7 +119,7 @@ func (c *Publisher) configMapUpdated(_, newObj interface{}) {
utilruntime
.
HandleError
(
err
)
return
}
if
cm
.
Name
!=
RootCACertCofigMapName
{
if
cm
.
Name
!=
RootCACertCo
n
figMapName
{
return
}
c
.
queue
.
Add
(
cm
.
Namespace
)
...
...
@@ -168,12 +168,12 @@ func (c *Publisher) syncNamespace(ns string) error {
klog
.
V
(
4
)
.
Infof
(
"Finished syncing namespace %q (%v)"
,
ns
,
time
.
Since
(
startTime
))
}()
cm
,
err
:=
c
.
cmLister
.
ConfigMaps
(
ns
)
.
Get
(
RootCACertCofigMapName
)
cm
,
err
:=
c
.
cmLister
.
ConfigMaps
(
ns
)
.
Get
(
RootCACertCo
n
figMapName
)
switch
{
case
apierrs
.
IsNotFound
(
err
)
:
_
,
err
:=
c
.
client
.
CoreV1
()
.
ConfigMaps
(
ns
)
.
Create
(
&
v1
.
ConfigMap
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
RootCACertCofigMapName
,
Name
:
RootCACertCo
n
figMapName
,
},
Data
:
map
[
string
]
string
{
"ca.crt"
:
string
(
c
.
rootCA
),
...
...
pkg/controller/certificates/rootcacertpublisher/publisher_test.go
View file @
fb3d1caf
...
...
@@ -85,7 +85,7 @@ func TestConfigMapCreation(t *testing.T) {
}{
"create new namesapce"
:
{
AddedNamespace
:
newNs
,
ExpectActions
:
[]
action
{{
verb
:
"create"
,
name
:
RootCACertCofigMapName
}},
ExpectActions
:
[]
action
{{
verb
:
"create"
,
name
:
RootCACertCo
n
figMapName
}},
},
"delete other configmap"
:
{
ExistingConfigMaps
:
[]
*
v1
.
ConfigMap
{
otherConfigMap
,
caConfigMap
},
...
...
@@ -94,17 +94,17 @@ func TestConfigMapCreation(t *testing.T) {
"delete ca configmap"
:
{
ExistingConfigMaps
:
[]
*
v1
.
ConfigMap
{
otherConfigMap
,
caConfigMap
},
DeletedConfigMap
:
caConfigMap
,
ExpectActions
:
[]
action
{{
verb
:
"create"
,
name
:
RootCACertCofigMapName
}},
ExpectActions
:
[]
action
{{
verb
:
"create"
,
name
:
RootCACertCo
n
figMapName
}},
},
"update ca configmap with adding field"
:
{
ExistingConfigMaps
:
[]
*
v1
.
ConfigMap
{
caConfigMap
},
UpdatedConfigMap
:
addFieldCM
,
ExpectActions
:
[]
action
{{
verb
:
"update"
,
name
:
RootCACertCofigMapName
}},
ExpectActions
:
[]
action
{{
verb
:
"update"
,
name
:
RootCACertCo
n
figMapName
}},
},
"update ca configmap with modifying field"
:
{
ExistingConfigMaps
:
[]
*
v1
.
ConfigMap
{
caConfigMap
},
UpdatedConfigMap
:
modifyFieldCM
,
ExpectActions
:
[]
action
{{
verb
:
"update"
,
name
:
RootCACertCofigMapName
}},
ExpectActions
:
[]
action
{{
verb
:
"update"
,
name
:
RootCACertCo
n
figMapName
}},
},
"update with other configmap"
:
{
ExistingConfigMaps
:
[]
*
v1
.
ConfigMap
{
caConfigMap
,
otherConfigMap
},
...
...
@@ -165,7 +165,7 @@ func TestConfigMapCreation(t *testing.T) {
func
defaultCrtConfigMapPtr
(
rootCA
[]
byte
)
*
v1
.
ConfigMap
{
tmp
:=
v1
.
ConfigMap
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
RootCACertCofigMapName
,
Name
:
RootCACertCo
n
figMapName
,
},
Data
:
map
[
string
]
string
{
"ca.crt"
:
string
(
rootCA
),
...
...
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