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

Support labels #1701

Merged
merged 3 commits into from
Aug 11, 2021
Merged

Support labels #1701

merged 3 commits into from
Aug 11, 2021

Conversation

carolynvs
Copy link
Member

@carolynvs carolynvs commented Aug 6, 2021

What does this change

Support applying labels to installations, parameter and credential sets. Users can use these labels to filter list results. Eventually we can use these for matching dependencies.

I have also moved when an installation is created during porter install so that we can persist the labels.

What issue does it fix

Closes #1683

Notes for the reviewer

Checklist

  • Unit Tests
  • Documentation
  • Schema (porter.yaml)

@carolynvs carolynvs added the cnab Related to the CNAB spec label Aug 6, 2021
@carolynvs carolynvs changed the base branch from main to release/v1 August 6, 2021 16:25
@carolynvs carolynvs force-pushed the labels branch 4 times, most recently from ad28356 to d960c9a Compare August 9, 2021 18:23
@carolynvs carolynvs marked this pull request as ready for review August 10, 2021 20:37
Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only other thought is around the use of a positional argument for the installation/paramset/credset name and how it is different from the other query options that are behind flags (--namespace and --label). I'm wondering if we want to consider using a flag for the name query (--name), instead of consuming it via the positional arg.

However, the installation/paramset/credset name is and has been consumed via a positional arg for the corresponding install and generate commands, so in this light, the current approach is in-line with expectations.

cmd/porter/credentials.go Show resolved Hide resolved
if len(args) == 1 {
o.Name = args[0]
} else if len(args) > 1 {
return errors.Errorf("only one positional argument may be specified, the installation name, but multiple were received: %s", args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this same check for the params/creds list commands?

e.g.

 $ porter params list foo foo
NAMESPACE   NAME   MODIFIED

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll switch to a --name flag so that we don't need this check at all.

@carolynvs
Copy link
Member Author

@vdice I actually ripped off the porter mixins search [QUERY] command with that positional argument. But that command doesn't have other filter flags. I'll update it to use --name so that all filters are flags.

@carolynvs
Copy link
Member Author

@vdice fixed

@carolynvs carolynvs mentioned this pull request Aug 11, 2021
3 tasks
cmd/porter/parameters.go Outdated Show resolved Hide resolved
docs/content/cli/credentials_list.md Outdated Show resolved Hide resolved
tests/smoke/hello_test.go Outdated Show resolved Hide resolved
Add labels to installations, credential sets and parameter sets.

Signed-off-by: Carolyn Van Slyck <[email protected]>
Signed-off-by: Carolyn Van Slyck <[email protected]>
Signed-off-by: Carolyn Van Slyck <[email protected]>
Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@carolynvs carolynvs merged commit 07c6b98 into getporter:release/v1 Aug 11, 2021
@carolynvs carolynvs deleted the labels branch August 11, 2021 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cnab Related to the CNAB spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support namespaces and labels
2 participants