Skip to content

controller/pvc: add checks for nil/empty pvc.Spec.StorageClassName#685

Merged
mergify[bot] merged 1 commit into
csi-addons:mainfrom
Rakshith-R:fix-scName
Sep 24, 2024
Merged

controller/pvc: add checks for nil/empty pvc.Spec.StorageClassName#685
mergify[bot] merged 1 commit into
csi-addons:mainfrom
Rakshith-R:fix-scName

Conversation

@Rakshith-R

Copy link
Copy Markdown
Member

pvc.Spec.StorageClassName is a string pointer and can be nil or empty. This commit adds check for both nil and empty.

@iPraveenParihar iPraveenParihar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!


// test for StorageClassName is nil
t.Run("StorageClassName is nil", func(t *testing.T) {
sc.Name = "non-existent-sc"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you pleas remove this line, This is not required for this testcase

@Rakshith-R Rakshith-R requested a review from Madhu-1 September 24, 2024 08:04
@mergify mergify Bot dismissed iPraveenParihar’s stale review September 24, 2024 08:05

Pull request has been modified.

`pvc.Spec.StorageClassName` is a string pointer and can be nil or empty.
This commit adds check for both nil and empty.

Signed-off-by: Rakshith R <rar@redhat.com>
@mergify mergify Bot merged commit df8c048 into csi-addons:main Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants