@@ -68,7 +68,11 @@ func EnsureCRDWithOptions(ctx context.Context, client kclient.Client, opts Ensur
6868
6969 getAccess := verifyCRDAccess (ctx , client , crdName , access .Get )
7070 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" )
7276 continue
7377 }
7478
@@ -195,14 +199,20 @@ func tryApplyCRD(ctx context.Context, client kclient.Client, def crds.Definition
195199 c , err := crdDefinitions .Get (ctx , crdName , meta.GetOptions {})
196200 if err != nil {
197201 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" )
199205 return err
200206 }
201207
202208 createAccess := verifyCRDAccess (ctx , client , crdName , access .Create )
203209
204210 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" )
206216 return nil
207217 }
208218
@@ -219,7 +229,10 @@ func tryApplyCRD(ctx context.Context, client kclient.Client, def crds.Definition
219229
220230 updateAccess := verifyCRDAccess (ctx , client , crdName , access .Update )
221231 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" )
223236 return nil
224237 }
225238
0 commit comments