Closed anusha94 closed 1 year ago
One possible cause because of which I faced this issue and reconciler went into panic is when the program tries to get x.Accounts
when x == nil
. This condition is not being checked right now.
https://github.com/nirmata/kyverno-aws-adapter/blob/c9f3d8a10e5c434d2c9eb758eb64616a52b15205/controllers/awsadapterconfig_controller.go#L128
Also, another issue I see here is when err != nil
and len(x.Accounts) == 0
, in that case we'll be overwriting the error in the following code.
https://github.com/nirmata/kyverno-aws-adapter/blob/c9f3d8a10e5c434d2c9eb758eb64616a52b15205/controllers/awsadapterconfig_controller.go#L129-L131
Fixed by #69.
Steps to reproduce: Any configuration error with IAM policy, role or serviceaccount leads to this problem.
Container logs:
Expected outcome: The container should not panic and show meaningful error messages.