Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for getting resources by name #867

Merged
merged 1 commit into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/flux/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions cmd/flux/get_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
`,
Expand Down
7 changes: 4 additions & 3 deletions cmd/flux/get_alertprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
`,
Expand Down
2 changes: 1 addition & 1 deletion cmd/flux/get_helmrelease.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions cmd/flux/get_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/flux/get_kustomization.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions cmd/flux/get_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
`,
Expand Down
7 changes: 4 additions & 3 deletions cmd/flux/get_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion docs/cmd/flux_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The get sub-commands print the statuses of sources and resources.
* [flux get alert-providers](flux_get_alert-providers.md) - Get Provider statuses
* [flux get alerts](flux_get_alerts.md) - Get Alert statuses
* [flux get helmreleases](flux_get_helmreleases.md) - Get HelmRelease statuses
* [flux get image](flux_get_image.md) - Get image automation object status
* [flux get images](flux_get_images.md) - Get image automation object status
* [flux get kustomizations](flux_get_kustomizations.md) - Get Kustomization statuses
* [flux get receivers](flux_get_receivers.md) - Get Receiver statuses
* [flux get sources](flux_get_sources.md) - Get source statuses
Expand Down
10 changes: 5 additions & 5 deletions docs/cmd/flux_get_image.md → docs/cmd/flux_get_images.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## flux get image
## flux get images

Get image automation object status

Expand All @@ -9,7 +9,7 @@ The get image sub-commands print the status of image automation objects.
### Options

```
-h, --help help for image
-h, --help help for images
```

### Options inherited from parent commands
Expand All @@ -26,7 +26,7 @@ The get image sub-commands print the status of image automation objects.
### SEE ALSO

* [flux get](flux_get.md) - Get sources and resources
* [flux get image policy](flux_get_image_policy.md) - Get ImagePolicy status
* [flux get image repository](flux_get_image_repository.md) - Get ImageRepository status
* [flux get image update](flux_get_image_update.md) - Get ImageUpdateAutomation status
* [flux get images policy](flux_get_images_policy.md) - Get ImagePolicy status
* [flux get images repository](flux_get_images_repository.md) - Get ImageRepository status
* [flux get images update](flux_get_images_update.md) - Get ImageUpdateAutomation status

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## flux get image policy
## flux get images policy

Get ImagePolicy status

Expand All @@ -7,7 +7,7 @@ Get ImagePolicy status
The get image policy command prints the status of ImagePolicy objects.

```
flux get image policy [flags]
flux get images policy [flags]
```

### Examples
Expand Down Expand Up @@ -40,5 +40,5 @@ flux get image policy [flags]

### SEE ALSO

* [flux get image](flux_get_image.md) - Get image automation object status
* [flux get images](flux_get_images.md) - Get image automation object status

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## flux get image repository
## flux get images repository

Get ImageRepository status

Expand All @@ -7,7 +7,7 @@ Get ImageRepository status
The get image repository command prints the status of ImageRepository objects.

```
flux get image repository [flags]
flux get images repository [flags]
```

### Examples
Expand Down Expand Up @@ -40,5 +40,5 @@ flux get image repository [flags]

### SEE ALSO

* [flux get image](flux_get_image.md) - Get image automation object status
* [flux get images](flux_get_images.md) - Get image automation object status

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## flux get image update
## flux get images update

Get ImageUpdateAutomation status

Expand All @@ -7,7 +7,7 @@ Get ImageUpdateAutomation status
The get image update command prints the status of ImageUpdateAutomation objects.

```
flux get image update [flags]
flux get images update [flags]
```

### Examples
Expand Down Expand Up @@ -40,5 +40,5 @@ flux get image update [flags]

### SEE ALSO

* [flux get image](flux_get_image.md) - Get image automation object status
* [flux get images](flux_get_images.md) - Get image automation object status

31 changes: 29 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,26 @@ nav:
- Create alert provider: cmd/flux_create_alert-provider.md
- Create alert: cmd/flux_create_alert.md
- Create receiver: cmd/flux_create_receiver.md
- Create image: cmd/flux_create_image.md
- Create image policy: cmd/flux_create_image_policy.md
- Create image repository: cmd/flux_create_image_repository.md
- Create image update: cmd/flux_create_image_update.md
- Create tenant: cmd/flux_create_tenant.md
- Create secret: cmd/flux_create_secret.md
- Create secret git: cmd/flux_create_secret_git.md
- Create secret helm: cmd/flux_create_secret_helm.md
- Create secret tls: cmd/flux_create_secret_tls.md
- Delete: cmd/flux_delete.md
- Delete kustomization: cmd/flux_delete_kustomization.md
- Delete helmrelease: cmd/flux_delete_helmrelease.md
- Delete source: cmd/flux_delete_source.md
- Delete source git: cmd/flux_delete_source_git.md
- Delete source helm: cmd/flux_delete_source_helm.md
- Delete source bucket: cmd/flux_delete_source_bucket.md
- Delete image: cmd/flux_delete_image.md
- Delete image policy: cmd/flux_delete_image_policy.md
- Delete image repository: cmd/flux_delete_image_repository.md
- Delete image update: cmd/flux_delete_image_update.md
- Export: cmd/flux_export.md
- Export kustomization: cmd/flux_export_kustomization.md
- Export helmrelease: cmd/flux_export_helmrelease.md
Expand All @@ -125,6 +134,10 @@ nav:
- Export alert provider: cmd/flux_export_alert-provider.md
- Export alert: cmd/flux_export_alert.md
- Export receiver: cmd/flux_export_receiver.md
- Export image: cmd/flux_export_image.md
- Export image policy: cmd/flux_export_image_policy.md
- Export image repository: cmd/flux_export_image_repository.md
- Export image update: cmd/flux_export_image_update.md
- Get: cmd/flux_get.md
- Get kustomizations: cmd/flux_get_kustomizations.md
- Get helmreleases: cmd/flux_get_helmreleases.md
Expand All @@ -134,8 +147,13 @@ nav:
- Get sources chart: cmd/flux_get_sources_chart.md
- Get sources bucket: cmd/flux_get_sources_bucket.md
- Get alert provider: cmd/flux_get_alert-provider.md
- Get alert: cmd/flux_get_alert.md
- Get receiver: cmd/flux_get_receiver.md
- Get alerts: cmd/flux_get_alerts.md
- Get alert providers: cmd/flux_get_alert-providers.md
- Get receivers: cmd/flux_get_receivers.md
- Get images: cmd/flux_get_images.md
- Get images policy: cmd/flux_get_images_policy.md
- Get images repository: cmd/flux_get_images_repository.md
- Get images update: cmd/flux_get_images_update.md
- Install: cmd/flux_install.md
- Resume: cmd/flux_resume.md
- Resume kustomization: cmd/flux_resume_kustomization.md
Expand All @@ -148,6 +166,9 @@ nav:
- Resume alert provider: cmd/flux_resume_alert-provider.md
- Resume alert: cmd/flux_resume_alert.md
- Resume receiver: cmd/flux_resume_receiver.md
- Resume image: cmd/flux_resume_image.md
- Resume image repository: cmd/flux_resume_image_repository.md
- Resume image update: cmd/flux_resume_image_update.md
- Suspend: cmd/flux_suspend.md
- Suspend kustomization: cmd/flux_suspend_kustomization.md
- Suspend helmrelease: cmd/flux_suspend_helmrelease.md
Expand All @@ -159,13 +180,19 @@ nav:
- Suspend alert provider: cmd/flux_suspend_alert-provider.md
- Suspend alert: cmd/flux_suspend_alert.md
- Suspend receiver: cmd/flux_suspend_receiver.md
- Suspend image: cmd/flux_suspend_image.md
- Suspend image repository: cmd/flux_suspend_image_repository.md
- Suspend image update: cmd/flux_suspend_image_update.md
- Reconcile: cmd/flux_reconcile.md
- Reconcile kustomization: cmd/flux_reconcile_kustomization.md
- Reconcile helmrelease: cmd/flux_reconcile_helmrelease.md
- Reconcile source: cmd/flux_reconcile_source.md
- Reconcile source git: cmd/flux_reconcile_source_git.md
- Reconcile source helm: cmd/flux_reconcile_source_helm.md
- Reconcile source bucket: cmd/flux_reconcile_source_bucket.md
- Reconcile image: cmd/flux_reconcile_image.md
- Reconcile image repository: cmd/flux_reconcile_image_repository.md
- Reconcile image update: cmd/flux_reconcile_image_update.md
- Uninstall: cmd/flux_uninstall.md
- Dev Guides:
- Watching for source changes: dev-guides/source-watcher.md
Expand Down