Skip to content

Commit

Permalink
[issue-1198] missing volume (#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
katarzynakulpa authored Jul 15, 2024
1 parent f565624 commit f02976b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ func (s *CSINodeService) processFakeAttachInNodeStageVolume(ll *logrus.Entry, vo
ll.Errorf("unable to mount fake device in stage volume request with error: %v", err)
return status.Error(codes.Internal, fmt.Sprintf("failed to mount device in stage volume: %s", err.Error()))
}
if volumeCR.Spec.OperationalStatus != apiV1.OperationalStatusMissing {
volumeCR.Spec.OperationalStatus = apiV1.OperationalStatusMissing
}
}
} else if volumeCR.Annotations[fakeAttachVolumeAnnotation] == fakeAttachVolumeKey {
delete(volumeCR.Annotations, fakeAttachVolumeAnnotation)
Expand Down
1 change: 1 addition & 0 deletions pkg/node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ var _ = Describe("CSINodeService Fake-Attach", func() {
err = node.k8sClient.ReadCR(testCtx, testV1ID, "", vol1)
Expect(err).To(BeNil())
Expect(vol1.Spec.CSIStatus).To(Equal(apiV1.VolumeReady))
Expect(vol1.Spec.OperationalStatus).To(Equal(apiV1.OperationalStatusMissing))
Expect(vol1.Annotations[fakeDeviceVolumeAnnotation]).To(Equal(newFakeDevice))
})
It("Should publish unhealthy fs-mode volume with fake-attach annotation", func() {
Expand Down

0 comments on commit f02976b

Please sign in to comment.