Skip to content

Commit

Permalink
feat: link get
Browse files Browse the repository at this point in the history
  • Loading branch information
siyul-park committed Oct 8, 2024
1 parent f192e7f commit af2af58
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion cmd/pkg/cli/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ func runApplyCommand(config ApplyConfig) func(cmd *cobra.Command, args []string)

return writer.Write(secrets)
}

return nil
}
}
1 change: 0 additions & 1 deletion cmd/pkg/cli/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func runDeleteCommand(config DeleteConfig) func(cmd *cobra.Command, args []strin
_, err := config.SecretStore.Delete(ctx, secrets...)
return err
}

return nil
}
}
18 changes: 10 additions & 8 deletions cmd/pkg/cli/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}

Expand All @@ -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
}
}

0 comments on commit af2af58

Please sign in to comment.