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

refactor kn service export to export revisions #819

Merged
merged 9 commits into from
May 5, 2020

Conversation

itsmurugappan
Copy link
Contributor

Description

Changes made to export revisions directly with kn service export.
#728 (comment) - This was the approach followed

Changes

  • --with-revisions option will export service and revision list
  • --with-revisions --kubernetes-resources will export a service list (kubectl friendly)
  • add annotations to export

Reference

Fixes #728

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Apr 22, 2020
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: 6 warnings.

In response to this:

Description

Changes made to export revisions directly with kn service export.
#728 (comment) - This was the approach followed

Changes

  • --with-revisions option will export service and revision list
  • --with-revisions --kubernetes-resources will export a service list (kubectl friendly)
  • add annotations to export

Reference

Fixes #728

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.

pkg/kn/commands/service/export_test.go Outdated Show resolved Hide resolved
pkg/kn/commands/service/export_test.go Outdated Show resolved Hide resolved
test/e2e/service_export_import_apply_test.go Outdated Show resolved Hide resolved
test/e2e/service_export_import_apply_test.go Outdated Show resolved Hide resolved
pkg/kn/commands/service/export.go Outdated Show resolved Hide resolved
pkg/kn/commands/service/export.go Outdated Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Apr 22, 2020
@itsmurugappan
Copy link
Contributor Author

/assign @rhuss

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.

Any way to have the expected YAML in the tests? That way it’s clear and just compares output from test to YAML itself?

docs/cmd/kn_service_export.md Outdated Show resolved Hide resolved
pkg/kn/commands/service/export_test.go Outdated Show resolved Hide resolved
@itsmurugappan
Copy link
Contributor Author

itsmurugappan commented Apr 22, 2020

Any way to have the expected YAML in the tests? That way it’s clear and just compares output from test to YAML itself?

like a set of expected YAML's in a folder and compare against them ? I think for e2e we can do them. @maximilien

@rhuss
Copy link
Contributor

rhuss commented Apr 28, 2020

Thanks a lot ! I was a bit busy the last week, but will work on the review soon

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.

Thanks a lot for your PR, it looks good to me with some minor change requests (see below).

Besides this, I wonder whether instead of exporting a service and a revision list we might should introduce a new type KnExport with fields service: and revisions: to embed the service and the revisions. I'm not sure how easy this is (i.e. how to add this as schema so that cli-runtime/pkg/printers can use this too.), but the big advantage of an own type is that it's then crystal clear that the export can not be applied with kubectl but with kn import only (so that the owneReferences can be fixed).

wdyt ? We can also do it in two steps: First merge this PR and the think about that KnExport (or KnativeExport type).

docs/cmd/kn_service_export.md Outdated Show resolved Hide resolved
pkg/kn/commands/service/export.go Outdated Show resolved Hide resolved
pkg/kn/commands/service/export.go Outdated Show resolved Hide resolved
pkg/kn/commands/service/export.go Outdated Show resolved Hide resolved
pkg/kn/commands/service/export.go Outdated Show resolved Hide resolved
pkg/kn/commands/service/export.go Outdated Show resolved Hide resolved
pkg/kn/commands/service/export.go Outdated Show resolved Hide resolved
@itsmurugappan
Copy link
Contributor Author

itsmurugappan commented May 4, 2020

wdyt ? We can also do it in two steps: First merge this PR and the think about that KnExport (or KnativeExport type).

@rhuss I also think its an excellent idea to introduce a new type. It will be a much cleaner approach. Also made the changes requested by you.

@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 82.3% 85.2% 2.9

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.

Thanks ! Lookas good to me. Let's merge it now and then think about an own export format. I opened #824 to track this.

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: itsmurugappan, rhuss

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 5, 2020
@knative-prow-robot knative-prow-robot merged commit 644ecb6 into knative:master May 5, 2020
coryrc pushed a commit to coryrc/client that referenced this pull request May 14, 2020
When vendoring test-infra in other repos, `dep` leaves a few json files from `tools/devstats`.

Furthermore, technically `devstats` is not a tool but a completely separate engine.
@itsmurugappan itsmurugappan deleted the dev03 branch May 25, 2020 15:36
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"kn service export --with-revisions" should create revision COs directly
6 participants