@@ -32,6 +32,8 @@ const (
3232 kindCredentialsReq = "CredentialsRequest"
3333 ccoSecretName = "test-release-cloud-creds"
3434 ccoNamespace = "openshift-cloud-credential-operator"
35+ testBucket = "trustify-storage"
36+ testRegionUSEast1 = "us-east-1"
3537)
3638
3739func testDatabaseValues () map [string ]interface {} {
@@ -45,7 +47,7 @@ func testDatabaseValues() map[string]interface{} {
4547
4648func awsValues () map [string ]interface {} {
4749 return map [string ]interface {}{
48- fieldAppDomain : testAppDomain ,
50+ fieldAppDomain : testAppDomain ,
4951 fieldCloudProvider : "aws" ,
5052 fieldCloudCredentials : map [string ]interface {}{
5153 "aws" : map [string ]interface {}{
@@ -58,20 +60,20 @@ func awsValues() map[string]interface{} {
5860 },
5961 },
6062 },
61- "storage" : map [string ]interface {}{
62- "type" : "s3" ,
63- "bucket" : "trustify-storage" ,
64- "region" : "us-east-1" ,
63+ fieldStorage : map [string ]interface {}{
64+ fieldType : "s3" ,
65+ fieldBucket : testBucket ,
66+ fieldRegion : testRegionUSEast1 ,
6567 },
66- "database" : testDatabaseValues (),
67- "metrics" : map [string ]interface {}{fieldEnabled : false },
68- "tracing" : map [string ]interface {}{fieldEnabled : false },
68+ fieldDatabase : testDatabaseValues (),
69+ fieldMetrics : map [string ]interface {}{fieldEnabled : false },
70+ fieldTracing : map [string ]interface {}{fieldEnabled : false },
6971 }
7072}
7173
7274func gcpValues () map [string ]interface {} {
7375 return map [string ]interface {}{
74- fieldAppDomain : testAppDomain ,
76+ fieldAppDomain : testAppDomain ,
7577 fieldCloudProvider : "gcp" ,
7678 fieldCloudCredentials : map [string ]interface {}{
7779 "gcp" : map [string ]interface {}{
@@ -83,14 +85,14 @@ func gcpValues() map[string]interface{} {
8385 },
8486 },
8587 },
86- "storage" : map [string ]interface {}{
87- "type" : "s3" ,
88- "bucket" : "trustify-storage" ,
89- "region" : "us-central1" ,
88+ fieldStorage : map [string ]interface {}{
89+ fieldType : "s3" ,
90+ fieldBucket : testBucket ,
91+ fieldRegion : "us-central1" ,
9092 },
91- "database" : testDatabaseValues (),
92- "metrics" : map [string ]interface {}{fieldEnabled : false },
93- "tracing" : map [string ]interface {}{fieldEnabled : false },
93+ fieldDatabase : testDatabaseValues (),
94+ fieldMetrics : map [string ]interface {}{fieldEnabled : false },
95+ fieldTracing : map [string ]interface {}{fieldEnabled : false },
9496 }
9597}
9698
@@ -167,7 +169,8 @@ func TestHelmRenderAWSCredentialsRequest(t *testing.T) {
167169 providerSpec , _ := spec ["providerSpec" ].(map [string ]interface {})
168170 require .NotNil (t , providerSpec , "providerSpec should exist" )
169171 assert .Equal (t , "AWSProviderSpec" , providerSpec ["kind" ], "providerSpec should be AWSProviderSpec" )
170- assert .Equal (t , "cloudcredential.openshift.io/v1" , providerSpec [fieldAPIVersion ], "providerSpec apiVersion should match" )
172+ assert .Equal (t , "cloudcredential.openshift.io/v1" ,
173+ providerSpec [fieldAPIVersion ], "providerSpec apiVersion should match" )
171174
172175 entries , ok := providerSpec ["statementEntries" ].([]interface {})
173176 assert .True (t , ok , "statementEntries should be a list" )
@@ -217,16 +220,16 @@ func TestHelmRenderNoCredentialsRequestWithoutCloudProvider(t *testing.T) {
217220 chartPath := getChartPath (t )
218221 values := map [string ]interface {}{
219222 fieldAppDomain : testAppDomain ,
220- "storage" : map [string ]interface {}{
221- "type" : "s3" ,
222- "bucket" : "test-bucket" ,
223- "region" : "us-east-1" ,
223+ fieldStorage : map [string ]interface {}{
224+ fieldType : "s3" ,
225+ fieldBucket : "test-bucket" ,
226+ fieldRegion : testRegionUSEast1 ,
224227 "accessKey" : "test-key" ,
225228 "secretKey" : "test-secret" ,
226229 },
227- "database" : testDatabaseValues (),
228- "metrics" : map [string ]interface {}{fieldEnabled : false },
229- "tracing" : map [string ]interface {}{fieldEnabled : false },
230+ fieldDatabase : testDatabaseValues (),
231+ fieldMetrics : map [string ]interface {}{fieldEnabled : false },
232+ fieldTracing : map [string ]interface {}{fieldEnabled : false },
230233 }
231234
232235 rendered := renderHelmChart (t , chartPath , values )
@@ -314,16 +317,16 @@ func TestHelmRenderStorageEnvVarsWithoutCCO(t *testing.T) {
314317 chartPath := getChartPath (t )
315318 values := map [string ]interface {}{
316319 fieldAppDomain : testAppDomain ,
317- "storage" : map [string ]interface {}{
318- "type" : "s3" ,
319- "bucket" : "trustify-storage" ,
320- "region" : "us-east-1" ,
320+ fieldStorage : map [string ]interface {}{
321+ fieldType : "s3" ,
322+ fieldBucket : testBucket ,
323+ fieldRegion : testRegionUSEast1 ,
321324 "accessKey" : "explicit-access-key" ,
322325 "secretKey" : "explicit-secret-key" ,
323326 },
324- "database" : testDatabaseValues (),
325- "metrics" : map [string ]interface {}{fieldEnabled : false },
326- "tracing" : map [string ]interface {}{fieldEnabled : false },
327+ fieldDatabase : testDatabaseValues (),
328+ fieldMetrics : map [string ]interface {}{fieldEnabled : false },
329+ fieldTracing : map [string ]interface {}{fieldEnabled : false },
327330 }
328331
329332 rendered := renderHelmChart (t , chartPath , values )
0 commit comments