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

Read zone information from PowerFlex secret #810

Merged
merged 6 commits into from
Dec 5, 2024

Conversation

EvgenyUglov
Copy link
Contributor

@EvgenyUglov EvgenyUglov commented Dec 3, 2024

Description

PR adds the method to read the zoning information from the PowerFlex array secret

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?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • unit tests
# go test ./... -cover -count=1
        github.com/dell/csm-operator/api/v1             coverage: 0.0% of statements
        github.com/dell/csm-operator            coverage: 0.0% of statements
        github.com/dell/csm-operator/core/semver                coverage: 0.0% of statements
?       github.com/dell/csm-operator/pkg/constants      [no test files]
        github.com/dell/csm-operator/core               coverage: 0.0% of statements
        github.com/dell/csm-operator/pkg/logger         coverage: 0.0% of statements
        github.com/dell/csm-operator/tests/shared               coverage: 0.0% of statements
        github.com/dell/csm-operator/tests/shared/clientgoclient                coverage: 0.0% of statements
        github.com/dell/csm-operator/tests/shared/crclient              coverage: 0.0% of statements
ok      github.com/dell/csm-operator/controllers        55.024s coverage: 89.1% of statements
ok      github.com/dell/csm-operator/k8s        0.068s  coverage: 90.3% of statements
ok      github.com/dell/csm-operator/pkg/drivers        0.234s  coverage: 96.1% of statements
ok      github.com/dell/csm-operator/pkg/modules        2.153s  coverage: 89.7% of statements
ok      github.com/dell/csm-operator/pkg/resources/configmap    0.032s  coverage: 100.0% of statements
ok      github.com/dell/csm-operator/pkg/resources/csidriver    0.093s  coverage: 100.0% of statements
ok      github.com/dell/csm-operator/pkg/resources/daemonset    0.117s  coverage: 100.0% of statements
ok      github.com/dell/csm-operator/pkg/resources/deployment   0.114s  coverage: 100.0% of statements
ok      github.com/dell/csm-operator/pkg/resources/rbac 0.041s  coverage: 100.0% of statements
ok      github.com/dell/csm-operator/pkg/resources/serviceaccount       0.025s  coverage: 100.0% of statements
ok      github.com/dell/csm-operator/pkg/utils  3.110s  coverage: 81.9% of statements
  • E2E tests (PowerFlex standalone tests only, since new function isn't used anywhere yet)
    image

pflex-e2e-suite-standalone.txt

@EvgenyUglov EvgenyUglov changed the title Pub/powerflex zone from secret Read zone information from PowerFlex secret Dec 3, 2024
Comment on lines 359 to 363
type StorageArrayConfig struct {
SystemID string `json:"systemId"`
Zone struct {
Label string `json:"label"`
} `json:"zone"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Zones in the secret will have both the 'name' and the 'label' fields, right? Do we need to keep track of both of those?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, right, confirmed with Trevor. Was confused with a different acceptance criteria:

zone:
  label: <user defined label name>=<zone name>

Fixed. Also, fixed the AC.

Comment on lines 220 to 221
zone:
label: topology.kubernetes.io/zone=US-EAST
Copy link
Contributor

Choose a reason for hiding this comment

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

Secret should have both 'labelKey' and 'name' fields, I think-- check with @tdawe or double-check the latest proposed spec

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right. Thanks! confirmed with Trevor. Was confused with a different acceptance criteria:
Fixed. Also, fixed the AC.

if configParam.SystemID == "" {
return nil, fmt.Errorf("invalid value for SystemID")
}
if configParam.Zone.Label != "" {
Copy link
Contributor

@ChristianAtDell ChristianAtDell Dec 5, 2024

Choose a reason for hiding this comment

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

I think that your code is accessing the secret as if it only has one field, and that field is in the format of "<labelkey>=<zone name>"? Which is what my other two comments are referring to. But I don't believe that's the structure of the proposed zoning secrets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@gallacher gallacher left a comment

Choose a reason for hiding this comment

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

LGTM

@EvgenyUglov EvgenyUglov merged commit e87631b into main Dec 5, 2024
7 checks passed
@EvgenyUglov EvgenyUglov deleted the pub/powerflex-zone-from-secret branch December 5, 2024 21:21
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.

4 participants