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

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

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

Rakshith-R
Copy link
Member

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

Copy link
Member

@iPraveenParihar iPraveenParihar left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -323,6 +323,15 @@ func TestDetermineScheduleAndRequeue(t *testing.T) {
assert.Equal(t, "", schedule)
})

// test for StorageClassName is nil
t.Run("StorageClassName is nil", func(t *testing.T) {
sc.Name = "non-existent-sc"
Copy link
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
15 checks passed
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