pb-4887: Added fix in handling the already exists error while creating#1567
Merged
siva-portworx merged 1 commit intomasterfrom Nov 16, 2023
Merged
pb-4887: Added fix in handling the already exists error while creating#1567siva-portworx merged 1 commit intomasterfrom
siva-portworx merged 1 commit intomasterfrom
Conversation
volumesnapshotclass during restore. - If we have csi-snapshot-webhook webhook, the creation of volumesnapshotclass fails with different eror message for already exists error. - So add a get call and then calling create volumesnapshot call, if Get failed with NotFound error.
Collaborator
|
Can one of the admins verify this patch? |
prashanthpx
approved these changes
Nov 16, 2023
lalat-das
approved these changes
Nov 16, 2023
mkoppal-px
reviewed
Nov 16, 2023
mkoppal-px
reviewed
Nov 16, 2023
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1567 +/- ##
==========================================
+ Coverage 66.47% 66.53% +0.05%
==========================================
Files 43 43
Lines 5453 5453
==========================================
+ Hits 3625 3628 +3
+ Misses 1493 1491 -2
+ Partials 335 334 -1 ☔ View full report in Codecov by Sentry. |
| vsClass.(*kSnapshotv1.VolumeSnapshotClass).ResourceVersion = "" | ||
| vsClass.(*kSnapshotv1.VolumeSnapshotClass).UID = "" | ||
| newVSClass, err = c.snapshotClient.SnapshotV1().VolumeSnapshotClasses().Create(context.TODO(), vsClass.(*kSnapshotv1.VolumeSnapshotClass), metav1.CreateOptions{}) | ||
| _, err = c.snapshotClient.SnapshotV1().VolumeSnapshotClasses().Get(context.TODO(), vsClass.(*kSnapshotv1.VolumeSnapshotClass).Name, metav1.GetOptions{}) |
Contributor
There was a problem hiding this comment.
why not return the vsClass object returned by this Get function?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What this PR does / why we need it:
Does this PR change a user-facing CRD or CLI?:
no
Is a release note needed?:
Does this change need to be cherry-picked to a release branch?:
23.9
Testing: