Skip to content

Conversation

mbaijal
Copy link
Contributor

@mbaijal mbaijal commented Aug 24, 2021

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

Description of changes:

  1. Enable updates based on changes to code generator made in this PR - Allow OperatorType to be a list such that one API can map to multiple operations code-generator#166
  2. Add an integration test to check for updates
  3. Update Runtime to v0.12.0
  4. Allows use of adopted resource (test in next PR)

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

@ack-bot
Copy link
Collaborator

ack-bot commented Aug 24, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mbaijal

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

require (
github.com/aws-controllers-k8s/runtime v0.2.1
github.com/aws/aws-sdk-go v1.37.4
github.com/aws-controllers-k8s/runtime v0.12.0
Copy link
Member

Choose a reason for hiding this comment

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

@mbaijal I would recommend to do the runtime update in a separate PR, since will require regenerating all the apis and tuning/re-running all the unit tests

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree. It's quite difficult to see in this review what is simply updating to 0.12.0 and what is custom code. Especially considering we are coming from 0.2.1 - there are a lot of rebasing changes.

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 had to update the runtime here since I was using the latest code generator changes for this PR which includes late initializers and without this version of runtime things don't work.

I could however have a separate PR for runtime update which gets merged before this one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes please. A separate PR for runtime from v0.2.1 to v0.12.0 will greatly reduce subsequent PRs (like this one)

@ack-bot
Copy link
Collaborator

ack-bot commented Aug 24, 2021

@mbaijal: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
applicationautoscaling-unit-test 161afe0 link /test applicationautoscaling-unit-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.

@mbaijal mbaijal changed the title Enable updates for ScalableTarget and ScalingPolicy [do-not-merge-before-28] Enable updates for ScalableTarget and ScalingPolicy Aug 25, 2021
@mbaijal
Copy link
Contributor Author

mbaijal commented Aug 30, 2021

Will create a new pull request since runtime update is in a separate PR now and there have been other changes since.

@mbaijal mbaijal closed this Aug 30, 2021
ack-bot pushed a commit to aws-controllers-k8s/code-generator that referenced this pull request Aug 31, 2021
… operations (#166)

Allow OperatorType to be a list such that one API can map to multiple operations. 
This is required in certain cases where the same API call maps to both Create and Update operations such as `RegisterScalableTarget` and `PutScalingPolicy`

[Link to ApplicationAutoscaling PR with the related change](aws-controllers-k8s/applicationautoscaling-controller#27)
Note: This change will require all other services to update their generator configs as well. 

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

### Description of changes:
The `getOpTypeAndResourceName` method handles each of the following cases same as before in addition to the new case 5- 
1.  the cfg itself is nil
2.  cfg is not nil but opId is not in the cfg
3.  cfg is not nil, the opID is in the cfg but the opType is not specified
  ```
  operations:
    DescribeScalableTargets:
    primary_identifier_field_name: ResourceID
  ```
4. One API -> one operations
```
operations:
  PutScalingPolicy:
    operation_type: 
    - Create
  ```
5. One API -> multiple operations
```
operations:
  PutScalingPolicy:
    operation_type: 
    - Create
    - Update
  ```
### Testing
- I tested by generating the controller code for both applicationAutoscaling and the SageMaker repos. 
- The unit tests pass as is. 

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants