Skip to content

Validate CRDs before generating TypeDefs#670

Open
knottnt wants to merge 1 commit intoaws-controllers-k8s:mainfrom
knottnt:validate-crds-before-type-defs
Open

Validate CRDs before generating TypeDefs#670
knottnt wants to merge 1 commit intoaws-controllers-k8s:mainfrom
knottnt:validate-crds-before-type-defs

Conversation

@knottnt
Copy link
Contributor

@knottnt knottnt commented Feb 24, 2026

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 in GetTypeDefs() 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 invokes IsShapeUsedInCRDs and 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 GetTypeDefs to 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.

@ack-prow ack-prow bot requested review from jlbutler and michaelhtm February 24, 2026 01:05
@ack-prow ack-prow bot added the approved label Feb 24, 2026
Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 4, 2026
@ack-prow
Copy link

ack-prow bot commented Mar 4, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow
Copy link

ack-prow bot commented Mar 4, 2026

@knottnt: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
verify-attribution 0ca161a link false /test verify-attribution
s3-controller-test 0ca161a link unknown /test s3-controller-test
ec2-controller-test 0ca161a link unknown /test ec2-controller-test
dynamodb-controller-test 0ca161a link unknown /test dynamodb-controller-test

Full PR test history. Your PR dashboard.

Details

Instructions 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants