@@ -529,7 +529,7 @@ func TestPrometheusExporterEnvVars(t *testing.T) {
529529func TestBuildTrustedCAEnvVars (t * testing.T ) {
530530 testCases := []struct {
531531 name string
532- trustedCARef * metal3api.ResourceReference
532+ trustedCARef * metal3api.ResourceReferenceWithKey
533533 configMapData map [string ]string
534534 secretData map [string ][]byte
535535 expectedKey string
@@ -538,10 +538,12 @@ func TestBuildTrustedCAEnvVars(t *testing.T) {
538538 }{
539539 {
540540 name : "ConfigMap with specific key" ,
541- trustedCARef : & metal3api.ResourceReference {
542- Name : "trusted-ca" ,
543- Kind : "ConfigMap" ,
544- Key : "custom-ca.crt" ,
541+ trustedCARef : & metal3api.ResourceReferenceWithKey {
542+ ResourceReference : metal3api.ResourceReference {
543+ Name : "trusted-ca" ,
544+ Kind : "ConfigMap" ,
545+ },
546+ Key : "custom-ca.crt" ,
545547 },
546548 configMapData : map [string ]string {
547549 "custom-ca.crt" : "cert1" ,
@@ -552,10 +554,12 @@ func TestBuildTrustedCAEnvVars(t *testing.T) {
552554 },
553555 {
554556 name : "Secret with specific key" ,
555- trustedCARef : & metal3api.ResourceReference {
556- Name : "trusted-ca-secret" ,
557- Kind : "Secret" ,
558- Key : "tls.crt" ,
557+ trustedCARef : & metal3api.ResourceReferenceWithKey {
558+ ResourceReference : metal3api.ResourceReference {
559+ Name : "trusted-ca-secret" ,
560+ Kind : "Secret" ,
561+ },
562+ Key : "tls.crt" ,
559563 },
560564 secretData : map [string ][]byte {
561565 "tls.crt" : []byte ("cert1" ),
@@ -566,10 +570,12 @@ func TestBuildTrustedCAEnvVars(t *testing.T) {
566570 },
567571 {
568572 name : "Key specified but doesn't exist - ConfigMap" ,
569- trustedCARef : & metal3api.ResourceReference {
570- Name : "trusted-ca" ,
571- Kind : "ConfigMap" ,
572- Key : "nonexistent.crt" ,
573+ trustedCARef : & metal3api.ResourceReferenceWithKey {
574+ ResourceReference : metal3api.ResourceReference {
575+ Name : "trusted-ca" ,
576+ Kind : "ConfigMap" ,
577+ },
578+ Key : "nonexistent.crt" ,
573579 },
574580 configMapData : map [string ]string {
575581 "actual-ca.crt" : "cert1" ,
@@ -580,10 +586,12 @@ func TestBuildTrustedCAEnvVars(t *testing.T) {
580586 },
581587 {
582588 name : "Key specified but doesn't exist - Secret" ,
583- trustedCARef : & metal3api.ResourceReference {
584- Name : "trusted-ca-secret" ,
585- Kind : "Secret" ,
586- Key : "missing.crt" ,
589+ trustedCARef : & metal3api.ResourceReferenceWithKey {
590+ ResourceReference : metal3api.ResourceReference {
591+ Name : "trusted-ca-secret" ,
592+ Kind : "Secret" ,
593+ },
594+ Key : "missing.crt" ,
587595 },
588596 secretData : map [string ][]byte {
589597 "available.crt" : []byte ("cert1" ),
@@ -594,9 +602,11 @@ func TestBuildTrustedCAEnvVars(t *testing.T) {
594602 },
595603 {
596604 name : "Multiple keys without Key specified - ConfigMap" ,
597- trustedCARef : & metal3api.ResourceReference {
598- Name : "trusted-ca" ,
599- Kind : "ConfigMap" ,
605+ trustedCARef : & metal3api.ResourceReferenceWithKey {
606+ ResourceReference : metal3api.ResourceReference {
607+ Name : "trusted-ca" ,
608+ Kind : "ConfigMap" ,
609+ },
600610 },
601611 configMapData : map [string ]string {
602612 "ca1.crt" : "cert1" ,
@@ -712,10 +722,12 @@ func TestBuildTrustedCAEnvVarsKeySelection(t *testing.T) {
712722 Logger : logr .Discard (),
713723 }
714724
715- trustedCARef := & metal3api.ResourceReference {
716- Name : "test-ca" ,
717- Kind : "ConfigMap" ,
718- Key : tc .specifiedKey ,
725+ trustedCARef := & metal3api.ResourceReferenceWithKey {
726+ ResourceReference : metal3api.ResourceReference {
727+ Name : "test-ca" ,
728+ Kind : "ConfigMap" ,
729+ },
730+ Key : tc .specifiedKey ,
719731 }
720732
721733 data := make (map [string ]string )
0 commit comments