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
1a9fd268
Unverified
Commit
1a9fd268
authored
Nov 14, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71005 from mikedanese/certpubfix
rootcacertpublisher: trigger resync on namespace add and update
parents
68fb529e
bf02f551
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
certificates.go
cmd/kube-controller-manager/app/certificates.go
+1
-0
publisher.go
pkg/controller/certificates/rootcacertpublisher/publisher.go
+9
-1
publisher_test.go
...roller/certificates/rootcacertpublisher/publisher_test.go
+2
-1
No files found.
cmd/kube-controller-manager/app/certificates.go
View file @
1a9fd268
...
@@ -143,6 +143,7 @@ func startRootCACertPublisher(ctx ControllerContext) (http.Handler, bool, error)
...
@@ -143,6 +143,7 @@ func startRootCACertPublisher(ctx ControllerContext) (http.Handler, bool, error)
sac
,
err
:=
rootcacertpublisher
.
NewPublisher
(
sac
,
err
:=
rootcacertpublisher
.
NewPublisher
(
ctx
.
InformerFactory
.
Core
()
.
V1
()
.
ConfigMaps
(),
ctx
.
InformerFactory
.
Core
()
.
V1
()
.
ConfigMaps
(),
ctx
.
InformerFactory
.
Core
()
.
V1
()
.
Namespaces
(),
ctx
.
ClientBuilder
.
ClientOrDie
(
"root-ca-cert-publisher"
),
ctx
.
ClientBuilder
.
ClientOrDie
(
"root-ca-cert-publisher"
),
rootCA
,
rootCA
,
)
)
...
...
pkg/controller/certificates/rootcacertpublisher/publisher.go
View file @
1a9fd268
...
@@ -43,7 +43,7 @@ const RootCACertConfigMapName = "kube-root-ca.crt"
...
@@ -43,7 +43,7 @@ const RootCACertConfigMapName = "kube-root-ca.crt"
// NewPublisher construct a new controller which would manage the configmap
// NewPublisher construct a new controller which would manage the configmap
// which stores certificates in each namespace. It will make sure certificate
// which stores certificates in each namespace. It will make sure certificate
// configmap exists in each namespace.
// configmap exists in each namespace.
func
NewPublisher
(
cmInformer
coreinformers
.
ConfigMapInformer
,
cl
clientset
.
Interface
,
rootCA
[]
byte
)
(
*
Publisher
,
error
)
{
func
NewPublisher
(
cmInformer
coreinformers
.
ConfigMapInformer
,
nsInformer
coreinformers
.
NamespaceInformer
,
cl
clientset
.
Interface
,
rootCA
[]
byte
)
(
*
Publisher
,
error
)
{
e
:=
&
Publisher
{
e
:=
&
Publisher
{
client
:
cl
,
client
:
cl
,
rootCA
:
rootCA
,
rootCA
:
rootCA
,
...
@@ -62,6 +62,12 @@ func NewPublisher(cmInformer coreinformers.ConfigMapInformer, cl clientset.Inter
...
@@ -62,6 +62,12 @@ func NewPublisher(cmInformer coreinformers.ConfigMapInformer, cl clientset.Inter
e
.
cmLister
=
cmInformer
.
Lister
()
e
.
cmLister
=
cmInformer
.
Lister
()
e
.
cmListerSynced
=
cmInformer
.
Informer
()
.
HasSynced
e
.
cmListerSynced
=
cmInformer
.
Informer
()
.
HasSynced
nsInformer
.
Informer
()
.
AddEventHandler
(
cache
.
ResourceEventHandlerFuncs
{
AddFunc
:
e
.
namespaceAdded
,
UpdateFunc
:
e
.
namespaceUpdated
,
})
e
.
nsListerSynced
=
nsInformer
.
Informer
()
.
HasSynced
e
.
syncHandler
=
e
.
syncNamespace
e
.
syncHandler
=
e
.
syncNamespace
return
e
,
nil
return
e
,
nil
...
@@ -79,6 +85,8 @@ type Publisher struct {
...
@@ -79,6 +85,8 @@ type Publisher struct {
cmLister
corelisters
.
ConfigMapLister
cmLister
corelisters
.
ConfigMapLister
cmListerSynced
cache
.
InformerSynced
cmListerSynced
cache
.
InformerSynced
nsListerSynced
cache
.
InformerSynced
queue
workqueue
.
RateLimitingInterface
queue
workqueue
.
RateLimitingInterface
}
}
...
...
pkg/controller/certificates/rootcacertpublisher/publisher_test.go
View file @
1a9fd268
...
@@ -120,7 +120,8 @@ func TestConfigMapCreation(t *testing.T) {
...
@@ -120,7 +120,8 @@ func TestConfigMapCreation(t *testing.T) {
client
:=
fake
.
NewSimpleClientset
(
caConfigMap
,
existNS
)
client
:=
fake
.
NewSimpleClientset
(
caConfigMap
,
existNS
)
informers
:=
informers
.
NewSharedInformerFactory
(
fake
.
NewSimpleClientset
(),
controller
.
NoResyncPeriodFunc
())
informers
:=
informers
.
NewSharedInformerFactory
(
fake
.
NewSimpleClientset
(),
controller
.
NoResyncPeriodFunc
())
cmInformer
:=
informers
.
Core
()
.
V1
()
.
ConfigMaps
()
cmInformer
:=
informers
.
Core
()
.
V1
()
.
ConfigMaps
()
controller
,
err
:=
NewPublisher
(
cmInformer
,
client
,
fakeRootCA
)
nsInformer
:=
informers
.
Core
()
.
V1
()
.
Namespaces
()
controller
,
err
:=
NewPublisher
(
cmInformer
,
nsInformer
,
client
,
fakeRootCA
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"error creating ServiceAccounts controller: %v"
,
err
)
t
.
Fatalf
(
"error creating ServiceAccounts controller: %v"
,
err
)
}
}
...
...
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