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
1181a88c
Commit
1181a88c
authored
Oct 23, 2017
by
Mike Danese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
certs: remove always nil error from New signature
parent
1213f911
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
19 deletions
+7
-19
gke_certificates_controller.go
...ertificates-controller/app/gke_certificates_controller.go
+1
-4
certificates.go
cmd/kube-controller-manager/app/certificates.go
+1
-7
sarapprove.go
pkg/controller/certificates/approver/sarapprove.go
+1
-1
certificate_controller.go
pkg/controller/certificates/certificate_controller.go
+2
-2
certificate_controller_test.go
pkg/controller/certificates/certificate_controller_test.go
+1
-4
cfssl_signer.go
pkg/controller/certificates/signer/cfssl_signer.go
+1
-1
No files found.
cmd/gke-certificates-controller/app/gke_certificates_controller.go
View file @
1181a88c
...
@@ -77,14 +77,11 @@ func Run(s *GKECertificatesController) error {
...
@@ -77,14 +77,11 @@ func Run(s *GKECertificatesController) error {
return
err
return
err
}
}
controller
,
err
:=
certificates
.
NewCertificateController
(
controller
:=
certificates
.
NewCertificateController
(
client
,
client
,
sharedInformers
.
Certificates
()
.
V1beta1
()
.
CertificateSigningRequests
(),
sharedInformers
.
Certificates
()
.
V1beta1
()
.
CertificateSigningRequests
(),
signer
.
handle
,
signer
.
handle
,
)
)
if
err
!=
nil
{
return
err
}
sharedInformers
.
Start
(
nil
)
sharedInformers
.
Start
(
nil
)
controller
.
Run
(
5
,
nil
)
// runs forever
controller
.
Run
(
5
,
nil
)
// runs forever
...
...
cmd/kube-controller-manager/app/certificates.go
View file @
1181a88c
...
@@ -59,16 +59,10 @@ func startCSRApprovingController(ctx ControllerContext) (bool, error) {
...
@@ -59,16 +59,10 @@ func startCSRApprovingController(ctx ControllerContext) (bool, error) {
return
false
,
nil
return
false
,
nil
}
}
approver
,
err
:=
approver
.
NewCSRApprovingController
(
approver
:=
approver
.
NewCSRApprovingController
(
ctx
.
ClientBuilder
.
ClientOrDie
(
"certificate-controller"
),
ctx
.
ClientBuilder
.
ClientOrDie
(
"certificate-controller"
),
ctx
.
InformerFactory
.
Certificates
()
.
V1beta1
()
.
CertificateSigningRequests
(),
ctx
.
InformerFactory
.
Certificates
()
.
V1beta1
()
.
CertificateSigningRequests
(),
)
)
if
err
!=
nil
{
// TODO this is failing consistently in test-cmd and local-up-cluster.sh. Fix them and make it consistent with all others which
// cause a crash loop
glog
.
Errorf
(
"Failed to start certificate controller: %v"
,
err
)
return
false
,
nil
}
go
approver
.
Run
(
1
,
ctx
.
Stop
)
go
approver
.
Run
(
1
,
ctx
.
Stop
)
return
true
,
nil
return
true
,
nil
...
...
pkg/controller/certificates/approver/sarapprove.go
View file @
1181a88c
...
@@ -44,7 +44,7 @@ type sarApprover struct {
...
@@ -44,7 +44,7 @@ type sarApprover struct {
recognizers
[]
csrRecognizer
recognizers
[]
csrRecognizer
}
}
func
NewCSRApprovingController
(
client
clientset
.
Interface
,
csrInformer
certificatesinformers
.
CertificateSigningRequestInformer
)
(
*
certificates
.
CertificateController
,
error
)
{
func
NewCSRApprovingController
(
client
clientset
.
Interface
,
csrInformer
certificatesinformers
.
CertificateSigningRequestInformer
)
*
certificates
.
CertificateController
{
approver
:=
&
sarApprover
{
approver
:=
&
sarApprover
{
client
:
client
,
client
:
client
,
recognizers
:
recognizers
(),
recognizers
:
recognizers
(),
...
...
pkg/controller/certificates/certificate_controller.go
View file @
1181a88c
...
@@ -53,7 +53,7 @@ func NewCertificateController(
...
@@ -53,7 +53,7 @@ func NewCertificateController(
kubeClient
clientset
.
Interface
,
kubeClient
clientset
.
Interface
,
csrInformer
certificatesinformers
.
CertificateSigningRequestInformer
,
csrInformer
certificatesinformers
.
CertificateSigningRequestInformer
,
handler
func
(
*
certificates
.
CertificateSigningRequest
)
error
,
handler
func
(
*
certificates
.
CertificateSigningRequest
)
error
,
)
(
*
CertificateController
,
error
)
{
)
*
CertificateController
{
// Send events to the apiserver
// Send events to the apiserver
eventBroadcaster
:=
record
.
NewBroadcaster
()
eventBroadcaster
:=
record
.
NewBroadcaster
()
eventBroadcaster
.
StartLogging
(
glog
.
Infof
)
eventBroadcaster
.
StartLogging
(
glog
.
Infof
)
...
@@ -98,7 +98,7 @@ func NewCertificateController(
...
@@ -98,7 +98,7 @@ func NewCertificateController(
cc
.
csrLister
=
csrInformer
.
Lister
()
cc
.
csrLister
=
csrInformer
.
Lister
()
cc
.
csrsSynced
=
csrInformer
.
Informer
()
.
HasSynced
cc
.
csrsSynced
=
csrInformer
.
Informer
()
.
HasSynced
cc
.
handler
=
handler
cc
.
handler
=
handler
return
cc
,
nil
return
cc
}
}
// Run the main goroutine responsible for watching and syncing jobs.
// Run the main goroutine responsible for watching and syncing jobs.
...
...
pkg/controller/certificates/certificate_controller_test.go
View file @
1181a88c
...
@@ -54,14 +54,11 @@ func TestCertificateController(t *testing.T) {
...
@@ -54,14 +54,11 @@ func TestCertificateController(t *testing.T) {
return
nil
return
nil
}
}
controller
,
err
:=
NewCertificateController
(
controller
:=
NewCertificateController
(
client
,
client
,
informerFactory
.
Certificates
()
.
V1beta1
()
.
CertificateSigningRequests
(),
informerFactory
.
Certificates
()
.
V1beta1
()
.
CertificateSigningRequests
(),
handler
,
handler
,
)
)
if
err
!=
nil
{
t
.
Fatalf
(
"error creating controller: %v"
,
err
)
}
controller
.
csrsSynced
=
func
()
bool
{
return
true
}
controller
.
csrsSynced
=
func
()
bool
{
return
true
}
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
...
...
pkg/controller/certificates/signer/cfssl_signer.go
View file @
1181a88c
...
@@ -50,7 +50,7 @@ func NewCSRSigningController(
...
@@ -50,7 +50,7 @@ func NewCSRSigningController(
client
,
client
,
csrInformer
,
csrInformer
,
signer
.
handle
,
signer
.
handle
,
)
)
,
nil
}
}
type
cfsslSigner
struct
{
type
cfsslSigner
struct
{
...
...
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