Skip to content

Commit

Permalink
Support Put* fields for slices of configuration types (#57)
Browse files Browse the repository at this point in the history
Implements aws-controllers-k8s/community#914

Description of changes:
Uses the new custom fields code-generator PR (aws-controllers-k8s/code-generator#222) to create lists of configuration types. At runtime each of these configurations is put individually (mapped using their ID field) onto the bucket. For each reconciliation, we describe the configurations using a `List*` operation and determine the delta for each configuration using a generated `compare*` method in the `sdk.go`. The configuration elements are individually created, deleted, updated or no-op'd depending on the diff. 

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
RedbackThomson committed Oct 27, 2021
1 parent 41807fe commit 72da833
Show file tree
Hide file tree
Showing 12 changed files with 2,793 additions and 40 deletions.
8 changes: 4 additions & 4 deletions apis/v1alpha1/ack-generate-metadata.yaml
@@ -1,13 +1,13 @@
ack_generate_info:
build_date: "2021-10-14T18:50:30Z"
build_hash: f4166ae9942034b0552f244685515eef5a92dc25
build_date: "2021-10-27T19:39:24Z"
build_hash: 6cfd5d8443975a287535dc27424206ac133ebb24
go_version: go1.17.1
version: v0.15.1
api_directory_checksum: e1236617364bb9947bcbfbeb21ce75841b5407f3
api_directory_checksum: 5157c106fef6bc423adba5eaf17c55de26b36d1e
api_version: v1alpha1
aws_sdk_go_version: v1.37.10
generator_config_info:
file_checksum: 45772c7b934f89394b89fe6214164cd8fe76a59e
file_checksum: 6a5e4faafc21f5c309ef5219f784fa8228d01744
original_file_name: generator.yaml
last_modification:
reason: API generation
8 changes: 8 additions & 0 deletions apis/v1alpha1/bucket.go

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

28 changes: 12 additions & 16 deletions apis/v1alpha1/generator.yaml
Expand Up @@ -21,10 +21,9 @@ resources:
from:
operation: PutBucketAccelerateConfiguration
path: AccelerateConfiguration
# AnalyticsConfiguration:
# from:
# operation: PutBucketAnalyticsConfiguration
# path: AnalyticsConfiguration # Double check about ID
Analytics:
custom_field:
list_of: AnalyticsConfiguration
CORS:
from:
operation: PutBucketCors
Expand All @@ -33,14 +32,12 @@ resources:
from:
operation: PutBucketEncryption
path: ServerSideEncryptionConfiguration
# IntelligentTieringConfiguration:
# from:
# operation: PutBucketIntelligentTieringConfiguration
# path: IntelligentTieringConfiguration # Double check about ID
# InventoryConfiguration:
# from:
# operation: PutBucketInventoryConfiguration
# path: InventoryConfiguration # Double check about ID
IntelligentTiering:
custom_field:
list_of: IntelligentTieringConfiguration
Inventory:
custom_field:
list_of: InventoryConfiguration
Lifecycle:
from:
operation: PutBucketLifecycleConfiguration
Expand All @@ -49,10 +46,9 @@ resources:
from:
operation: PutBucketLogging
path: BucketLoggingStatus
# MetricsConfiguration:
# from:
# operation: PutBucketMetricsConfiguration
# path: MetricsConfiguration # Double check about ID
Metrics:
custom_field:
list_of: MetricsConfiguration
Notification:
from:
operation: PutBucketNotificationConfiguration
Expand Down
134 changes: 130 additions & 4 deletions apis/v1alpha1/types.go

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

0 comments on commit 72da833

Please sign in to comment.