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

Don't migrate storage version if CRD has one storage version #2861

Merged
merged 3 commits into from
Oct 16, 2023

Conversation

kauana
Copy link
Member

@kauana kauana commented Oct 11, 2023

Changes

Fixes #2845

@knative-prow knative-prow bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 11, 2023
@knative-prow knative-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 11, 2023
@kauana kauana changed the title don't migrate storage version if CRD has one storage Don't migrate storage version if CRD has one storage Oct 11, 2023
@kauana kauana changed the title Don't migrate storage version if CRD has one storage Don't migrate storage version if CRD has one storage version Oct 11, 2023
@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (d0c133d) 81.87% compared to head (c3b3714) 81.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2861      +/-   ##
==========================================
+ Coverage   81.87%   81.88%   +0.01%     
==========================================
  Files         167      167              
  Lines       10222    10225       +3     
==========================================
+ Hits         8369     8373       +4     
+ Misses       1608     1606       -2     
- Partials      245      246       +1     
Files Coverage Δ
apiextensions/storageversion/migrator.go 94.73% <100.00%> (+0.29%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dprotaso dprotaso left a comment

Choose a reason for hiding this comment

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

unit tests please :)

apiextensions/storageversion/migrator.go Outdated Show resolved Hide resolved
@kauana kauana changed the title Don't migrate storage version if CRD has one storage version [WIP] Don't migrate storage version if CRD has one storage version Oct 11, 2023
@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 11, 2023
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 11, 2023
@kauana kauana changed the title [WIP] Don't migrate storage version if CRD has one storage version Don't migrate storage version if CRD has one storage version Oct 16, 2023
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 16, 2023
cclient.Fake.PrependReactor("patch", "customresourcedefinitions", func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) {
pa, ok := action.(k8stesting.PatchAction)
if !ok {
return true, nil, fmt.Errorf("not a patch action: %#v", action)
Copy link
Member

Choose a reason for hiding this comment

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

We want to return false since we aren't handling this action - but given you're filtering using the patch verb in the Prepend call I would recommend just dropping this if block cause you're always going to get PatchAction type here

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I've removed the unnecessary check too.

@dprotaso
Copy link
Member

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2023
@knative-prow
Copy link

knative-prow bot commented Oct 16, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, kauana

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 knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 16, 2023
@dprotaso
Copy link
Member

/retest - flakey OpenCensus test

@knative-prow
Copy link

knative-prow bot commented Oct 16, 2023

@dprotaso: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test build-tests
  • /test integration-tests
  • /test unit-tests

Use /test all to run all jobs.

In response to this:

/retest - flakey OpenCensus test

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.

@dprotaso
Copy link
Member

/test unit-tests_pkg_main

@knative-prow knative-prow bot merged commit 283df0b into knative:main Oct 16, 2023
40 of 41 checks passed
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Storage Version Migrator doing empty patches for no reason
2 participants