@@ -68,7 +68,11 @@ func EnsureCRDWithOptions(ctx context.Context, client kclient.Client, opts Ensur
68
68
69
69
getAccess := verifyCRDAccess (ctx , client , crdName , access .Get )
70
70
if ! getAccess .Allowed {
71
- logger .Str ("crd" , crdName ).Info ("Get Operations is not allowed. Continue" )
71
+ logger .
72
+ Str ("crd" , crdName ).
73
+ Str ("reason" , getAccess .Reason ).
74
+ Str ("evaluationError" , getAccess .EvaluationError ).
75
+ Info ("Get Operations is not allowed. Continue" )
72
76
continue
73
77
}
74
78
@@ -195,14 +199,20 @@ func tryApplyCRD(ctx context.Context, client kclient.Client, def crds.Definition
195
199
c , err := crdDefinitions .Get (ctx , crdName , meta.GetOptions {})
196
200
if err != nil {
197
201
if ! errors .IsNotFound (err ) {
198
- logger .Err (err ).Str ("crd" , crdName ).Warn ("Get Operations is not allowed due to error" )
202
+ logger .Err (err ).
203
+ Str ("crd" , crdName ).
204
+ Warn ("Get Operations is not allowed due to error" )
199
205
return err
200
206
}
201
207
202
208
createAccess := verifyCRDAccess (ctx , client , crdName , access .Create )
203
209
204
210
if ! createAccess .Allowed {
205
- logger .Str ("crd" , crdName ).Info ("Create Operations is not allowed but CRD is missing. Continue" )
211
+ logger .
212
+ Str ("crd" , crdName ).
213
+ Str ("reason" , createAccess .Reason ).
214
+ Str ("evaluationError" , createAccess .EvaluationError ).
215
+ Info ("Create Operations is not allowed but CRD is missing. Continue" )
206
216
return nil
207
217
}
208
218
@@ -219,7 +229,10 @@ func tryApplyCRD(ctx context.Context, client kclient.Client, def crds.Definition
219
229
220
230
updateAccess := verifyCRDAccess (ctx , client , crdName , access .Update )
221
231
if ! updateAccess .Allowed {
222
- logger .Str ("crd" , crdName ).Info ("Update Operations is not allowed. Continue" )
232
+ logger .Str ("crd" , crdName ).
233
+ Str ("reason" , updateAccess .Reason ).
234
+ Str ("evaluationError" , updateAccess .EvaluationError ).
235
+ Info ("Update Operations is not allowed. Continue" )
223
236
return nil
224
237
}
225
238
0 commit comments