@@ -28,6 +28,7 @@ import (
2828 rbacclientv1 "k8s.io/client-go/kubernetes/typed/rbac/v1"
2929 rbacclientv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1"
3030 "k8s.io/client-go/rest"
31+ "k8s.io/klog/v2"
3132 apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
3233 apiregistrationv1beta1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1"
3334 apiregistrationclientv1 "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1"
@@ -82,17 +83,20 @@ func (b *builder) WithModifier(f MetaV1ObjectModifierFunc) Interface {
8283}
8384
8485func (b * builder ) Do (ctx context.Context ) error {
86+ klog .Infof ("!!!! builder Do" )
8587 obj := resourceread .ReadOrDie (b .raw )
8688
8789 switch typedObject := obj .(type ) {
8890 case * securityv1.SecurityContextConstraints :
91+ //klog.Infof("!!!! securityv1.SecurityContextConstraints: %s", typedObject.Name)
8992 if b .modifier != nil {
9093 b .modifier (typedObject )
9194 }
9295 if _ , _ , err := resourceapply .ApplySecurityContextConstraintsv1 (ctx , b .securityClientv1 , typedObject ); err != nil {
9396 return err
9497 }
9598 case * appsv1.DaemonSet :
99+ //klog.Infof("!!!! appsv1.DaemonSet: %s", typedObject.Name)
96100 if b .modifier != nil {
97101 b .modifier (typedObject )
98102 }
@@ -104,6 +108,7 @@ func (b *builder) Do(ctx context.Context) error {
104108 }
105109 return b .checkDaemonSetHealth (ctx , typedObject )
106110 case * appsv1.Deployment :
111+ //klog.Infof("!!!! appsv1.Deployment: %s", typedObject.Name)
107112 if b .modifier != nil {
108113 b .modifier (typedObject )
109114 }
@@ -115,6 +120,7 @@ func (b *builder) Do(ctx context.Context) error {
115120 }
116121 return b .checkDeploymentHealth (ctx , typedObject )
117122 case * batchv1.Job :
123+ //klog.Infof("!!!! batchv1.Job: %s", typedObject.Name)
118124 if b .modifier != nil {
119125 b .modifier (typedObject )
120126 }
@@ -123,111 +129,127 @@ func (b *builder) Do(ctx context.Context) error {
123129 }
124130 return b .checkJobHealth (ctx , typedObject )
125131 case * corev1.ConfigMap :
132+ //klog.Infof("!!!! corev1.ConfigMap: %s", typedObject.Name)
126133 if b .modifier != nil {
127134 b .modifier (typedObject )
128135 }
129136 if _ , _ , err := resourceapply .ApplyConfigMapv1 (ctx , b .coreClientv1 , typedObject ); err != nil {
130137 return err
131138 }
132139 case * corev1.Namespace :
140+ //klog.Infof("!!!! corev1.Namespace: %s", typedObject.Name)
133141 if b .modifier != nil {
134142 b .modifier (typedObject )
135143 }
136144 if _ , _ , err := resourceapply .ApplyNamespacev1 (ctx , b .coreClientv1 , typedObject ); err != nil {
137145 return err
138146 }
139147 case * corev1.Service :
148+ //klog.Infof("!!!! corev1.Service: %s", typedObject.Name)
140149 if b .modifier != nil {
141150 b .modifier (typedObject )
142151 }
143152 if _ , _ , err := resourceapply .ApplyServicev1 (ctx , b .coreClientv1 , typedObject ); err != nil {
144153 return err
145154 }
146155 case * corev1.ServiceAccount :
156+ //klog.Infof("!!!! corev1.ServiceAccount: %s", typedObject.Name)
147157 if b .modifier != nil {
148158 b .modifier (typedObject )
149159 }
150160 if _ , _ , err := resourceapply .ApplyServiceAccountv1 (ctx , b .coreClientv1 , typedObject ); err != nil {
151161 return err
152162 }
153163 case * rbacv1.ClusterRole :
164+ //klog.Infof("!!!! rbacv1.ClusterRole: %s", typedObject.Name)
154165 if b .modifier != nil {
155166 b .modifier (typedObject )
156167 }
157168 if _ , _ , err := resourceapply .ApplyClusterRolev1 (ctx , b .rbacClientv1 , typedObject ); err != nil {
158169 return err
159170 }
160171 case * rbacv1.ClusterRoleBinding :
172+ //klog.Infof("!!!! rbacv1.ClusterRoleBinding: %s", typedObject.Name)
161173 if b .modifier != nil {
162174 b .modifier (typedObject )
163175 }
164176 if _ , _ , err := resourceapply .ApplyClusterRoleBindingv1 (ctx , b .rbacClientv1 , typedObject ); err != nil {
165177 return err
166178 }
167179 case * rbacv1.Role :
180+ //klog.Infof("!!!! rbacv1.Role: %s", typedObject.Name)
168181 if b .modifier != nil {
169182 b .modifier (typedObject )
170183 }
171184 if _ , _ , err := resourceapply .ApplyRolev1 (ctx , b .rbacClientv1 , typedObject ); err != nil {
172185 return err
173186 }
174187 case * rbacv1.RoleBinding :
188+ //klog.Infof("!!!! rbacv1.RoleBinding: %s", typedObject.Name)
175189 if b .modifier != nil {
176190 b .modifier (typedObject )
177191 }
178192 if _ , _ , err := resourceapply .ApplyRoleBindingv1 (ctx , b .rbacClientv1 , typedObject ); err != nil {
179193 return err
180194 }
181195 case * rbacv1beta1.ClusterRole :
196+ //klog.Infof("!!!! rbacv1beta1.ClusterRole: %s", typedObject.Name)
182197 if b .modifier != nil {
183198 b .modifier (typedObject )
184199 }
185200 if _ , _ , err := resourceapply .ApplyClusterRolev1beta1 (ctx , b .rbacClientv1beta1 , typedObject ); err != nil {
186201 return err
187202 }
188203 case * rbacv1beta1.ClusterRoleBinding :
204+ //klog.Infof("!!!! rbacv1beta1.ClusterRoleBinding: %s", typedObject.Name)
189205 if b .modifier != nil {
190206 b .modifier (typedObject )
191207 }
192208 if _ , _ , err := resourceapply .ApplyClusterRoleBindingv1beta1 (ctx , b .rbacClientv1beta1 , typedObject ); err != nil {
193209 return err
194210 }
195211 case * rbacv1beta1.Role :
212+ //klog.Infof("!!!! rbacv1beta1.Role: %s", typedObject.Name)
196213 if b .modifier != nil {
197214 b .modifier (typedObject )
198215 }
199216 if _ , _ , err := resourceapply .ApplyRolev1beta1 (ctx , b .rbacClientv1beta1 , typedObject ); err != nil {
200217 return err
201218 }
202219 case * rbacv1beta1.RoleBinding :
220+ //klog.Infof("!!!! rbacv1beta1.RoleBinding: %s", typedObject.Name)
203221 if b .modifier != nil {
204222 b .modifier (typedObject )
205223 }
206224 if _ , _ , err := resourceapply .ApplyRoleBindingv1beta1 (ctx , b .rbacClientv1beta1 , typedObject ); err != nil {
207225 return err
208226 }
209227 case * apiextensionsv1.CustomResourceDefinition :
228+ //klog.Infof("!!!! apiextensionsv1.CustomResourceDefinition: %s", typedObject.Name)
210229 if b .modifier != nil {
211230 b .modifier (typedObject )
212231 }
213232 if _ , _ , err := resourceapply .ApplyCustomResourceDefinitionv1 (ctx , b .apiextensionsClientv1 , typedObject ); err != nil {
214233 return err
215234 }
216235 case * apiextensionsv1beta1.CustomResourceDefinition :
236+ //klog.Infof("!!!! apiextensionsv1beta1.CustomResourceDefinition: %s", typedObject.Name)
217237 if b .modifier != nil {
218238 b .modifier (typedObject )
219239 }
220240 if _ , _ , err := resourceapply .ApplyCustomResourceDefinitionv1beta1 (ctx , b .apiextensionsClientv1beta1 , typedObject ); err != nil {
221241 return err
222242 }
223243 case * apiregistrationv1.APIService :
244+ //klog.Infof("!!!! apiregistrationv1.APIService: %s", typedObject.Name)
224245 if b .modifier != nil {
225246 b .modifier (typedObject )
226247 }
227248 if _ , _ , err := resourceapply .ApplyAPIServicev1 (ctx , b .apiregistrationClientv1 , typedObject ); err != nil {
228249 return err
229250 }
230251 case * apiregistrationv1beta1.APIService :
252+ //klog.Infof("!!!! apiregistrationv1beta1.APIService: %s", typedObject.Name)
231253 if b .modifier != nil {
232254 b .modifier (typedObject )
233255 }
0 commit comments