Skip to content

handle renamed fields for resource identifiers #117

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

Merged

Conversation

jaypipes
Copy link
Collaborator

@jaypipes jaypipes commented Jul 5, 2021

The code that outputs Go code that sets Spec or Status fields to a
resource identifier field was not accounting for cases where we renamed
the field. Such is the case for many of the RDS controller's resources,
since all the identifier fields for all resources are "de-stuttured" by
renaming, for example, DBSubnetGroupName to just Name or
DBClusterParameterGroupName to just Name.

This patch simply ensures we account for renamed fields in the Spec and
Status during calls to pkg/generate/code.SetResourceIdentifiers and
adds a unit test to ensure we don't regress in the future.

Issue aws-controllers-k8s/community#852

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

The code that outputs Go code that sets `Spec` or `Status` fields to a
resource identifier field was not accounting for cases where we renamed
the field. Such is the case for many of the RDS controller's resources,
since all the identifier fields for all resources are "de-stuttured" by
renaming, for example, `DBSubnetGroupName` to just `Name` or
`DBClusterParameterGroupName` to just `Name`.

This patch simply ensures we account for renamed fields in the Spec and
Status during calls to `pkg/generate/code.SetResourceIdentifiers` and
adds a unit test to ensure we don't regress in the future.

Issue aws-controllers-k8s/community#852
@ack-bot ack-bot requested a review from vijtrip2 July 5, 2021 14:34
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.

👍

@a-hilaly
Copy link
Member

a-hilaly commented Jul 5, 2021

/lgtm

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

ack-bot commented Jul 5, 2021

[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-bot ack-bot merged commit 287334e into aws-controllers-k8s:main Jul 5, 2021
a-hilaly pushed a commit to a-hilaly/ack-code-generator that referenced this pull request Jul 6, 2021
The code that outputs Go code that sets `Spec` or `Status` fields to a
resource identifier field was not accounting for cases where we renamed
the field. Such is the case for many of the RDS controller's resources,
since all the identifier fields for all resources are "de-stuttured" by
renaming, for example, `DBSubnetGroupName` to just `Name` or
`DBClusterParameterGroupName` to just `Name`.

This patch simply ensures we account for renamed fields in the Spec and
Status during calls to `pkg/generate/code.SetResourceIdentifiers` and
adds a unit test to ensure we don't regress in the future.

Issue aws-controllers-k8s/community#852

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
RedbackThomson pushed a commit to RedbackThomson/ack-code-generator that referenced this pull request Jul 8, 2021
The code that outputs Go code that sets `Spec` or `Status` fields to a
resource identifier field was not accounting for cases where we renamed
the field. Such is the case for many of the RDS controller's resources,
since all the identifier fields for all resources are "de-stuttured" by
renaming, for example, `DBSubnetGroupName` to just `Name` or
`DBClusterParameterGroupName` to just `Name`.

This patch simply ensures we account for renamed fields in the Spec and
Status during calls to `pkg/generate/code.SetResourceIdentifiers` and
adds a unit test to ensure we don't regress in the future.

Issue aws-controllers-k8s/community#852

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
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.

3 participants