diff --git a/cmd/pkg/cli/apply.go b/cmd/pkg/cli/apply.go index 304840b1..9f88d54d 100644 --- a/cmd/pkg/cli/apply.go +++ b/cmd/pkg/cli/apply.go @@ -166,7 +166,6 @@ func runApplyCommand(config ApplyConfig) func(cmd *cobra.Command, args []string) return writer.Write(secrets) } - return nil } } diff --git a/cmd/pkg/cli/delete.go b/cmd/pkg/cli/delete.go index 6f598aee..068257c2 100644 --- a/cmd/pkg/cli/delete.go +++ b/cmd/pkg/cli/delete.go @@ -99,7 +99,6 @@ func runDeleteCommand(config DeleteConfig) func(cmd *cobra.Command, args []strin _, err := config.SecretStore.Delete(ctx, secrets...) return err } - return nil } } diff --git a/cmd/pkg/cli/get.go b/cmd/pkg/cli/get.go index 77ef7719..13f43a49 100644 --- a/cmd/pkg/cli/get.go +++ b/cmd/pkg/cli/get.go @@ -22,7 +22,7 @@ func NewGetCommand(config GetConfig) *cobra.Command { Use: "get", Short: "Get resources from the specified namespace", Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs), - ValidArgs: []string{argNodes, argSecrets}, + ValidArgs: []string{argCharts, argNodes, argSecrets}, RunE: runGetCommand(config), } @@ -43,26 +43,28 @@ func runGetCommand(config GetConfig) func(cmd *cobra.Command, args []string) err writer := resource.NewWriter(cmd.OutOrStdout()) switch args[0] { + case argCharts: + charts, err := config.ChartStore.Load(ctx, &chart.Chart{Namespace: namespace}) + if err != nil { + return err + } + + return writer.Write(charts) case argNodes: - specs, err := config.SpecStore.Load(ctx, &spec.Meta{ - Namespace: namespace, - }) + specs, err := config.SpecStore.Load(ctx, &spec.Meta{Namespace: namespace}) if err != nil { return err } return writer.Write(specs) case argSecrets: - secrets, err := config.SecretStore.Load(ctx, &secret.Secret{ - Namespace: namespace, - }) + secrets, err := config.SecretStore.Load(ctx, &secret.Secret{Namespace: namespace}) if err != nil { return err } return writer.Write(secrets) } - return nil } }