provider-aws icon indicating copy to clipboard operation
provider-aws copied to clipboard

Dupe Fields in API Gateway CRD

Open KrisJohnstone opened this issue 2 years ago • 1 comments

What happened?

There appears to be duplicate fields in apigateway.aws.crossplane.io_methods.yaml :

  • requestValidatorId
  • authorizerId

Error occurs when importing resources into cd8ks:

  | apigateway.aws.crossplane.io.ts:9437:12 - error TS2300: Duplicate identifier 'authorizerId'.
  | 9437   readonly authorizerId?: string;
  |                 ~~~~~~~~~~~~
  | apigateway.aws.crossplane.io.ts:9444:12 - error TS2300: Duplicate identifier 'authorizerId'.
  | 9444   readonly authorizerId?: string;
  |                 ~~~~~~~~~~~~
  | apigateway.aws.crossplane.io.ts:9500:12 - error TS2300: Duplicate identifier 'requestValidatorId'.
  | 9500   readonly requestValidatorId?: string;
  |                 ~~~~~~~~~~~~~~~~~~
  | apigateway.aws.crossplane.io.ts:9507:12 - error TS2300: Duplicate identifier 'requestValidatorId'.
  | 9507   readonly requestValidatorId?: string;
  |                 ~~~~~~~~~~~~~~~~~~

CRD:

                  requestValidatorID:
                    description: The identifier of a RequestValidator for validating
                      the method request.
                    type: string
                  requestValidatorId:
                    description: RequestValidatorID is the ID for the RequestValidator.
                    type: string
                  authorizerID:
                    description: Specifies the identifier of an Authorizer to use
                      on this Method, if the type is CUSTOM or COGNITO_USER_POOLS.
                      The authorizer identifier is generated by API Gateway when you
                      created the authorizer.
                    type: string
                  authorizerId:
                    description: AuthorizerID is the ID for the Authorizer.
                    type: string

How can we reproduce it?

  1. Create empty dir, run cdk8s init go-app inside the newly created directory.
  2. Update cdk8s.yaml to the following:
language: go
app: go run .
imports:
  - k8s
  - github:crossplane/provider-aws
  1. Run cdk8s import

What environment did it happen in?

Crossplane version: kubectl crossplane --version v1.10.1

CD8Ks: v2.1.32

KrisJohnstone avatar Nov 01 '22 23:11 KrisJohnstone

I can confirm this. The properties AuthorizerID and RequestValidatorID need to be ignored in generator-config.yaml and the controller must use the fields that are defined in CustomMethodParameters.

MisterMX avatar Nov 08 '22 15:11 MisterMX

Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] avatar Aug 11 '23 01:08 github-actions[bot]