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

Separate PodSpec flags from Service flags #943

Merged
merged 4 commits into from
Aug 4, 2020

Conversation

daisy-ycguo
Copy link
Member

Description

Separate the PodSpec flags from Service flags. Create a common flag PodFlags which could be used for Service commands and ContainerSource commands

Changes

  • Create a PodFlags in pkg/kn/flags as a set of common flags for commands who accept PodSpec flags

Reference

Fixes #935

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 21, 2020
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 21, 2020
Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Looks good to me (with a minor renaming suggestion).

I think this would be also a candidate later for the /lib shared code, which is still pending (#889)

pkg/kn/commands/service/configuration_edit_flags.go Outdated Show resolved Hide resolved
Copy link
Contributor

@maximilien maximilien left a comment

Choose a reason for hiding this comment

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

Missing a little bit of coverage. Thanks.

pkg/kn/flags/pod.go Outdated Show resolved Hide resolved
Copy link
Member Author

@daisy-ycguo daisy-ycguo left a comment

Choose a reason for hiding this comment

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

Missing a little bit of coverage. Thanks.

Thank you. I added my unit tests in the new version.

Copy link
Collaborator

@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.

I think we can improve how we add the pod spec flags to configuration edit flags.

pkg/kn/commands/service/configuration_edit_flags.go Outdated Show resolved Hide resolved
pkg/kn/flags/podspec.go Outdated Show resolved Hide resolved
pkg/kn/flags/podspec_test.go Show resolved Hide resolved
@maximilien
Copy link
Contributor

Please address comments, otherwise LGTM

@daisy-ycguo daisy-ycguo changed the title Separate PodSpec from Service flags Separate PodSpec flags from Service flags Jul 23, 2020
Copy link
Collaborator

@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
I see NamePrefix carried forward, which is not referred any where, can we remove that and commented code? + please add CHANGELOG

Labels []string
LabelsService []string
LabelsRevision []string
NamePrefix string
Copy link
Collaborator

Choose a reason for hiding this comment

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

we dont seem to refer NamePrefix anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

removed.

pkg/kn/commands/service/configuration_edit_flags.go Outdated Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2020
@daisy-ycguo
Copy link
Member Author

@navidshaikh I addressed your comments in the third commit. Please review again. Thank you.

CHANGELOG.adoc Outdated
@@ -18,6 +18,10 @@
|===
| | Description | PR

| 🐣
| Separate PodSpecFlags from Service ConfigurationEditFlags
| https://github.com/knative/client/pull/915[#915]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
| https://github.com/knative/client/pull/915[#915]
| https://github.com/knative/client/pull/943[#943]

Copy link
Member Author

Choose a reason for hiding this comment

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

thank you for finding this. I fixed it.

@knative-metrics-robot
Copy link

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 85.1% 82.6% -2.5
pkg/kn/flags/podspec.go Do not exist 97.6%

@maximilien
Copy link
Contributor

/test pull-knative-client-integration-tests

1 similar comment
@daisy-ycguo
Copy link
Member Author

/test pull-knative-client-integration-tests

@navidshaikh
Copy link
Collaborator

/retest

Copy link
Collaborator

@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

thanks!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: daisy-ycguo, navidshaikh

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

The pull request process is described here

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 merged commit 786ccf5 into knative:master Aug 4, 2020
rhuss pushed a commit to rhuss/knative-client that referenced this pull request Sep 9, 2020
* seperate PodSpec from Service flags

* loop over flag names

* remove NamePrefix and commented code, add changelog

* update pr number in changelog.adoc
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. 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.

Create a common PodFlags for both Service command and ContainerSource command
8 participants