|
@@ -68,6 +68,18 @@ var connectRegistryCmd = &cobra.Command{
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+var connectHelmRepoCmd = &cobra.Command{
|
|
|
|
|
+ Use: "helm",
|
|
|
|
|
+ Short: "Adds a custom Helm registry to a project",
|
|
|
|
|
+ Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
|
+ err := checkLoginAndRun(args, runConnectHelmRepo)
|
|
|
|
|
+
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ os.Exit(1)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
var connectGCRCmd = &cobra.Command{
|
|
var connectGCRCmd = &cobra.Command{
|
|
|
Use: "gcr",
|
|
Use: "gcr",
|
|
|
Short: "Adds a GCR instance to a project",
|
|
Short: "Adds a GCR instance to a project",
|
|
@@ -116,6 +128,7 @@ func init() {
|
|
|
connectCmd.AddCommand(connectDockerhubCmd)
|
|
connectCmd.AddCommand(connectDockerhubCmd)
|
|
|
connectCmd.AddCommand(connectGCRCmd)
|
|
connectCmd.AddCommand(connectGCRCmd)
|
|
|
connectCmd.AddCommand(connectDOCRCmd)
|
|
connectCmd.AddCommand(connectDOCRCmd)
|
|
|
|
|
+ connectCmd.AddCommand(connectHelmRepoCmd)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func runConnectKubeconfig(_ *types.GetAuthenticatedUserResponse, client *api.Client, _ []string) error {
|
|
func runConnectKubeconfig(_ *types.GetAuthenticatedUserResponse, client *api.Client, _ []string) error {
|
|
@@ -204,3 +217,16 @@ func runConnectRegistry(_ *types.GetAuthenticatedUserResponse, client *api.Clien
|
|
|
|
|
|
|
|
return config.SetRegistry(regID)
|
|
return config.SetRegistry(regID)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+func runConnectHelmRepo(_ *types.GetAuthenticatedUserResponse, client *api.Client, _ []string) error {
|
|
|
|
|
+ hrID, err := connect.HelmRepo(
|
|
|
|
|
+ client,
|
|
|
|
|
+ config.Project,
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ return err
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return config.SetHelmRepo(hrID)
|
|
|
|
|
+}
|