-
Notifications
You must be signed in to change notification settings - Fork 559
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
rbd: add validation to ToCSI() for rbdVolume and rbdSnapshot #5151
Conversation
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks !
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
/test ci/centos/k8s-e2e-external-storage/1.32 |
/test ci/centos/k8s-e2e-external-storage/1.31 |
/test ci/centos/mini-e2e-helm/k8s-1.31 |
/test ci/centos/mini-e2e-helm/k8s-1.32 |
/test ci/centos/k8s-e2e-external-storage/1.30 |
/test ci/centos/mini-e2e-helm/k8s-1.30 |
/test ci/centos/mini-e2e/k8s-1.31 |
/test ci/centos/mini-e2e/k8s-1.32 |
/test ci/centos/upgrade-tests-cephfs |
/test ci/centos/mini-e2e/k8s-1.30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks !
@@ -1248,7 +1259,11 @@ func (cs *ControllerServer) CreateSnapshot( | |||
return nil, status.Error(codes.Internal, err.Error()) | |||
} | |||
|
|||
csiSnap, err := vol.toSnapshot().ToCSI(ctx) | |||
// FIXME: doSnapshotClone() returns a rbdVolume, some attributes may be missing? | |||
snap := vol.toSnapshot() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Madhu-1, that can not be done, as an
rbdVolume
does not have aSourceVolumeID
, it is only part ofrbdSnapshot
. MaybedoSnapshotClone()
should return anrbdSnapshot
, or something else in the flow needs to be adjusted. I know that this isn't very clean, hence the FIXME comment.
Can we please have an issue open for this too ?
Thanks! @nixpanic |
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
`doSnapshotClone()` returns a new `rbdVolume` object from a temporary snapshot. This conversion drops the `SourceVolumeID` attribute, as a `rbdVolume` does not have that. After converting the `rbdVolume` back to a `rbdSnapshot`, the `SourceVolumeID` attribute can be set again, and the `ToCSI()` function can create an appropriate CSI Snapshot struct. Signed-off-by: Niels de Vos <[email protected]>
After an unfortnate timed restart of the provisioner, a volume that got cloned did not get a `rbdVolume.VolID` set. The `.VolID` is used as the CSI Volume Handle, and is a required attribute. The `rbdVolume` and `rbdSnapshot` structs have a `.ToCSI()` function that can do the validation of required attributes. This is now added, including unit-tests. Signed-off-by: Niels de Vos <[email protected]>
/test ci/centos/k8s-e2e-external-storage/1.32 |
/test ci/centos/mini-e2e-helm/k8s-1.32 |
/test ci/centos/k8s-e2e-external-storage/1.30 |
/test ci/centos/k8s-e2e-external-storage/1.31 |
/test ci/centos/upgrade-tests-cephfs |
/test ci/centos/mini-e2e/k8s-1.32 |
/test ci/centos/mini-e2e-helm/k8s-1.30 |
/test ci/centos/upgrade-tests-rbd |
/test ci/centos/mini-e2e-helm/k8s-1.31 |
/test ci/centos/mini-e2e/k8s-1.30 |
/test ci/centos/mini-e2e/k8s-1.31 |
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
/retest ci/centos/mini-e2e/k8s-1.31 |
@Mergifyio requeue Failed with:
|
@Mergifyio requeue |
✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically |
After an unfortnate timed restart of the provisioner, a volume that got
cloned did not get a
rbdVolume.VolID
set. The.VolID
is used as theCSI Volume Handle, and is a required attribute.
The
rbdVolume
andrbdSnapshot
structs have a.ToCSI()
functionthat can do the validation of required attributes. This is now added,
including unit-tests.