Skip to content

support custom fields of list/scalar/map types #268

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
merged 1 commit into from
Jan 18, 2022

Conversation

jaypipes
Copy link
Collaborator

Adds functionality for the generator.yaml file to contain a
FieldConfig.Type attribute that is the Go type override string for a
field. If the Go type of the field cannot be inferred via the Create
Input/Output shape or via the FieldConfig.From (SourceFieldConfig)
value, we can look at this new FieldConfig.Type value and construct a
aws-sdk-go/private/model/api:ShapeRef object manually.

Thus, with this patch, we can do something like this (example from the
iam-controller's generator.yaml file, which is what I tested this patch
on):

resources:
  Role:
    fields:
      Policies:
        type: "[]*string"

Signed-off-by: Jay Pipes [email protected]

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

Adds functionality for the generator.yaml file to contain a
`FieldConfig.Type` attribute that is the Go type override string for a
field. If the Go type of the field cannot be inferred via the Create
Input/Output shape *or* via the `FieldConfig.From` (SourceFieldConfig)
value, we can look at this new `FieldConfig.Type` value and construct a
`aws-sdk-go/private/model/api:ShapeRef` object manually.

Thus, with this patch, we can do something like this (example from the
iam-controller's generator.yaml file, which is what I tested this patch
on):

```yaml
resources:
  Role:
    fields:
      Policies:
        type: "[]*string"
```

Signed-off-by: Jay Pipes <[email protected]>
Copy link
Contributor

@vijtrip2 vijtrip2 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!

jaypipes added a commit to jaypipes/ack-iam-controller that referenced this pull request Jan 18, 2022
Regenerate the IAM controller with ACK runtime and code-generator
v0.16.1 and the code-generator functionality in
aws-controllers-k8s/code-generator#268.

Signed-off-by: Jay Pipes <[email protected]>
@vijtrip2
Copy link
Contributor

/lgtm

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

ack-bot commented Jan 18, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jaypipes, vijtrip2

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

@vijtrip2 vijtrip2 merged commit 02795c2 into aws-controllers-k8s:main Jan 18, 2022
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