@@ -22,7 +22,7 @@ import (
22
22
cryptorand "crypto/rand"
23
23
"testing"
24
24
25
- certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1 "
25
+ certificatesv1beta1 "k8s.io/api/certificates/v1beta1 "
26
26
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
27
27
"k8s.io/apimachinery/pkg/runtime"
28
28
"k8s.io/apiserver/pkg/server/dynamiccertificates"
@@ -44,7 +44,7 @@ func TestCTBPublisherSync(t *testing.T) {
44
44
45
45
createAction := expectAction [clienttesting.CreateAction ](t , filteredActions [0 ], "create" )
46
46
47
- ctb , ok := createAction .GetObject ().(* certificatesv1alpha1 .ClusterTrustBundle )
47
+ ctb , ok := createAction .GetObject ().(* certificatesv1beta1 .ClusterTrustBundle )
48
48
if ! ok {
49
49
t .Fatalf ("expected ClusterTrustBundle create, got %v" , createAction .GetObject ())
50
50
}
@@ -63,7 +63,7 @@ func TestCTBPublisherSync(t *testing.T) {
63
63
64
64
updateAction := expectAction [clienttesting.UpdateAction ](t , filteredActions [0 ], "update" )
65
65
66
- ctb , ok := updateAction .GetObject ().(* certificatesv1alpha1 .ClusterTrustBundle )
66
+ ctb , ok := updateAction .GetObject ().(* certificatesv1beta1 .ClusterTrustBundle )
67
67
if ! ok {
68
68
t .Fatalf ("expected ClusterTrustBundle update, got %v" , updateAction .GetObject ())
69
69
}
@@ -109,19 +109,19 @@ func TestCTBPublisherSync(t *testing.T) {
109
109
{
110
110
name : "no CTBs for the current signer exist" ,
111
111
existingCTBs : []runtime.Object {
112
- & certificatesv1alpha1 .ClusterTrustBundle {
112
+ & certificatesv1beta1 .ClusterTrustBundle {
113
113
ObjectMeta : metav1.ObjectMeta {
114
114
Name : "nosigner" ,
115
115
},
116
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
116
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
117
117
TrustBundle : "somedatahere" ,
118
118
},
119
119
},
120
- & certificatesv1alpha1 .ClusterTrustBundle {
120
+ & certificatesv1beta1 .ClusterTrustBundle {
121
121
ObjectMeta : metav1.ObjectMeta {
122
122
Name : "signer:one" ,
123
123
},
124
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
124
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
125
125
SignerName : "signer" ,
126
126
TrustBundle : "signerdata" ,
127
127
},
@@ -132,11 +132,11 @@ func TestCTBPublisherSync(t *testing.T) {
132
132
{
133
133
name : "CTB for the signer exists with different content" ,
134
134
existingCTBs : []runtime.Object {
135
- & certificatesv1alpha1 .ClusterTrustBundle {
135
+ & certificatesv1beta1 .ClusterTrustBundle {
136
136
ObjectMeta : metav1.ObjectMeta {
137
137
Name : testBundleName ,
138
138
},
139
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
139
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
140
140
SignerName : testSignerName ,
141
141
TrustBundle : "olddata" ,
142
142
},
@@ -147,20 +147,20 @@ func TestCTBPublisherSync(t *testing.T) {
147
147
{
148
148
name : "multiple CTBs for the signer" ,
149
149
existingCTBs : []runtime.Object {
150
- & certificatesv1alpha1 .ClusterTrustBundle {
150
+ & certificatesv1beta1 .ClusterTrustBundle {
151
151
ObjectMeta : metav1.ObjectMeta {
152
152
Name : testBundleName ,
153
153
},
154
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
154
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
155
155
SignerName : testSignerName ,
156
156
TrustBundle : string (testCAProvider .CurrentCABundleContent ()),
157
157
},
158
158
},
159
- & certificatesv1alpha1 .ClusterTrustBundle {
159
+ & certificatesv1beta1 .ClusterTrustBundle {
160
160
ObjectMeta : metav1.ObjectMeta {
161
161
Name : "test.test/testSigner:name2" ,
162
162
},
163
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
163
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
164
164
SignerName : testSignerName ,
165
165
TrustBundle : string (testCAProvider .CurrentCABundleContent ()),
166
166
},
@@ -171,20 +171,20 @@ func TestCTBPublisherSync(t *testing.T) {
171
171
{
172
172
name : "multiple CTBs for the signer - the one with the proper name needs changing" ,
173
173
existingCTBs : []runtime.Object {
174
- & certificatesv1alpha1 .ClusterTrustBundle {
174
+ & certificatesv1beta1 .ClusterTrustBundle {
175
175
ObjectMeta : metav1.ObjectMeta {
176
176
Name : testBundleName ,
177
177
},
178
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
178
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
179
179
SignerName : testSignerName ,
180
180
TrustBundle : "olddata" ,
181
181
},
182
182
},
183
- & certificatesv1alpha1 .ClusterTrustBundle {
183
+ & certificatesv1beta1 .ClusterTrustBundle {
184
184
ObjectMeta : metav1.ObjectMeta {
185
185
Name : "test.test/testSigner:name2" ,
186
186
},
187
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
187
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
188
188
SignerName : testSignerName ,
189
189
TrustBundle : string (testCAProvider .CurrentCABundleContent ()),
190
190
},
@@ -202,11 +202,11 @@ func TestCTBPublisherSync(t *testing.T) {
202
202
{
203
203
name : "another CTB with a different name exists for the signer" ,
204
204
existingCTBs : []runtime.Object {
205
- & certificatesv1alpha1 .ClusterTrustBundle {
205
+ & certificatesv1beta1 .ClusterTrustBundle {
206
206
ObjectMeta : metav1.ObjectMeta {
207
207
Name : "test.test/testSigner:preexisting" ,
208
208
},
209
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
209
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
210
210
SignerName : testSignerName ,
211
211
TrustBundle : string (testCAProvider .CurrentCABundleContent ()),
212
212
},
@@ -224,28 +224,28 @@ func TestCTBPublisherSync(t *testing.T) {
224
224
{
225
225
name : "CTB at the correct state - noop" ,
226
226
existingCTBs : []runtime.Object {
227
- & certificatesv1alpha1 .ClusterTrustBundle {
227
+ & certificatesv1beta1 .ClusterTrustBundle {
228
228
ObjectMeta : metav1.ObjectMeta {
229
229
Name : "nosigner" ,
230
230
},
231
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
231
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
232
232
TrustBundle : "somedatahere" ,
233
233
},
234
234
},
235
- & certificatesv1alpha1 .ClusterTrustBundle {
235
+ & certificatesv1beta1 .ClusterTrustBundle {
236
236
ObjectMeta : metav1.ObjectMeta {
237
237
Name : "signer:one" ,
238
238
},
239
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
239
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
240
240
SignerName : "signer" ,
241
241
TrustBundle : "signerdata" ,
242
242
},
243
243
},
244
- & certificatesv1alpha1 .ClusterTrustBundle {
244
+ & certificatesv1beta1 .ClusterTrustBundle {
245
245
ObjectMeta : metav1.ObjectMeta {
246
246
Name : testBundleName ,
247
247
},
248
- Spec : certificatesv1alpha1 .ClusterTrustBundleSpec {
248
+ Spec : certificatesv1beta1 .ClusterTrustBundleSpec {
249
249
SignerName : testSignerName ,
250
250
TrustBundle : string (testCAProvider .CurrentCABundleContent ()),
251
251
},
@@ -297,9 +297,9 @@ func fakeKubeClientSetWithCTBList(t *testing.T, signerName string, ctbs ...runti
297
297
return false , nil , nil
298
298
}
299
299
300
- retList := & certificatesv1alpha1 .ClusterTrustBundleList {}
300
+ retList := & certificatesv1beta1 .ClusterTrustBundleList {}
301
301
for _ , ctb := range ctbs {
302
- ctbObj , ok := ctb .(* certificatesv1alpha1 .ClusterTrustBundle )
302
+ ctbObj , ok := ctb .(* certificatesv1beta1 .ClusterTrustBundle )
303
303
if ! ok {
304
304
continue
305
305
}
0 commit comments