Skip to content

Conversation

@jaypipes
Copy link
Collaborator

A previous commit that used the github.com/aws-controllers-k8s/pkg/names package instead of the local pkg/names package changed the implementation of the Field.IsRequired method slightly by no longer referring to the names.ModelOriginal value. This ModelOriginal value was really just a hack from a while ago because we didn't have support for reverse-lookups of renamed fields to original Input/Output struct member names.

This patch adds that reverse lookup and fixes the IsRequired method to properly look up the original struct member name in the Input shape's required list.

Signed-off-by: Jay Pipes jaypipes@gmail.com

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

A previous commit that used the `github.com/aws-controllers-k8s/pkg/names` package instead of the
local `pkg/names` package changed the implementation of the
`Field.IsRequired` method slightly by no longer referring to the
`names.ModelOriginal` value. This ModelOriginal value was really just a
hack from a while ago because we didn't have support for reverse-lookups
of renamed fields to original Input/Output struct member names.

This patch adds that reverse lookup and fixes the IsRequired method to
properly look up the original struct member name in the Input shape's
required list.

Signed-off-by: Jay Pipes <jaypipes@gmail.com>
@ack-bot ack-bot requested review from a-hilaly and vijtrip2 January 27, 2023 17:48
@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 Jan 27, 2023
@ack-bot
Copy link
Collaborator

ack-bot commented Jan 27, 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.

@jaypipes
Copy link
Collaborator Author

@a-hilaly @RedbackThomson @jljaco Please note the changes to comments are from gofmt changing in go1.19, which is what I'm using locally now and is integrated into my vim, so when I save a file, it automatically gofmts the code...

Copy link
Contributor

@jljaco jljaco left a comment

Choose a reason for hiding this comment

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

Looks good to me, I'll leave it to @a-hilaly or @RedbackThomson for final approval

Copy link
Contributor

@RedbackThomson RedbackThomson left a comment

Choose a reason for hiding this comment

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

Looks fair to me!

@RedbackThomson
Copy link
Contributor

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 27, 2023
@ack-bot
Copy link
Collaborator

ack-bot commented Jan 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jaypipes, jljaco, 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 [RedbackThomson,jljaco]

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 a676537 into aws-controllers-k8s:main Jan 27, 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 @jaypipes! nice catch.

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

Development

Successfully merging this pull request may close these issues.

5 participants