-
Notifications
You must be signed in to change notification settings - Fork 202
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
Changes for cli command to renew certificate #912
Changes for cli command to renew certificate #912
Conversation
a650191
to
dc38140
Compare
cmd/renew_certificate.go
Outdated
Short: "Rotates Dapr root certificate of your kubernetes cluster", | ||
Example: ` | ||
# Generates new root and issuer certificates for kubernetest cluster | ||
dapr mtls renew-cert -k --valid-until <no of days> --restart true |
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.
Other mtls commands don't seem to support the -k
flag. Is that expected?
dapr mtls expiry -k
Error: unknown shorthand flag: 'k' in -k
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.
this is expected in case we want to enhance it for standalone.
export
and expiry
does not make much sense for standalone mode imo.
In general, I think it should be with the specific subcommands whether -k flag is needed or not.
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.
If mtls
only supports k8s, then the subcommands should also enforce it ideally. Instead of silently failing, we should complain that it's a required flag and only k8s mode is supported. This can be tracked separately, but I think we should do it. Thoughts?
/cc @mukundansundar
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.
I will be adding RenewCertificateCmd.MarkFlagRequired("kubernetes")
in new commit.
We can enforce this flag through all subcommands but it will change the current behavior from dapr mtls expiry
to of dapr mts expiry -k
@mukundansundar
Codecov Report
@@ Coverage Diff @@
## master #912 +/- ##
==========================================
- Coverage 22.31% 20.90% -1.42%
==========================================
Files 30 32 +2
Lines 1734 1851 +117
==========================================
Hits 387 387
- Misses 1293 1410 +117
Partials 54 54
Continue to review full report at Codecov.
|
fe1220a
to
6695f1e
Compare
82feed2
to
e802685
Compare
4045818
to
97ac56f
Compare
97ac56f
to
920549d
Compare
8802c82
to
9be44d0
Compare
28971de
to
4a1fdcf
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.
few more changes please ...
logErrorAndExit(err) | ||
} | ||
} else if privateKey != "" { | ||
print.InfoStatusEvent(os.Stdout, "Using password file to generate root certificate") |
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.
print.InfoStatusEvent(os.Stdout, "Using password file to generate root certificate") | |
print.InfoStatusEvent(os.Stdout, "Using existing private key file to generate root certificate") |
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.
This change needs to be done?
assert.Contains(t, output, "Certificate rotation is successful!") | ||
|
||
// remove cert directory created earlier. | ||
os.RemoveAll("./certs") |
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.
not like to have a folder created by one test removed by another .... can this be in the Kubernetes_test.go file instead of common ?
A single flow ...
- create a folder
./certs
- Run GenerateNewCerts -- export cert to the previously created folder
- Run the UserProvidedNewCertsAndRenew test ....
- Remove the ./certs folder that was created in step 1
1 and 4 in the Test function ... and the rest can be what it is now ...
@yaron2 @artursouza Don't we also need to restart sidecar-injector and dashboard as part of certificate rotation ? |
Sentry watches certs from the filesystem. |
During release validations during endgame ... test this against a cluster running apps and validate working. |
@pravinpushkar Wait for all containers to be up needs to be added in this PR. |
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
0fbccbd
to
038f841
Compare
Signed-off-by: Pravin Pushkar ppushkar@microsoft.com
Description
Adding new commands to renew expiring certificate.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #892
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: