Skip to content

Conversation

@jaypipes
Copy link
Collaborator

The code which builds the input shapes for the GET_ATTRIBUTES and SET_ATTRIBUTES operations for attribute-based APIs was checking for a Name or ID field in order to set the value for ARN fields in the input shapes. However, some resources, like SNS' Subscription resources, do not have a Name or ID field.

This resulted in nil pointer dereferencing and panics when building the controller for SNS Subscriptions.

This patch simply double-checks that the *string returned from the CRD.SpecIdentifierField() method is not nil before adding in the Go code that constructs an ARN from a Name or ID field.

Related: aws-controllers-k8s/community#1491

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.

The code which builds the input shapes for the GET_ATTRIBUTES and
SET_ATTRIBUTES operations for attribute-based APIs was checking for a
Name or ID field in order to set the value for ARN fields in the input
shapes. However, some resources, like SNS' Subscription resources, do
not have a Name or ID field.

This resulted in nil pointer dereferencing and panics when building the
controller for SNS Subscriptions.

This patch simply double-checks that the `*string` returned from the
`CRD.SpecIdentifierField()` method is not nil before adding in the Go
code that constructs an ARN from a Name or ID field.

Signed-off-by: Jay Pipes <jaypipes@gmail.com>
@ack-prow
Copy link

ack-prow bot commented Feb 10, 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.

@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 Feb 10, 2023
@a-hilaly
Copy link
Member

/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 Feb 11, 2023
@ack-prow
Copy link

ack-prow bot commented Feb 11, 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
lambda-controller-test bbe30fb link true /test lambda-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.

Nice!

@ack-prow
Copy link

ack-prow bot commented Feb 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, 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-prow ack-prow bot added the approved label Feb 13, 2023
@a-hilaly a-hilaly merged commit e0eac49 into aws-controllers-k8s:main Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

2 participants