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 label flag to profile list command #2964

Merged
merged 2 commits into from
Apr 5, 2024
Merged

Add label flag to profile list command #2964

merged 2 commits into from
Apr 5, 2024

Conversation

dmjb
Copy link
Member

@dmjb dmjb commented Apr 5, 2024

Fixes #2963

This makes it possible to see the healthcheck profile in the CLI

$ minder profile list --help
The profile list subcommand lets you list profiles within Minder.

Usage:
  minder profile list [flags]

Flags:
  -h, --help            help for list
  -l, --label string    Profile label to filter on
  -o, --output string   Output format (one of json,yaml,table) (default "table")

Global Flags:
      --config string            Config file (default is $PWD/config.yaml)
      --grpc-host string         Server host (default "api.stacklok.com")
      --grpc-insecure            Allow establishing insecure connections
      --grpc-port int            Server port (default 443)
      --identity-client string   Identity server client ID (default "minder-cli")
      --identity-url string      Identity server issuer URL (default "https://auth.stacklok.com")
  -j, --project string           ID of the project

$ minder profile list
WARNING: Running against a test environment (staging.stacklok.dev) and may not be stable
+----+----------------------------------------------------+-------+-----------+
| ID |                        NAME                        | ALERT | REMEDIATE |
+----+----------------------------------------------------+-------+-----------+

$ minder profile list --label="*"
WARNING: Running against a test environment (staging.stacklok.dev) and may not be stable
+--------------------------------------+----------------------------------------------------+-------+-----------+
|                  ID                  |                        NAME                        | ALERT | REMEDIATE |
+--------------------------------------+----------------------------------------------------+-------+-----------+
| e7b51cf5-4950-4689-98c6-eccd5349e4d6 | stacklok/stacklok-health-check                     | off   | off       |
+--------------------------------------+----------------------------------------------------+-------+-----------+

$ minder profile list --label="stacklok_healthcheck"
WARNING: Running against a test environment (staging.stacklok.dev) and may not be stable
+--------------------------------------+----------------------------------------------------+-------+-----------+
|                  ID                  |                        NAME                        | ALERT | REMEDIATE |
+--------------------------------------+----------------------------------------------------+-------+-----------+
| e7b51cf5-4950-4689-98c6-eccd5349e4d6 | stacklok/stacklok-health-check                     | off   | off       |
+--------------------------------------+----------------------------------------------------+-------+-----------+

Summary

Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.

Fixes #(related issue)

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

Fixes #2963

This makes it possible to see the healthcheck profile in the CLI
@dmjb dmjb requested a review from a team as a code owner April 5, 2024 10:31
@coveralls
Copy link

coveralls commented Apr 5, 2024

Coverage Status

coverage: 48.335% (-0.01%) from 48.347%
when pulling ecf952c on cli-profile-label
into ccb71a8 on main.

@dmjb dmjb merged commit 9c339c8 into main Apr 5, 2024
20 checks passed
@dmjb dmjb deleted the cli-profile-label branch April 5, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow CLI to filter on profile labels
3 participants