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

kn export defect to honor mode #1212

Merged
merged 5 commits into from
Mar 4, 2021

Conversation

itsmurugappan
Copy link
Contributor

@itsmurugappan itsmurugappan commented Feb 3, 2021

Description

Mode is ignored, when --with-revisions flag is not mentioned, this pr makes sure that mode is always honored.

Changes

  • "replay" is the default mode
  • replay without revisions will print ksvc
  • replay with revisions will print ksvc list
  • export mode with/without revisions will return knexport type

Reference

Fixes #1087

cc @dsimansk

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Feb 3, 2021
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@itsmurugappan: 0 warnings.

In response to this:

Description

Mode is ignored, when --with-revisions flag is not mentioned, this pr makes sure that mode is always honored.

Changes

  • "replay" is the default mode
  • replay without revisions will print ksvc
  • replay with revisions will print ksvc list
  • export mode with/without revisions will return knexport type

Reference

Fixes #1087

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 the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 3, 2021
@itsmurugappan
Copy link
Contributor Author

/test pull-knative-client-integration-tests

@dsimansk
Copy link
Contributor

dsimansk commented Feb 3, 2021

  • "replay" is the default mode

I'm leaning towards export mode as default a bit more, since that should be added value of kn service export command. I let the other chime in, not really insisting on it. :)

I'm planing to take a closer look at the code later today to provide feedback.

assert.Error(t, err, "'kn service export --with-revisions' requires a mode, please specify one of replay|export")

_, err = executeServiceExportCommand(t, tc, "export", tc.latestSvc.ObjectMeta.Name, "--with-revisions", "--mode", "k8s", "-o", "yaml")
assert.Error(t, err, "'kn service export --with-revisions' requires a mode, please specify one of replay|export")
}

func TestServiceExport(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should have a similar set of tests for service export --mode export without --with-revisions that'd also verity that the fix is working as intended and reflecting --mode flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added this test

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.

/ok-to-test

@@ -56,12 +56,6 @@ func TestServiceExportError(t *testing.T) {

_, err := executeServiceExportCommand(t, tc, "export", tc.latestSvc.ObjectMeta.Name)
assert.Error(t, err, "'kn service export' requires output format")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have a simple test verifying no latest revision in export?

@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. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 3, 2021
@dsimansk
Copy link
Contributor

dsimansk commented Feb 16, 2021

Hi @itsmurugappan just a quick status check, any update wrt review comments above?

@itsmurugappan
Copy link
Contributor Author

hi @dsimansk , will make the changes this week. Sorry got side tracked.

@dsimansk
Copy link
Contributor

/retest

1 similar comment
@dsimansk
Copy link
Contributor

/retest

@rhuss
Copy link
Contributor

rhuss commented Feb 24, 2021

Thanks, lets wait until friday for the poll in #1087 for what to use as the default mode, merge this PR and I think since this mode is marked as experimental still, we can create a 0.21.1 afterwards so that we don't have to wait for 0.22 to land.

@itsmurugappan
Copy link
Contributor Author

/retest

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 3, 2021
@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/export.go 86.8% 87.6% 0.8

@itsmurugappan
Copy link
Contributor Author

/retest

@itsmurugappan
Copy link
Contributor Author

/test pull-knative-client-integration-tests-latest-release

Copy link
Contributor

@dsimansk dsimansk left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, maximilien

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 609d174 into knative:master Mar 4, 2021
@dsimansk
Copy link
Contributor

dsimansk commented Mar 4, 2021

Ups, I haven't noticed it's already approved and going to be merged on lgtm.

@itsmurugappan can you do a follow-up with changelog update please?

@itsmurugappan itsmurugappan deleted the knexport-defect branch March 4, 2021 18:11
rhuss added a commit to rhuss/knative-client that referenced this pull request Mar 9, 2021
David meets all criteria for an approver:

- [x] Reviewer for at least 3 months
- [x] Primary reviewer for at least 10 substantial PRs to the codebase, e.g.
  * knative#1246
  * knative#1194
  * knative#738
  * knative#832
  * knative#1016
  * knative#877
  * knative#667
  * knative#697
  * knative#1212
  * knative#835
- [x] Reviewed at least 30 PRs to the codebase ([38 assigned PRs](https://github.com/knative/client/pulls?q=type%3Apr+assignee%3Adsimansk+))
- [x] Nominated by a WG lead (rhuss)

Congrats David ! Thanks a lot for your awesome work & contributions.
@rhuss rhuss mentioned this pull request Mar 9, 2021
4 tasks
rhuss added a commit to rhuss/knative-client that referenced this pull request Mar 9, 2021
David meets all criteria for an approver:

- [x] Reviewer for at least 3 months
- [x] Primary reviewer for at least 10 substantial PRs to the codebase, e.g.
  * knative#1246
  * knative#1194
  * knative#738
  * knative#832
  * knative#1016
  * knative#877
  * knative#667
  * knative#697
  * knative#1212
  * knative#835
- [x] Reviewed at least 30 PRs to the codebase ([38 assigned PRs](https://github.com/knative/client/pulls?q=type%3Apr+assignee%3Adsimansk+))
- [x] Nominated by a WG lead (rhuss)

Congrats David ! Thanks a lot for your awesome work & contributions.
knative-prow-robot pushed a commit that referenced this pull request Mar 9, 2021
David meets all criteria for an approver:

- [x] Reviewer for at least 3 months
- [x] Primary reviewer for at least 10 substantial PRs to the codebase, e.g.
  * #1246
  * #1194
  * #738
  * #832
  * #1016
  * #877
  * #667
  * #697
  * #1212
  * #835
- [x] Reviewed at least 30 PRs to the codebase ([38 assigned PRs](https://github.com/knative/client/pulls?q=type%3Apr+assignee%3Adsimansk+))
- [x] Nominated by a WG lead (rhuss)

Congrats David ! Thanks a lot for your awesome work & contributions.
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.

Export command doesn't honour --mode flag
6 participants