@@ -28,6 +28,7 @@ import (
28
28
rbacclientv1 "k8s.io/client-go/kubernetes/typed/rbac/v1"
29
29
rbacclientv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1"
30
30
"k8s.io/client-go/rest"
31
+ "k8s.io/klog/v2"
31
32
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
32
33
apiregistrationv1beta1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1"
33
34
apiregistrationclientv1 "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1"
@@ -82,17 +83,20 @@ func (b *builder) WithModifier(f MetaV1ObjectModifierFunc) Interface {
82
83
}
83
84
84
85
func (b * builder ) Do (ctx context.Context ) error {
86
+ klog .Infof ("!!!! builder Do" )
85
87
obj := resourceread .ReadOrDie (b .raw )
86
88
87
89
switch typedObject := obj .(type ) {
88
90
case * securityv1.SecurityContextConstraints :
91
+ //klog.Infof("!!!! securityv1.SecurityContextConstraints: %s", typedObject.Name)
89
92
if b .modifier != nil {
90
93
b .modifier (typedObject )
91
94
}
92
95
if _ , _ , err := resourceapply .ApplySecurityContextConstraintsv1 (ctx , b .securityClientv1 , typedObject ); err != nil {
93
96
return err
94
97
}
95
98
case * appsv1.DaemonSet :
99
+ //klog.Infof("!!!! appsv1.DaemonSet: %s", typedObject.Name)
96
100
if b .modifier != nil {
97
101
b .modifier (typedObject )
98
102
}
@@ -104,6 +108,7 @@ func (b *builder) Do(ctx context.Context) error {
104
108
}
105
109
return b .checkDaemonSetHealth (ctx , typedObject )
106
110
case * appsv1.Deployment :
111
+ //klog.Infof("!!!! appsv1.Deployment: %s", typedObject.Name)
107
112
if b .modifier != nil {
108
113
b .modifier (typedObject )
109
114
}
@@ -115,6 +120,7 @@ func (b *builder) Do(ctx context.Context) error {
115
120
}
116
121
return b .checkDeploymentHealth (ctx , typedObject )
117
122
case * batchv1.Job :
123
+ //klog.Infof("!!!! batchv1.Job: %s", typedObject.Name)
118
124
if b .modifier != nil {
119
125
b .modifier (typedObject )
120
126
}
@@ -123,111 +129,127 @@ func (b *builder) Do(ctx context.Context) error {
123
129
}
124
130
return b .checkJobHealth (ctx , typedObject )
125
131
case * corev1.ConfigMap :
132
+ //klog.Infof("!!!! corev1.ConfigMap: %s", typedObject.Name)
126
133
if b .modifier != nil {
127
134
b .modifier (typedObject )
128
135
}
129
136
if _ , _ , err := resourceapply .ApplyConfigMapv1 (ctx , b .coreClientv1 , typedObject ); err != nil {
130
137
return err
131
138
}
132
139
case * corev1.Namespace :
140
+ //klog.Infof("!!!! corev1.Namespace: %s", typedObject.Name)
133
141
if b .modifier != nil {
134
142
b .modifier (typedObject )
135
143
}
136
144
if _ , _ , err := resourceapply .ApplyNamespacev1 (ctx , b .coreClientv1 , typedObject ); err != nil {
137
145
return err
138
146
}
139
147
case * corev1.Service :
148
+ //klog.Infof("!!!! corev1.Service: %s", typedObject.Name)
140
149
if b .modifier != nil {
141
150
b .modifier (typedObject )
142
151
}
143
152
if _ , _ , err := resourceapply .ApplyServicev1 (ctx , b .coreClientv1 , typedObject ); err != nil {
144
153
return err
145
154
}
146
155
case * corev1.ServiceAccount :
156
+ //klog.Infof("!!!! corev1.ServiceAccount: %s", typedObject.Name)
147
157
if b .modifier != nil {
148
158
b .modifier (typedObject )
149
159
}
150
160
if _ , _ , err := resourceapply .ApplyServiceAccountv1 (ctx , b .coreClientv1 , typedObject ); err != nil {
151
161
return err
152
162
}
153
163
case * rbacv1.ClusterRole :
164
+ //klog.Infof("!!!! rbacv1.ClusterRole: %s", typedObject.Name)
154
165
if b .modifier != nil {
155
166
b .modifier (typedObject )
156
167
}
157
168
if _ , _ , err := resourceapply .ApplyClusterRolev1 (ctx , b .rbacClientv1 , typedObject ); err != nil {
158
169
return err
159
170
}
160
171
case * rbacv1.ClusterRoleBinding :
172
+ //klog.Infof("!!!! rbacv1.ClusterRoleBinding: %s", typedObject.Name)
161
173
if b .modifier != nil {
162
174
b .modifier (typedObject )
163
175
}
164
176
if _ , _ , err := resourceapply .ApplyClusterRoleBindingv1 (ctx , b .rbacClientv1 , typedObject ); err != nil {
165
177
return err
166
178
}
167
179
case * rbacv1.Role :
180
+ //klog.Infof("!!!! rbacv1.Role: %s", typedObject.Name)
168
181
if b .modifier != nil {
169
182
b .modifier (typedObject )
170
183
}
171
184
if _ , _ , err := resourceapply .ApplyRolev1 (ctx , b .rbacClientv1 , typedObject ); err != nil {
172
185
return err
173
186
}
174
187
case * rbacv1.RoleBinding :
188
+ //klog.Infof("!!!! rbacv1.RoleBinding: %s", typedObject.Name)
175
189
if b .modifier != nil {
176
190
b .modifier (typedObject )
177
191
}
178
192
if _ , _ , err := resourceapply .ApplyRoleBindingv1 (ctx , b .rbacClientv1 , typedObject ); err != nil {
179
193
return err
180
194
}
181
195
case * rbacv1beta1.ClusterRole :
196
+ //klog.Infof("!!!! rbacv1beta1.ClusterRole: %s", typedObject.Name)
182
197
if b .modifier != nil {
183
198
b .modifier (typedObject )
184
199
}
185
200
if _ , _ , err := resourceapply .ApplyClusterRolev1beta1 (ctx , b .rbacClientv1beta1 , typedObject ); err != nil {
186
201
return err
187
202
}
188
203
case * rbacv1beta1.ClusterRoleBinding :
204
+ //klog.Infof("!!!! rbacv1beta1.ClusterRoleBinding: %s", typedObject.Name)
189
205
if b .modifier != nil {
190
206
b .modifier (typedObject )
191
207
}
192
208
if _ , _ , err := resourceapply .ApplyClusterRoleBindingv1beta1 (ctx , b .rbacClientv1beta1 , typedObject ); err != nil {
193
209
return err
194
210
}
195
211
case * rbacv1beta1.Role :
212
+ //klog.Infof("!!!! rbacv1beta1.Role: %s", typedObject.Name)
196
213
if b .modifier != nil {
197
214
b .modifier (typedObject )
198
215
}
199
216
if _ , _ , err := resourceapply .ApplyRolev1beta1 (ctx , b .rbacClientv1beta1 , typedObject ); err != nil {
200
217
return err
201
218
}
202
219
case * rbacv1beta1.RoleBinding :
220
+ //klog.Infof("!!!! rbacv1beta1.RoleBinding: %s", typedObject.Name)
203
221
if b .modifier != nil {
204
222
b .modifier (typedObject )
205
223
}
206
224
if _ , _ , err := resourceapply .ApplyRoleBindingv1beta1 (ctx , b .rbacClientv1beta1 , typedObject ); err != nil {
207
225
return err
208
226
}
209
227
case * apiextensionsv1.CustomResourceDefinition :
228
+ //klog.Infof("!!!! apiextensionsv1.CustomResourceDefinition: %s", typedObject.Name)
210
229
if b .modifier != nil {
211
230
b .modifier (typedObject )
212
231
}
213
232
if _ , _ , err := resourceapply .ApplyCustomResourceDefinitionv1 (ctx , b .apiextensionsClientv1 , typedObject ); err != nil {
214
233
return err
215
234
}
216
235
case * apiextensionsv1beta1.CustomResourceDefinition :
236
+ //klog.Infof("!!!! apiextensionsv1beta1.CustomResourceDefinition: %s", typedObject.Name)
217
237
if b .modifier != nil {
218
238
b .modifier (typedObject )
219
239
}
220
240
if _ , _ , err := resourceapply .ApplyCustomResourceDefinitionv1beta1 (ctx , b .apiextensionsClientv1beta1 , typedObject ); err != nil {
221
241
return err
222
242
}
223
243
case * apiregistrationv1.APIService :
244
+ //klog.Infof("!!!! apiregistrationv1.APIService: %s", typedObject.Name)
224
245
if b .modifier != nil {
225
246
b .modifier (typedObject )
226
247
}
227
248
if _ , _ , err := resourceapply .ApplyAPIServicev1 (ctx , b .apiregistrationClientv1 , typedObject ); err != nil {
228
249
return err
229
250
}
230
251
case * apiregistrationv1beta1.APIService :
252
+ //klog.Infof("!!!! apiregistrationv1beta1.APIService: %s", typedObject.Name)
231
253
if b .modifier != nil {
232
254
b .modifier (typedObject )
233
255
}
0 commit comments