Skip to content

Commit

Permalink
Adds basic e2e test for certificate (#3)
Browse files Browse the repository at this point in the history
Also adds a bunch of read-only fields to the Certificate's Status struct that needed to be manually added to the generator.yaml file because the Create operation only returns the CertificateArn...

Issue aws-controllers-k8s/community#482

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.
  • Loading branch information
jaypipes authored Jan 20, 2023
1 parent d35a1d8 commit 285dd91
Show file tree
Hide file tree
Showing 18 changed files with 1,403 additions and 55 deletions.
6 changes: 3 additions & 3 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ack_generate_info:
build_date: "2023-01-11T19:39:12Z"
build_date: "2023-01-14T16:13:40Z"
build_hash: cfce82dfeed4e658da394699720394b1f7d23ff6
go_version: go1.19.4
version: v0.22.0-1-gcfce82d
api_directory_checksum: 090c67b92b4d0ddb4b58db94aa4b07b8c69dd530
api_directory_checksum: 202e02932e71256f27a9cd0f6454e508c5b7e9b6
api_version: v1alpha1
aws_sdk_go_version: v1.44.177
generator_config_info:
file_checksum: aa72a600b2490b566fcd54554ee64e386a001799
file_checksum: cf8ed525d9422f011b706c0edf1984d5f70853e5
original_file_name: generator.yaml
last_modification:
reason: API generation
95 changes: 90 additions & 5 deletions apis/v1alpha1/certificate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

118 changes: 116 additions & 2 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ignore:
field_paths:
- "RequestCertificateInput.IdempotencyToken"
- "RequestCertificateInput.ValidationMethod"
operations:
RequestCertificate:
resource_name: Certificate
Expand All @@ -26,8 +27,121 @@ resources:
hooks:
sdk_create_pre_build_request:
template_path: hooks/certificate/sdk_create_pre_build_request.go.tpl
sdk_create_post_set_output:
template_path: hooks/certificate/sdk_create_post_set_output.go.tpl
exceptions:
terminal_codes:
- InvalidParameter
- InvalidDomainValidationOptionsException
- InvalidTagException
- TagPolicyException
- TooManyTagsException
reconcile:
requeue_on_success_seconds: 60
fields:
DomainValidationOptions:
late_initialize: {}
Options:
late_initialize: {}
SubjectAlternativeNames:
late_initialize: {}
KeyAlgorithm:
late_initialize: {}
# NOTE(jaypipes): The Create operation (RequestCertificate) has a
# response with only a single field (certificateArn). All of the status
# fields for the certificate are in the ReadOne operation
# (DescribeCertificate) response, so we need to tell the code-generator
# about all of those fields manually here...
CreatedAt:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.CreatedAt
ExtendedKeyUsages:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.ExtendedKeyUsages
FailureReason:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.FailureReason
ImportedAt:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.ImportedAt
InUseBy:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.InUseBy
IssuedAt:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.IssuedAt
Issuer:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.Issuer
KeyUsages:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.KeyUsages
NotAfter:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.NotAfter
NotBefore:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.NotBefore
RenewalEligibility:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.RenewalEligibility
RenewalSummary:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.RenewalSummary
RevocationReason:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.RevocationReason
RevokedAt:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.RevokedAt
Serial:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.Serial
SignatureAlgorithm:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.SignatureAlgorithm
Status:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.Status
Subject:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.Subject
Type:
is_read_only: true
from:
operation: DescribeCertificate
path: Certificate.Type
112 changes: 107 additions & 5 deletions apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 285dd91

Please sign in to comment.