Skip to content

Commit

Permalink
Clarify which secret is for which unisphere in reverseproxy configmap (
Browse files Browse the repository at this point in the history
…#366)

* use more intuitive secret names in config.yaml

* Update config.yaml

* Update actions.yaml

* golangci-lint warning - cap name is already used for builtin

* golangci-lint warning - max name is already used for builtin

* updated secret names

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* Update powermax_test.go

* go fmt fixes

---------

Co-authored-by: niranjan-n1 <niranjan.n1@dell.com>
  • Loading branch information
jooseppi-luna and niranjan-n1 authored Nov 13, 2024
1 parent 7531ec4 commit 9d70b9f
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v4
- name: Run the formatter, linter, and vetter
uses: dell/common-github-actions/go-code-formatter-linter-vetter@main
uses: dell/common-github-actions/go-code-formatter-vetter@main
with:
directories: ./...
test:
Expand Down
16 changes: 8 additions & 8 deletions csireverseproxy/deploy/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ standAloneConfig:
primaryURL: https://primary-1.unisphe.re:8443
backupURL: https://backup-1.unisphe.re:8443
proxyCredentialSecrets:
- proxy-secret-11
- proxy-secret-12
- primary-unisphere-secret-1
- backup-unisphere-secret-1
- storageArrayId: "000000000002"
primaryURL: https://primary-2.unisphe.re:8443
backupURL: https://backup-2.unisphe.re:8443
proxyCredentialSecrets:
- proxy-secret-21
- proxy-secret-22
- primary-unisphere-secret-2
- backup-unisphere-secret-2
managementServers:
- url: https://primary-1.unisphe.re:8443
arrayCredentialSecret: primary-1-secret
arrayCredentialSecret: primary-unisphere-secret-1
skipCertificateValidation: true
- url: https://backup-1.unisphe.re:8443
arrayCredentialSecret: backup-1-secret
arrayCredentialSecret: backup-unisphere-secret-1
skipCertificateValidation: false
- url: https://primary-2.unisphe.re:8443
arrayCredentialSecret: primary-2-secret
arrayCredentialSecret: primary-unisphere-secret-2
skipCertificateValidation: true
- url: https://backup-2.unisphe.re:8443
arrayCredentialSecret: backup-2-secret
arrayCredentialSecret: backup-unisphere-secret-2
skipCertificateValidation: false
16 changes: 8 additions & 8 deletions csireverseproxy/test-config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ standAloneConfig:
primaryURL: https://primary-1.unisphe.re:8443
backupURL: https://backup-1.unisphe.re:8443
proxyCredentialSecrets:
- proxy-secret-11
- proxy-secret-12
- primary-unisphere-secret-1
- backup-unisphere-secret-1
- storageArrayId: "000000000002"
primaryURL: https://primary-2.unisphe.re:8443
backupURL: https://backup-2.unisphe.re:8443
proxyCredentialSecrets:
- proxy-secret-21
- proxy-secret-22
- primary-unisphere-secret-2
- backup-unisphere-secret-2
managementServers:
- url: https://primary-1.unisphe.re:8443
arrayCredentialSecret: primary-1-secret
arrayCredentialSecret: primary-unisphere-secret-1
skipCertificateValidation: true
- url: https://backup-1.unisphe.re:8443
arrayCredentialSecret: backup-1-secret
arrayCredentialSecret: backup-unisphere-secret-1
skipCertificateValidation: false
- url: https://primary-2.unisphe.re:8443
arrayCredentialSecret: primary-2-secret
arrayCredentialSecret: primary-unisphere-secret-2
skipCertificateValidation: true
- url: https://backup-2.unisphe.re:8443
arrayCredentialSecret: backup-2-secret
arrayCredentialSecret: backup-unisphere-secret-2
skipCertificateValidation: false
4 changes: 2 additions & 2 deletions pkg/symmetrix/powermax.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ type ReplicationCapabilitiesCache struct {
time CacheTime
}

func (rep *ReplicationCapabilitiesCache) update(cap *types.SymmetrixCapability) {
rep.cap = cap
func (rep *ReplicationCapabilitiesCache) update(capability *types.SymmetrixCapability) {
rep.cap = capability
rep.time.Set(SnapLicenseCacheValidity)
}

Expand Down
21 changes: 21 additions & 0 deletions pkg/symmetrix/powermax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"testing"

pmax "github.com/dell/gopowermax/v2"
types "github.com/dell/gopowermax/v2/types/v100"
)

func TestGetPowerMaxClient(t *testing.T) {
Expand Down Expand Up @@ -53,3 +54,23 @@ func TestGetPowerMaxClient(t *testing.T) {
t.Errorf("Should have failed with none of the arrays managed")
}
}

// ctx context.Context, client pmax.Pmax, symID string
func TestUpdate(t *testing.T) {
symmetrixCapability := types.SymmetrixCapability{
SymmetrixID: "fakeSymmetrix",
SnapVxCapable: true,
RdfCapable: true,
}
rep := ReplicationCapabilitiesCache{}
rep.update(&symmetrixCapability)
if rep.cap.SymmetrixID != "fakeSymmetrix" {
t.Errorf("update call failed -- SymmetrixID not set properly in capability: cap.SymmetrixID: %+v", rep.cap.SymmetrixID)
if !rep.cap.SnapVxCapable {
t.Errorf("update call failed -- SnapVxCapable not set properly in capability: cap.SnapVxCapable: %+v", rep.cap.SnapVxCapable)
if !rep.cap.RdfCapable {
t.Errorf("update call failed -- RdfCapable not set properly in capability: cap.RdfCapable: %+v", rep.cap.RdfCapable)
}
}
}
}
8 changes: 4 additions & 4 deletions test/integration/step_defs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1542,11 +1542,11 @@ func (f *feature) allVolumesAreDeletedSuccessfully() error {
symVolumeID := idComponents[len(idComponents)-1]
symID := idComponents[len(idComponents)-2]
fmt.Printf("Waiting for volume %s %s to be deleted\n", id, symVolumeID)
max := 40 * nVols
if 300 > max {
max = 300
maxVols := 40 * nVols
if 300 > maxVols {
maxVols = 300
}
for i := 0; i < max; i++ {
for i := 0; i < maxVols; i++ {
vol, err := f.pmaxClient.GetVolumeByID(context.Background(), symID, symVolumeID)
if vol == nil {
deleted = strings.Contains(err.Error(), "Could not find")
Expand Down

0 comments on commit 9d70b9f

Please sign in to comment.