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

fix panic without PV permission #4837

Merged
merged 2 commits into from Jan 12, 2023
Merged

Conversation

csuzhangxc
Copy link
Member

@csuzhangxc csuzhangxc commented Jan 11, 2023

What problem does this PR solve?

fix #4797

NOTE, in this case, some volume statuses will not be updated

      volumes:
        tikv:
          boundCount: 1
          currentCapacity: 1Gi
          currentCount: 1
          currentStorageClass: standard
          modifiedCapacity: 1Gi
          modifiedCount: 0
          modifiedStorageClass: test
          name: tikv
          resizedCapacity: 1Gi
          resizedCount: 0

What is changed and how does it work?

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Unit test
  • E2E test
  • Manual test
  • No code

Side effects

  • Breaking backward compatibility
  • Other side effects:

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.

Fix the issue that TiDB Operator panics if without PV permission

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 11, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • KanShiori
  • liubog2008

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@codecov-commenter
Copy link

codecov-commenter commented Jan 11, 2023

Codecov Report

Merging #4837 (7b0c25b) into master (703375a) will increase coverage by 8.53%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4837      +/-   ##
==========================================
+ Coverage   59.99%   68.52%   +8.53%     
==========================================
  Files         224      228       +4     
  Lines       25356    28428    +3072     
==========================================
+ Hits        15212    19481    +4269     
+ Misses       8704     7491    -1213     
- Partials     1440     1456      +16     
Flag Coverage Δ
e2e 52.91% <0.00%> (?)
unittest 59.97% <0.00%> (-0.02%) ⬇️

@@ -88,6 +88,11 @@ func (m *EBSModifier) Validate(spvc, dpvc *corev1.PersistentVolumeClaim, ssc, ds
}

func (m *EBSModifier) ModifyVolume(ctx context.Context, pvc *corev1.PersistentVolumeClaim, pv *corev1.PersistentVolume, sc *storagev1.StorageClass) ( /*wait*/ bool, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a comment in the VolumeModifier interface to note the pv may be nil and the reason.

@csuzhangxc
Copy link
Member Author

/test pull-e2e-kind
/test pull-e2e-kind-serial

@csuzhangxc
Copy link
Member Author

/test pull-e2e-kind-serial

@csuzhangxc
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 7b0c25b

@csuzhangxc
Copy link
Member Author

/test pull-e2e-kind-serial

3 similar comments
@csuzhangxc
Copy link
Member Author

/test pull-e2e-kind-serial

@csuzhangxc
Copy link
Member Author

/test pull-e2e-kind-serial

@csuzhangxc
Copy link
Member Author

/test pull-e2e-kind-serial

@csuzhangxc csuzhangxc merged commit 4bb3886 into pingcap:master Jan 12, 2023
@csuzhangxc csuzhangxc deleted the pv-modify-nil branch January 12, 2023 13:50
@csuzhangxc
Copy link
Member Author

/cherry-pick release-1.4

@ti-chi-bot
Copy link
Member

@csuzhangxc: new pull request created to branch release-1.4: #4840.

In response to this:

/cherry-pick release-1.4

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 ti-community-infra/tichi repository.

csuzhangxc added a commit that referenced this pull request Jan 13, 2023
Co-authored-by: csuzhangxc <csuzhangxc@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to deploy tidb operator v1.4.0-beta.3 with cluster-permission-pv set to false
5 participants