Add support for getting resources by name
- add singular alias to get commands - allow filtering the get commands result by resource name - add the image commands to mkdocs index Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
@@ -90,6 +90,11 @@ func (get getCommand) run(cmd *cobra.Command, args []string) error {
|
||||
if !getArgs.allNamespaces {
|
||||
listOpts = append(listOpts, client.InNamespace(rootArgs.namespace))
|
||||
}
|
||||
|
||||
if len(args) > 0 {
|
||||
listOpts = append(listOpts, client.MatchingFields{"metadata.name": args[0]})
|
||||
}
|
||||
|
||||
err = kubeClient.List(ctx, get.list.asClientList(), listOpts...)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -33,9 +33,10 @@ import (
|
||||
)
|
||||
|
||||
var getAlertCmd = &cobra.Command{
|
||||
Use: "alerts",
|
||||
Short: "Get Alert statuses",
|
||||
Long: "The get alert command prints the statuses of the resources.",
|
||||
Use: "alerts",
|
||||
Aliases: []string{"alert"},
|
||||
Short: "Get Alert statuses",
|
||||
Long: "The get alert command prints the statuses of the resources.",
|
||||
Example: ` # List all Alerts and their status
|
||||
flux get alerts
|
||||
`,
|
||||
|
||||
@@ -31,9 +31,10 @@ import (
|
||||
)
|
||||
|
||||
var getAlertProviderCmd = &cobra.Command{
|
||||
Use: "alert-providers",
|
||||
Short: "Get Provider statuses",
|
||||
Long: "The get alert-provider command prints the statuses of the resources.",
|
||||
Use: "alert-providers",
|
||||
Aliases: []string{"alert-provider"},
|
||||
Short: "Get Provider statuses",
|
||||
Long: "The get alert-provider command prints the statuses of the resources.",
|
||||
Example: ` # List all Providers and their status
|
||||
flux get alert-providers
|
||||
`,
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
|
||||
var getHelmReleaseCmd = &cobra.Command{
|
||||
Use: "helmreleases",
|
||||
Aliases: []string{"hr"},
|
||||
Aliases: []string{"hr", "helmrelease"},
|
||||
Short: "Get HelmRelease statuses",
|
||||
Long: "The get helmreleases command prints the statuses of the resources.",
|
||||
Example: ` # List all Helm releases and their status
|
||||
|
||||
@@ -21,9 +21,10 @@ import (
|
||||
)
|
||||
|
||||
var getImageCmd = &cobra.Command{
|
||||
Use: "image",
|
||||
Short: "Get image automation object status",
|
||||
Long: "The get image sub-commands print the status of image automation objects.",
|
||||
Use: "images",
|
||||
Aliases: []string{"image"},
|
||||
Short: "Get image automation object status",
|
||||
Long: "The get image sub-commands print the status of image automation objects.",
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
|
||||
var getKsCmd = &cobra.Command{
|
||||
Use: "kustomizations",
|
||||
Aliases: []string{"ks"},
|
||||
Aliases: []string{"ks", "kustomization"},
|
||||
Short: "Get Kustomization statuses",
|
||||
Long: "The get kustomizations command prints the statuses of the resources.",
|
||||
Example: ` # List all kustomizations and their status
|
||||
|
||||
@@ -33,9 +33,10 @@ import (
|
||||
)
|
||||
|
||||
var getReceiverCmd = &cobra.Command{
|
||||
Use: "receivers",
|
||||
Short: "Get Receiver statuses",
|
||||
Long: "The get receiver command prints the statuses of the resources.",
|
||||
Use: "receivers",
|
||||
Aliases: []string{"receiver"},
|
||||
Short: "Get Receiver statuses",
|
||||
Long: "The get receiver command prints the statuses of the resources.",
|
||||
Example: ` # List all Receiver and their status
|
||||
flux get receivers
|
||||
`,
|
||||
|
||||
@@ -21,9 +21,10 @@ import (
|
||||
)
|
||||
|
||||
var getSourceCmd = &cobra.Command{
|
||||
Use: "sources",
|
||||
Short: "Get source statuses",
|
||||
Long: "The get source sub-commands print the statuses of the sources.",
|
||||
Use: "sources",
|
||||
Aliases: []string{"source"},
|
||||
Short: "Get source statuses",
|
||||
Long: "The get source sub-commands print the statuses of the sources.",
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
Reference in New Issue
Block a user