-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#6: Added support for fetching trusted CAs from clusters.
- Loading branch information
Showing
8 changed files
with
132 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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,32 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
"go.uber.org/zap" | ||
) | ||
|
||
var certificatesGetCaCmd = &cobra.Command{ | ||
Use: "get-ca", | ||
Short: "Fetches the CA certificate", | ||
Args: cobra.MinimumNArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
helper := CmdHelper{} | ||
logger := helper.GetLogger() | ||
ctx := helper.GetContext() | ||
|
||
_, deployer, cluster := helper.IdentifyCluster(ctx, args[0]) | ||
|
||
cert, err := deployer.GetCertificate(ctx, cluster.GetID()) | ||
if err != nil { | ||
logger.Fatal("failed to get certificate", zap.Error(err)) | ||
} | ||
|
||
fmt.Printf("%s\n", cert) | ||
}, | ||
} | ||
|
||
func init() { | ||
certificatesCmd.AddCommand(certificatesGetCaCmd) | ||
} |
This file contains 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,15 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var certificatesCmd = &cobra.Command{ | ||
Use: "certificates", | ||
Short: "Provides access to tools related to Couchbase Cloud certificates", | ||
Run: nil, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(certificatesCmd) | ||
} |
This file contains 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 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 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 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 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 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