@@ -81,25 +81,36 @@ var _ = Describe("IPFS Reconciler", func() {
8181 It ("creates a new peer ids" , func () {
8282 fn , _ := ipfsReconciler .SecretConfig (ctx , ipfs , secretConfig , clusterSec , bootstrapKey )
8383 Expect (fn ()).To (BeNil ())
84- expectedKeys := alwaysKeys + (replicas * 2 )
85- Expect (len (secretConfig .Data )).To (Equal (expectedKeys ))
84+ expectedKeys := replicas * 2
85+ // in the real world, StringData will be copied to Data as part of k8s.
86+ // However, we are checking it before it has the opportunity.
87+ Expect (len (secretConfig .Data )).To (Equal (alwaysKeys ))
88+ Expect (len (secretConfig .StringData )).To (Equal (expectedKeys ))
8689
8790 // save this so we can check for changes later.
8891 dataCopy := make (map [string ][]byte )
92+ stringCopy := make (map [string ]string )
8993 for k , v := range secretConfig .Data {
9094 dataCopy [k ] = v
9195 }
96+ for k , v := range secretConfig .StringData {
97+ stringCopy [k ] = v
98+ }
9299
93100 // increase the replica count. Expect to see new keys generated.
94101 ipfs .Spec .Replicas ++
95102 fn , _ = ipfsReconciler .SecretConfig (ctx , ipfs , secretConfig , clusterSec , bootstrapKey )
96103 Expect (fn ()).To (BeNil ())
97- Expect (len (secretConfig .Data )).To (Equal (expectedKeys + 2 ))
104+ Expect (len (secretConfig .Data )).To (Equal (alwaysKeys ))
105+ Expect (len (secretConfig .StringData )).To (Equal (expectedKeys + 2 ))
98106
99107 // expect the old keys to still be the same
100108 for k := range dataCopy {
101109 Expect (dataCopy [k ]).To (Equal (secretConfig .Data [k ]))
102110 }
111+ for k := range stringCopy {
112+ Expect (stringCopy [k ]).To (Equal (secretConfig .StringData [k ]))
113+ }
103114 })
104115 })
105116})
0 commit comments