Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use loadModelWithLatestAPIVersion to load models for crossplane #237

Merged

Conversation

EdgeJ
Copy link
Contributor

@EdgeJ EdgeJ commented Nov 9, 2021

This fixes an issue where the crossplane command would fail to find API
models for resources whose name differed between the model and API in
the SDK. Previous behavior was to continue using the svcAlias instead of
correctly using model_name from the configuration.

The changes here also have the added benefit of making the generateCrossplane function code more similar to other generation functions and utilize more of the common codebase.

Issue #, if available:
N/A

Description of changes:
Replace duplicated code in the generateCrossplane function with implementations in common.go and change variables to match the naming scheme used elsewhere.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This fixes an issue where the crossplane command would fail to find API
models for resources whose name differed between the model and API in
the SDK. Previous behavior was to continue using the svcAlias instead of
correctly using model_name from the configuration.
@ack-bot
Copy link
Collaborator

ack-bot commented Nov 9, 2021

Hi @EdgeJ. Thanks for your PR.

I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@ack-bot ack-bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 9, 2021
Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

All looks good except you should make a corresponding change to the README in the templates/crossplane/ directory here:

https://github.com/aws-controllers-k8s/code-generator/blob/main/templates/crossplane/README.md

which mentions the --provider-dir CLI flag. :)

cmd/ack-generate/command/crossplane.go Outdated Show resolved Hide resolved
@EdgeJ EdgeJ requested a review from jaypipes November 9, 2021 20:01
Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

Fantastic, thanks @EdgeJ!

@jaypipes
Copy link
Collaborator

jaypipes commented Nov 9, 2021

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 9, 2021
@ack-bot
Copy link
Collaborator

ack-bot commented Nov 9, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: EdgeJ, jaypipes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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-bot ack-bot merged commit 2d95a1f into aws-controllers-k8s:main Nov 9, 2021
@a-hilaly
Copy link
Member

/ok-to-test

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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.
Projects
None yet
4 participants