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

Support ReadMany operations with slices in SetResourceIdentifiers #170

Merged
merged 6 commits into from
Aug 27, 2021

Conversation

RedbackThomson
Copy link
Contributor

Fixes aws-controllers-k8s/community#874

Description of changes:
Automatically detects pluralised fields from the operation shape and sets the corresponding CR field. Refactor SetResourceIdentifiers to re-use common logic from CheckRequiredFieldsMissingFromShape. Now supports primary_identifier_field_names that reference []string types.

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

pkg/generate/code/common.go Outdated Show resolved Hide resolved
pkg/generate/code/set_resource.go Show resolved Hide resolved
pkg/generate/code/set_resource.go Outdated Show resolved Hide resolved
Comment on lines -3111 to -3113
f0, f0ok := identifier.AdditionalKeys["modelPackageName"]
if f0ok {
r.ko.Spec.ModelPackageName = &f0
Copy link
Collaborator

Choose a reason for hiding this comment

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

where'd this go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I figured that if you are querying by ARN, you will not need to define additional keys to filter down to a single element. ModelPackageName did not provide any value in this method, before. It was just being added because it was another field on the DescribeModelPackages API.

@vijtrip2
Copy link
Contributor

/test unit-test

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.

looking good. 👍

@jaypipes
Copy link
Collaborator

/lgtm

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

ack-bot commented Aug 27, 2021

[APPROVALNOTIFIER] This PR is APPROVED

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

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 42fb21d into aws-controllers-k8s:main Aug 27, 2021
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.

Support slices in primary_identifier_field_name
4 participants