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

Powerflex secret zone validation #833

Merged
merged 21 commits into from
Dec 19, 2024
Merged

Conversation

anathoodell
Copy link
Contributor

@anathoodell anathoodell commented Dec 19, 2024

Description

CSM-Operator Zone Validation function is added to validate zone configuration prior to installation (pre-checks). If the Zone validation fails, the CSM object remains in a failed state.

Validation is limited to the powerflex secret only. No node label checks are done.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#1613

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility
  • I have executed the relevant end-to-end test scenarios

How Has This Been Tested?

Unit tests added and run to maintain coverage numbers. Basic pflex E2E scenarios run as well.

  • Directly on a cluster with 2 nodes.
  • Test B

if zone validation fails - this event is logged in the csm cr.
image

drivers.ExtractZones. Fixed up existing unit-tests to pass around a
proper secret, rather than the "csm" value currently used, as this
causes the ExtractZones() to fail on parsing during unit-testing.
key-value pair.
ZoneValidation function filled in to continue correct zone validation.
Unit Test code updated including infra client List code to match on labels.
node labels anymore. Removing the directly associated unit test code as
well.
Fixing powerflex validate zone code to check that all arrays
have zone detail if there is at least one array with zone detail.
tests/shared/common.go Outdated Show resolved Hide resolved
JacobGros
JacobGros previously approved these changes Dec 19, 2024
Copy link
Contributor

@JacobGros JacobGros left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/drivers/powerflex.go Outdated Show resolved Hide resolved
pkg/drivers/powerflex.go Outdated Show resolved Hide resolved
pkg/drivers/powerflex.go Outdated Show resolved Hide resolved
pkg/drivers/powerflex.go Outdated Show resolved Hide resolved
labelValue or Name are either not specified or are empty values. Cleaned
up test code and added test cases for these scenarios.
pkg/drivers/powerflex.go Outdated Show resolved Hide resolved
@anathoodell anathoodell requested a review from alexemc December 19, 2024 23:06
pkg/drivers/powerflex.go Outdated Show resolved Hide resolved
JacobGros
JacobGros previously approved these changes Dec 19, 2024
@anathoodell anathoodell requested a review from alexemc December 19, 2024 23:22
@anathoodell anathoodell merged commit 57bbb0c into main Dec 19, 2024
7 checks passed
@anathoodell anathoodell deleted the usr/anathoodell/zonevalidation branch December 19, 2024 23:47
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.

5 participants