This repository was archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 274
Support for root certificate rotation via CLI #5207
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
412b39c
Add Osm cli for rotation
jsturtevant 1e173b3
address to feedback
jsturtevant 7b506ea
Fix missing err assign
jsturtevant abbcdb2
Add check for mrc feature flag
jsturtevant 7034646
use correct vault key
jsturtevant ccce51d
fix bug in cli
jsturtevant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
const alphaDescription = ` | ||
This command consists of multiple subcommands related that are in alpha. | ||
` | ||
|
||
func newAlphaCmd(out io.Writer) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "alpha", | ||
Short: "commands that are in alpha", | ||
Long: alphaDescription, | ||
Args: cobra.NoArgs, | ||
PersistentPreRun: func(cmd *cobra.Command, args []string) { | ||
fmt.Fprintf(out, "*** This command is in Preview. Only run in dev/test environments ***\n") | ||
}, | ||
} | ||
cmd.AddCommand(newCertificateCmd(out)) | ||
return cmd | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package main | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
const certificateDescription = ` | ||
This command consists of multiple subcommands related to managing certificates | ||
associated with osm installations. | ||
` | ||
|
||
func newCertificateCmd(out io.Writer) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "certificate", | ||
Short: "commands for managing MeshRootCertificates", | ||
Aliases: []string{"mrc"}, | ||
Long: certificateDescription, | ||
Args: cobra.NoArgs, | ||
} | ||
cmd.AddCommand(newCertificateRotateCmd(out)) | ||
return cmd | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we have any other OSM CLI commands that we would characterize as "alpha" or could "preview" just be added in a warning for the command's help and output?
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.
good question, I am up for either and easy change to make. I modeled it after
kubectl alpha
which I like because it is very clear that is experimental when using it.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 like this approach, but I am curious to see what other maintainers think.