Skip to content

Conversation

synhershko
Copy link

This fix resolves an issue where setting storageClassName: "" in the PVC configuration was incorrectly ignored, causing the operator to use the default StorageClass instead of disabling dynamic provisioning as per Kubernetes specifications.

Fixes
#1096

Updated the logic to always return a pointer to the storageClassName when persistence is configured, allowing proper differentiation between:

  • No persistence specified → nil (uses default StorageClass)
  • storageClass: "" → &"" (disables dynamic provisioning)
  • storageClass: "my-class" → &"my-class" (uses specific class)

Related to commit 0bea273 which originally introduced the problematic check.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

This fix resolves an issue where setting `storageClassName: ""` in the
PVC configuration was incorrectly ignored, causing the operator to use
the default StorageClass instead of disabling dynamic provisioning as
per Kubernetes specifications.

Fixes
opensearch-project#1096

Updated the logic to always return a pointer to the storageClassName
when persistence is configured, allowing proper differentiation between:
- No persistence specified → nil (uses default StorageClass)
- storageClass: "" → &"" (disables dynamic provisioning)
- storageClass: "my-class" → &"my-class" (uses specific class)

Related to commit 0bea273 which
originally introduced the problematic check.

Signed-off-by: Itamar Syn-Hershko <[email protected]>

Choose a reason for hiding this comment

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

Could you explain why we need a separate test file for SC handling again? I think new tests you added in cluster_test.go is enough.

Signed-off-by: josedev-union <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants