Validate CRDs before generating TypeDefs#670
Validate CRDs before generating TypeDefs#670knottnt wants to merge 1 commit intoaws-controllers-k8s:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a-hilaly, knottnt The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@knottnt: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Issue #, if available:
Description of changes:
The model.GetTypeDefs function became very expensive if validation of CRDs would fail. The root cause being that the
IsShapeUsedInCRDs()check inGetTypeDefs()attempts to build the set of CRDs and doesn't return an error if the CRDs have a validation error. When this happens returns false and the shape is skipped. However, since IsShapeUsedInCRDs() failed to lazy load the set of CRDs each shape invokesIsShapeUsedInCRDsand attempt to rebuild all CRDs. For large AWS model files this can become very expensive and take many minutes before reporting the error.This PR addresses the issue by explicitly evaluating CRDs before calling
GetTypeDefsto fail fast on CRD validation errors.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.