Closed dimitar-kostadinov closed 7 months ago
From here we can see that GetVPCAttribute
could never return NotFoundError
https://github.com/gardener/gardener-extension-provider-aws/blob/160de6858446e762a013b4f7ab982b8903c616ab/pkg/aws/client/client.go#L209-L223
And here we expect to receive and even have a special handling if we receive such an error
https://github.com/gardener/gardener-extension-provider-aws/blob/160de6858446e762a013b4f7ab982b8903c616ab/pkg/controller/infrastructure/configvalidator.go#L95-L99
Even we have dedicated test cases for NotFoundError
https://github.com/gardener/gardener-extension-provider-aws/blob/160de6858446e762a013b4f7ab982b8903c616ab/pkg/controller/infrastructure/configvalidator_test.go#L142-L150
And any other error
https://github.com/gardener/gardener-extension-provider-aws/blob/160de6858446e762a013b4f7ab982b8903c616ab/pkg/controller/infrastructure/configvalidator_test.go#L184-L193
https://github.com/gardener/gardener-extension-provider-aws/blob/160de6858446e762a013b4f7ab982b8903c616ab/pkg/aws/client/client.go#L211-L213
In conclusion I think that the code above should be changed to:
if err != nil {
return false, err
}
How to categorize this issue?
/area ops-productivity /kind bug /platform aws
What happened:
The error should be classified as user configuration error, as configured VPC doesn't exist.
It seems that
awsclient.IsNotFoundError
doesn't handle properly VPC NotFoundError:https://github.com/gardener/gardener-extension-provider-aws/blob/46ba344f81c37d08e1c98acb64f396dd318ba3bf/pkg/controller/infrastructure/configvalidator.go#L107-L109
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
kubectl version
):