@@ -64,7 +64,6 @@ var _ = ginkgo.Describe("[multivc-configsecret] MultiVc-ConfigSecret", func() {
64
64
vCenterPassword string
65
65
vCenterPort string
66
66
dataCenter string
67
- err error
68
67
revertToOriginalVsphereConf bool
69
68
multiVCSetupType string
70
69
allMasterIps []string
@@ -157,7 +156,7 @@ var _ = ginkgo.Describe("[multivc-configsecret] MultiVc-ConfigSecret", func() {
157
156
158
157
if originalVC1PasswordChanged {
159
158
clientIndex := 0
160
- vcAddress , err := readMultiVcAddress (0 )
159
+ vcAddress , _ , err := readMultiVcAddress (0 )
161
160
gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
162
161
username := strings .Split (vCenterUser , "," )[0 ]
163
162
originalPassword := strings .Split (vCenterPassword , "," )[0 ]
@@ -170,7 +169,9 @@ var _ = ginkgo.Describe("[multivc-configsecret] MultiVc-ConfigSecret", func() {
170
169
171
170
if originalVC3PasswordChanged {
172
171
clientIndex2 := 2
173
- vcAddress3 := strings .Split (vCenterIP , "," )[2 ] + ":" + sshdPort
172
+ // reading 3rd vc
173
+ vcAddress3 , _ , err := readMultiVcAddress (2 )
174
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
174
175
username3 := strings .Split (vCenterUser , "," )[2 ]
175
176
originalPassword3 := strings .Split (vCenterPassword , "," )[2 ]
176
177
newPassword3 := "Admin!23"
@@ -244,7 +245,8 @@ var _ = ginkgo.Describe("[multivc-configsecret] MultiVc-ConfigSecret", func() {
244
245
vsphereCfg , err := readVsphereConfSecret (client , ctx , csiNamespace )
245
246
gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
246
247
247
- vcAddress := strings .Split (vsphereCfg .Global .VCenterHostname , "," )[0 ] + ":" + sshdPort
248
+ vcAddress , _ , err := readMultiVcAddress (0 )
249
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
248
250
framework .Logf ("vcAddress - %s " , vcAddress )
249
251
username := strings .Split (vsphereCfg .Global .User , "," )[0 ]
250
252
originalPassword := strings .Split (vsphereCfg .Global .Password , "," )[0 ]
@@ -752,7 +754,8 @@ var _ = ginkgo.Describe("[multivc-configsecret] MultiVc-ConfigSecret", func() {
752
754
}()
753
755
754
756
// read VC1 credentials
755
- vcAddress1 := strings .Split (vsphereCfg .Global .VCenterHostname , "," )[0 ] + ":" + sshdPort
757
+ vcAddress1 , _ , err := readMultiVcAddress (0 )
758
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
756
759
username1 := strings .Split (vsphereCfg .Global .User , "," )[0 ]
757
760
originalPassword1 := strings .Split (vsphereCfg .Global .Password , "," )[0 ]
758
761
newPassword1 := "E2E-test-password!23"
@@ -765,7 +768,8 @@ var _ = ginkgo.Describe("[multivc-configsecret] MultiVc-ConfigSecret", func() {
765
768
766
769
if multiVCSetupType == "multi-3vc-setup" {
767
770
// read VC3 credentials
768
- vcAddress3 = strings .Split (vsphereCfg .Global .VCenterHostname , "," )[2 ] + ":" + sshdPort
771
+ vcAddress3 , _ , err = readMultiVcAddress (2 )
772
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
769
773
username3 = strings .Split (vsphereCfg .Global .User , "," )[2 ]
770
774
originalPassword3 = strings .Split (vsphereCfg .Global .Password , "," )[2 ]
771
775
newPassword3 = "Admin!23"
@@ -848,7 +852,7 @@ var _ = ginkgo.Describe("[multivc-configsecret] MultiVc-ConfigSecret", func() {
848
852
849
853
ginkgo .By ("Rebooting VC2" )
850
854
vCenterHostname := strings .Split (multiVCe2eVSphere .multivcConfig .Global .VCenterHostname , "," )
851
- vcAddress := vCenterHostname [ 1 ] + ":" + sshdPort
855
+ vcAddress , _ , err := readMultiVcAddress ( 1 )
852
856
framework .Logf ("vcAddress - %s " , vcAddress )
853
857
err = invokeVCenterReboot (ctx , vcAddress )
854
858
gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
@@ -919,7 +923,8 @@ var _ = ginkgo.Describe("[multivc-configsecret] MultiVc-ConfigSecret", func() {
919
923
// read original vsphere config secret
920
924
vsphereCfg , err := readVsphereConfSecret (client , ctx , csiNamespace )
921
925
gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
922
- vcAddress := strings .Split (vsphereCfg .Global .VCenterHostname , "," )[0 ] + ":" + sshdPort
926
+ vcAddress , _ , err := readMultiVcAddress (0 )
927
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
923
928
framework .Logf ("vcAddress - %s " , vcAddress )
924
929
username := strings .Split (vsphereCfg .Global .User , "," )[0 ]
925
930
originalPassword := strings .Split (vsphereCfg .Global .Password , "," )[0 ]
0 commit comments