@@ -83,7 +83,7 @@ func Test_buildSourceBundle(t *testing.T) {
8383 },
8484 "if single ConfigMap source which doesn't exist, return notFoundError" : {
8585 sources : []trustapi.BundleSource {
86- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
86+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
8787 },
8888 objects : []runtime.Object {},
8989 expData : "" ,
@@ -92,7 +92,7 @@ func Test_buildSourceBundle(t *testing.T) {
9292 },
9393 "if single ConfigMap source whose key doesn't exist, return notFoundError" : {
9494 sources : []trustapi.BundleSource {
95- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
95+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
9696 },
9797 objects : []runtime.Object {& corev1.ConfigMap {ObjectMeta : metav1.ObjectMeta {Name : "configmap" }}},
9898 expData : "" ,
@@ -101,7 +101,7 @@ func Test_buildSourceBundle(t *testing.T) {
101101 },
102102 "if single ConfigMap source referencing single key, return data" : {
103103 sources : []trustapi.BundleSource {
104- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
104+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
105105 },
106106 objects : []runtime.Object {& corev1.ConfigMap {
107107 ObjectMeta : metav1.ObjectMeta {Name : "configmap" },
@@ -126,7 +126,7 @@ func Test_buildSourceBundle(t *testing.T) {
126126 "if single ConfigMap source, return data even when order changes" : {
127127 // Test uses the same data as the previous one but with different order
128128 sources : []trustapi.BundleSource {
129- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
129+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
130130 },
131131 objects : []runtime.Object {& corev1.ConfigMap {
132132 ObjectMeta : metav1.ObjectMeta {Name : "configmap" },
@@ -138,7 +138,7 @@ func Test_buildSourceBundle(t *testing.T) {
138138 },
139139 "if selects no ConfigMap sources, should return an error" : {
140140 sources : []trustapi.BundleSource {
141- {ConfigMap : & trustapi.SourceObjectKeySelector {KeySelector : trustapi. KeySelector { Key : "key" } , Selector : & metav1.LabelSelector {MatchLabels : map [string ]string {"selects-nothing" : "true" }}}},
141+ {ConfigMap : & trustapi.SourceObjectKeySelector {Key : "key" , Selector : & metav1.LabelSelector {MatchLabels : map [string ]string {"selects-nothing" : "true" }}}},
142142 },
143143 objects : []runtime.Object {},
144144 expData : "" ,
@@ -147,8 +147,8 @@ func Test_buildSourceBundle(t *testing.T) {
147147 },
148148 "if selects at least one ConfigMap source, return data" : {
149149 sources : []trustapi.BundleSource {
150- {ConfigMap : & trustapi.SourceObjectKeySelector {KeySelector : trustapi. KeySelector { Key : "key" } , Selector : & metav1.LabelSelector {MatchLabels : map [string ]string {"trust-bundle.certs" : "includes" }}}},
151- {ConfigMap : & trustapi.SourceObjectKeySelector {KeySelector : trustapi. KeySelector { Key : "key" } , Selector : & metav1.LabelSelector {MatchLabels : map [string ]string {"selects-nothing" : "true" }}}},
150+ {ConfigMap : & trustapi.SourceObjectKeySelector {Key : "key" , Selector : & metav1.LabelSelector {MatchLabels : map [string ]string {"trust-bundle.certs" : "includes" }}}},
151+ {ConfigMap : & trustapi.SourceObjectKeySelector {Key : "key" , Selector : & metav1.LabelSelector {MatchLabels : map [string ]string {"selects-nothing" : "true" }}}},
152152 },
153153 objects : []runtime.Object {& corev1.ConfigMap {
154154 ObjectMeta : metav1.ObjectMeta {Name : "configmap" , Labels : map [string ]string {"trust-bundle.certs" : "includes" }},
@@ -182,7 +182,7 @@ func Test_buildSourceBundle(t *testing.T) {
182182 },
183183 "if ConfigMap and InLine source, return concatenated data" : {
184184 sources : []trustapi.BundleSource {
185- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
185+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
186186 {InLine : ptr .To (dummy .TestCertificate2 )},
187187 },
188188 objects : []runtime.Object {& corev1.ConfigMap {
@@ -195,7 +195,7 @@ func Test_buildSourceBundle(t *testing.T) {
195195 },
196196 "if single Secret source exists which doesn't exist, should return not found error" : {
197197 sources : []trustapi.BundleSource {
198- {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , KeySelector : trustapi. KeySelector { Key : "key" } }},
198+ {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , Key : "key" }},
199199 },
200200 objects : []runtime.Object {},
201201 expData : "" ,
@@ -204,7 +204,7 @@ func Test_buildSourceBundle(t *testing.T) {
204204 },
205205 "if single Secret source whose key doesn't exist, return notFoundError" : {
206206 sources : []trustapi.BundleSource {
207- {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , KeySelector : trustapi. KeySelector { Key : "key" } }},
207+ {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , Key : "key" }},
208208 },
209209 objects : []runtime.Object {& corev1.Secret {ObjectMeta : metav1.ObjectMeta {Name : "secret" }}},
210210 expData : "" ,
@@ -226,7 +226,7 @@ func Test_buildSourceBundle(t *testing.T) {
226226 },
227227 "if single Secret source referencing single key, return data" : {
228228 sources : []trustapi.BundleSource {
229- {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , KeySelector : trustapi. KeySelector { Key : "key" } }},
229+ {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , Key : "key" }},
230230 },
231231 objects : []runtime.Object {& corev1.Secret {
232232 ObjectMeta : metav1.ObjectMeta {Name : "secret" },
@@ -250,7 +250,7 @@ func Test_buildSourceBundle(t *testing.T) {
250250 },
251251 "if Secret and InLine source, return concatenated data" : {
252252 sources : []trustapi.BundleSource {
253- {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , KeySelector : trustapi. KeySelector { Key : "key" } }},
253+ {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , Key : "key" }},
254254 {InLine : ptr .To (dummy .TestCertificate1 )},
255255 },
256256 objects : []runtime.Object {& corev1.Secret {
@@ -263,9 +263,9 @@ func Test_buildSourceBundle(t *testing.T) {
263263 },
264264 "if Secret, ConfigMap and InLine source, return concatenated data" : {
265265 sources : []trustapi.BundleSource {
266- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
266+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
267267 {InLine : ptr .To (dummy .TestCertificate3 )},
268- {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , KeySelector : trustapi. KeySelector { Key : "key" } }},
268+ {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , Key : "key" }},
269269 },
270270 objects : []runtime.Object {
271271 & corev1.ConfigMap {
@@ -283,8 +283,8 @@ func Test_buildSourceBundle(t *testing.T) {
283283 },
284284 "if source Secret exists, but not ConfigMap, return not found error" : {
285285 sources : []trustapi.BundleSource {
286- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
287- {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , KeySelector : trustapi. KeySelector { Key : "key" } }},
286+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
287+ {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , Key : "key" }},
288288 },
289289 objects : []runtime.Object {
290290 & corev1.ConfigMap {
@@ -298,8 +298,8 @@ func Test_buildSourceBundle(t *testing.T) {
298298 },
299299 "if source ConfigMap exists, but not Secret, return not found error" : {
300300 sources : []trustapi.BundleSource {
301- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
302- {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , KeySelector : trustapi. KeySelector { Key : "key" } }},
301+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
302+ {Secret : & trustapi.SourceObjectKeySelector {Name : "secret" , Key : "key" }},
303303 },
304304 objects : []runtime.Object {
305305 & corev1.Secret {
@@ -358,7 +358,7 @@ func Test_buildSourceBundle(t *testing.T) {
358358 },
359359 "if has JKS target, return binaryData with encoded JKS" : {
360360 sources : []trustapi.BundleSource {
361- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
361+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
362362 },
363363 formats : & trustapi.AdditionalFormats {
364364 JKS : & trustapi.JKS {
@@ -377,7 +377,7 @@ func Test_buildSourceBundle(t *testing.T) {
377377 },
378378 "if has JKS target with arbitrary password, return binaryData with encoded JKS" : {
379379 sources : []trustapi.BundleSource {
380- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
380+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
381381 },
382382 formats : & trustapi.AdditionalFormats {
383383 JKS : & trustapi.JKS {
@@ -397,7 +397,7 @@ func Test_buildSourceBundle(t *testing.T) {
397397 },
398398 "if has PKCS12 target, return binaryData with encoded PKCS12" : {
399399 sources : []trustapi.BundleSource {
400- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
400+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
401401 },
402402 formats : & trustapi.AdditionalFormats {
403403 PKCS12 : & trustapi.PKCS12 {
@@ -416,7 +416,7 @@ func Test_buildSourceBundle(t *testing.T) {
416416 },
417417 "if has PKCS12 target with arbitrary password, return binaryData with encoded PKCS12" : {
418418 sources : []trustapi.BundleSource {
419- {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , KeySelector : trustapi. KeySelector { Key : "key" } }},
419+ {ConfigMap : & trustapi.SourceObjectKeySelector {Name : "configmap" , Key : "key" }},
420420 },
421421 formats : & trustapi.AdditionalFormats {
422422 PKCS12 : & trustapi.PKCS12 {
0 commit comments