Skip to content

Handle map-like options consistently#592

Merged
knative-prow-robot merged 1 commit intoknative:masterfrom
MIBc:dev-1
Jan 2, 2020
Merged

Handle map-like options consistently#592
knative-prow-robot merged 1 commit intoknative:masterfrom
MIBc:dev-1

Conversation

@MIBc
Copy link
Copy Markdown
Contributor

@MIBc MIBc commented Dec 25, 2019

From the description of #577:

The behaviour should be (using --env as an example):

--env a1=b1 --env a2=b2 should add both env variables
--env a1 should set a1 to empty string
--env a1- should remove the environment variable for update and an error for create
--env a1=b1 --env a1=b2 should be an error as the same key can not be specified on the same command line

Implements all the cases mentioned in #577, except one being discussed.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Dec 25, 2019
@knative-prow-robot
Copy link
Copy Markdown
Contributor

Hi @MIBc. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 25, 2019
@daisy-ycguo
Copy link
Copy Markdown

/ok-to-test

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 26, 2019
@MIBc
Copy link
Copy Markdown
Contributor Author

MIBc commented Dec 26, 2019

/test pull-knative-client-go-coverage
/retest

@sixolet sixolet changed the title Handling map like options in a same way Handle map-like options consistently Dec 26, 2019
Copy link
Copy Markdown
Contributor

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

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

Thanks!
A couple of suggestions to align with similar error messages.

Comment thread pkg/kn/commands/trigger/update_flags.go Outdated
}
filters, err := util.MapFromArray(f.Filters, "=")
if err != nil {
return nil, errors.Wrap(err, "invalid filter")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
return nil, errors.Wrap(err, "invalid filter")
return nil, errors.Wrap(err, "Invalid --filter")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread pkg/kn/commands/trigger/update_flags.go Outdated
}
filters, err := util.MapFromArrayAllowingSingles(f.Filters, "=")
if err != nil {
return nil, nil, errors.Wrap(err, "invalid filter")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
return nil, nil, errors.Wrap(err, "invalid filter")
return nil, nil, errors.Wrap(err, "Invalid --filter")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-knative-client-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/kn/commands/service/configuration_edit_flags.go 84.7% 83.6% -1.1
pkg/kn/commands/trigger/update_flags.go 96.7% 100.0% 3.3
pkg/util/parsing_helper.go 95.7% 97.0% 1.3

Copy link
Copy Markdown
Contributor

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thank you!

@rhuss : The PR covers all the cases from #577 except the one, to error out if asked to remove an ENV during create, IMO it could be a valid use case #577 (comment), besides I've updated the PR description to not close the issue.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 2, 2020
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MIBc, navidshaikh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 2, 2020
@knative-prow-robot knative-prow-robot merged commit 99d8b22 into knative:master Jan 2, 2020
@MIBc MIBc deleted the dev-1 branch January 2, 2020 07:00
dsimansk added a commit to dsimansk/client that referenced this pull request Mar 26, 2021
* Update RPM spec file

* Update spec file changelog date

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants