Skip to content

Conversation

RedbackThomson
Copy link
Contributor

Issue #, if available: aws-controllers-k8s/community#766

Some resources require more than an ARN/Name/ID to describe a single resource. This PR adds an additionalKeys field to the AWSIdentifiers to allow for arbitrary identifiers as needed by any resources.

Generator code to support this change: aws-controllers-k8s/code-generator#62

@a-hilaly
Copy link
Member

@RedbackThomson is gonna rework this PR, sometime next week

/hold

@ack-bot ack-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2021
NameOrID *string `json:"nameOrID,omitempty"`
// AdditionalKeys represents any additional arbitrary identifiers used when
// describing the target resource.
AdditionalKeys map[string]*string `json:"additionalKeys,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason this is map[string]*string instead of map[string]string?

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 was using the other *string fields as reference. Is there a hard and fast rule to when we should use *string over string?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The use of map[string]*string is really an aws-sdk-go thing. Since this isn't an aws-sdk-go shape field, I just thought it would make more sense to use a standard map[string]string. Pointer types generally signal optional fields (except for aws-sdk-go, which makes everything a pointer type, unfortunately).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough. I've updated all unnecessary *string to string types for the adopted resource APIs.

@a-hilaly
Copy link
Member

/unhold
/approve

@ack-bot ack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 29, 2021
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.

++

@jaypipes
Copy link
Collaborator

/lgtm

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

ack-bot commented Jun 29, 2021

[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,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 089321f into aws-controllers-k8s:main Jun 29, 2021
ack-bot pushed a commit to aws-controllers-k8s/code-generator that referenced this pull request Jul 2, 2021
…de (#115)

Related to #105 and aws-controllers-k8s/runtime#13

Description of changes:
- replace nil pointer checks with string zero value checks
- replace `string` value assignment with `string` ptr assignments

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
a-hilaly added a commit to a-hilaly/ack-code-generator that referenced this pull request Jul 6, 2021
…de (aws-controllers-k8s#115)

Related to aws-controllers-k8s#105 and aws-controllers-k8s/runtime#13

Description of changes:
- replace nil pointer checks with string zero value checks
- replace `string` value assignment with `string` ptr assignments

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
…de (aws-controllers-k8s#115)

Related to aws-controllers-k8s#105 and aws-controllers-k8s/runtime#13

Description of changes:
- replace nil pointer checks with string zero value checks
- replace `string` value assignment with `string` ptr assignments

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.

4 participants