-
Notifications
You must be signed in to change notification settings - Fork 5
Add support for WebACL CRD #7
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
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: TiberiuGC The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test all |
Issue #, if available: prerequisite for WAFv2 [RuleGroup](aws-controllers-k8s/wafv2-controller#6) and [WebACL](aws-controllers-k8s/wafv2-controller#7) CRDs Description of changes: Some WAFv2 API fields have empty json specs `{}`, e.g. https://docs.aws.amazon.com/waf/latest/APIReference/API_AllQueryArguments.html For these type of fields, codegen currently errors out because it infers their gotypes as e.g. `AllQueryArguments *AllQueryArguments` but does not generate a `type AllQueryArguments struct` since the struct itself is empty, and not picked up by `newFieldRecurse` function. The solution proposed in this PR is to allow users to define `marker-shapes`, which instruct codegen to overwrite the type of these empty structs as `[]byte`, both when generating the APIs and when setting up the SDK. e.g. [generator.yaml](https://github.com/aws-controllers-k8s/wafv2-controller/blob/bb682409da8f96c5035783602b9d948c8cc8e21f/apis/v1alpha1/generator.yaml#L15-L24) for WAFv2, and inline: ``` empty_shapes: - All - Method - UriPath - QueryString - AllQueryArguments - RateLimitIP - RateLimitForwardedIP - RateLimitHTTPMethod - NoneAction ``` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
9bfd8b3
to
e6152a1
Compare
e6152a1
to
525bc1a
Compare
@TiberiuGC: The following test failed, say
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. |
Issue #, if available: Description of changes: - on top of, and to be reviewed after #7 - nested statements are allowed in yaml files via strings e.g. ``` statement: andStatement: | statements: - labelMatchStatement: scope: "RULE_SET" key: "aws:UserAgent" value: "Mozilla" - ipSetReferenceStatement: arn: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ``` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: aws-controllers-k8s/community#1300
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.