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 Operation.ExportedName not Operation.Name #424

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

jaypipes
Copy link
Collaborator

@jaypipes jaypipes commented Mar 6, 2023

This was a nasty issue to troubleshoot. :( Turns out that for REST+XML-based APIs (such as CloudFront), the aws-sdk-go private/model/api.Operation objects have a Name field that contains crap like this: "CreateCachePolicy2020_05_31". What this means is that when looking up things like output wrapper field paths by the Operation.Name of "CreateCachePolicy" (from the generator.yaml file's operations map), things were failing because the private/model/api.API:Operations map is actually keyed by Operation.ExportedName, not Operation.Name. Operation.ExportedName for REST+XML APIs like CloudFront contain the proper string "CreateCachePolicy" without the date suffix.

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 jljaco and RedbackThomson March 6, 2023 17:39
@ack-prow ack-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 6, 2023
@ack-prow
Copy link

ack-prow bot commented Mar 6, 2023

Hi @jaypipes. 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.

@a-hilaly
Copy link
Member

a-hilaly commented Mar 6, 2023

/ok-to-test

@ack-prow ack-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 6, 2023
@a-hilaly a-hilaly changed the title use Operation.ExportedName not Operation.Name use Operation.ExportedName not Operation.Name Mar 6, 2023
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.

+++ Thank you sir!

@ack-prow ack-prow bot added the approved label Mar 6, 2023
@a-hilaly
Copy link
Member

a-hilaly commented Mar 6, 2023

/test dynamodb-controller-test

@jaypipes jaypipes marked this pull request as draft March 6, 2023 19:13
@ack-prow ack-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 6, 2023
This was a nasty issue to troubleshoot. :( Turns out that for
REST+XML-based APIs (such as CloudFront), the aws-sdk-go
`private/model/api.Operation` objects have a `Name` field that contains
crap like this: "CreateCachePolicy2020_05_31". What this means is that
when looking up things like output wrapper field paths by the
`Operation.Name` of "CreateCachePolicy" (from the `generator.yaml`
file's `operations` map), things were failing because the
`private/model/api.API:Operations` map is actually keyed by
`Operation.ExportedName`, not `Operation.Name`. `Operation.ExportedName`
for REST+XML APIs like CloudFront contain the proper string
"CreateCachePolicy" without the date suffix.

Signed-off-by: Jay Pipes <jaypipes@gmail.com>
@jaypipes jaypipes marked this pull request as ready for review March 6, 2023 19:21
@ack-prow ack-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 6, 2023
@ack-prow ack-prow bot requested a review from a-hilaly March 6, 2023 19:21
@jaypipes
Copy link
Collaborator Author

jaypipes commented Mar 6, 2023

@a-hilaly @RedbackThomson found a few more uses of op.Name in the code gen and templates... please re-review.

@ack-prow
Copy link

ack-prow bot commented Mar 6, 2023

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

Test name Commit Details Required Rerun command
ec2-controller-test abd79c3 link true /test ec2-controller-test

Full PR test history. Your PR dashboard.

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.

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.

👍

@RedbackThomson
Copy link
Contributor

/lgtm

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

ack-prow bot commented Mar 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, jaypipes, RedbackThomson

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:
  • OWNERS [A-Hilaly,RedbackThomson]

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

@RedbackThomson RedbackThomson merged commit c8ed37a into aws-controllers-k8s:main Mar 6, 2023
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants