-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow "runtime-only" configuration without default issuer #395
feat: allow "runtime-only" configuration without default issuer #395
Conversation
a445350
to
7dc33f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One little comment - what do you think? It's not absolutely required!
pkg/certmanager/certmanager.go
Outdated
// IssuerChangeSubscription is a subscription that can be used to get changes | ||
// to issuer config | ||
type IssuerChangeSubscription struct { | ||
C <-chan *cmmeta.ObjectReference | ||
|
||
// The same channel as above is mirrored in c, but without the "<-" | ||
// restriction. This allows the channel to be written to by this package. | ||
c chan *cmmeta.ObjectReference | ||
|
||
lock sync.Mutex | ||
closed bool | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: I'm a bit squeamish about having two variables with the same name differing only in casing - I personally find that pretty hard to keep in my head.
I like C
for the exported one, but maybe something like sendCh
, internalCh
or something else instead of c
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to sendChannel
pkg/istiodcert/worker.go
Outdated
@@ -57,7 +57,7 @@ type DynamicIstiodCertProvisioner struct { | |||
|
|||
issuerRefMutex sync.Mutex | |||
|
|||
issuerChangeChan <-chan *cmmeta.ObjectReference | |||
issuerChangeChan *certmanager.IssuerChangeSubscription |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (non-blocking): maybe rename because this isn't a channel any more?
issuerChangeChan *certmanager.IssuerChangeSubscription | |
issuerChangeSub *certmanager.IssuerChangeSubscription |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense - updated
Signed-off-by: Adam Talbot <adam.talbot@venafi.com>
7dc33f8
to
3cf2311
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
Cheers! 🚀
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SgtCoDFish The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
Helm
app.certmanager.issuer.enabled
to disable "default" non runtime issuer.app.go
options.go
--issuer-enabled
flag to disable "default" non runtime issuer. By setting this to false you can start istio-csr up and have it idle waiting for runtime config (while being ready).certmanager.go
Updated the runtime config watcher to prune subscriptions that are not in use. Functions like
WaitForIssuerConfig
only need a single channel event then stopped monitoring it. The addition of the ability to "close" the subscription means these functions can "unsubscribe".Moved
WaitForIssuerConfig
into the manager, it makes sense in my mind for it to be there so multiple things can call it if needed.configmap.go / tls.go
tls.Interface.RootCAs
was blocking, this meant that if you had no "default" issuer config and the runtime config was not yet configured then the configmap controller Reconcile would block forever and delay graceful shutdown. The new implementation ofRootCAs
accepts a context so the controller can shut down gracefully.