Skip to content

Commit

Permalink
Generate FileSystem resource (#1)
Browse files Browse the repository at this point in the history
aws-controllers-k8s/community#328

Generate `FileSystem` resource
- Add necessary hooks for create/update/delete methods
- Add e2e tests for CRUD operations

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
a-hilaly authored Feb 10, 2024
1 parent f4373ac commit 9ce40df
Show file tree
Hide file tree
Showing 47 changed files with 5,141 additions and 248 deletions.
10 changes: 5 additions & 5 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: "2024-01-29T07:12:43Z"
build_hash: 92f531cde5631865cfc3dfa778cbc9611f3a64c3
build_date: "2024-02-10T21:13:26Z"
build_hash: 6af91cdf64ccaf8cab2a43397266e57d1ec553de
go_version: go1.21.5
version: v0.29.2
api_directory_checksum: 5ce8aebe7f8f69326f1333783d90fdc05dca3920
version: v0.29.2-5-g6af91cd
api_directory_checksum: 299c791a97d38f7efb91e8747af9232447772100
api_version: v1alpha1
aws_sdk_go_version: v1.50.0
generator_config_info:
file_checksum: c3a9374853a9db6a8d308987c7bfaba35852a043
file_checksum: e2802d282dc5f4cbdefc8e4c9e30596222eac5dd
original_file_name: generator.yaml
last_modification:
reason: API generation
230 changes: 230 additions & 0 deletions apis/v1alpha1/file_system.go

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

87 changes: 85 additions & 2 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,91 @@
ignore:
resource_names:
- AccessPoint
- FileSystem
# FileSystem
- MountTarget
- ReplicationConfiguration
field_paths:
- CreateFileSystemInput.CreationToken
- FileSystemDescription.CreationToken
- PutBackupPolicyInput.FileSystemId
- PutLifecycleConfigurationInput.FileSystemId
- PutFileSystemPolicyInput.FileSystemId
- UpdateFileSystemProtectionInput.FileSystemId
model_name: elasticfilesystem
controller_name: efs
controller_name: efs
resources:
FileSystem:
fields:
KMSKeyID:
references:
resource: Key
path: Status.ACKResourceMetadata.ARN
service_name: kms
FileSystemProtection:
is_read_only: false
from:
operation: UpdateFileSystemProtection
path: .
BackupPolicy:
from:
operation: PutBackupPolicy
path: BackupPolicy
Policy:
from:
operation: PutFileSystemPolicy
path: Policy
LifecyclePolicies:
from:
operation: PutLifecycleConfiguration
path: LifecyclePolicies
hooks:
delta_pre_compare:
code: customPreCompare(delta, a, b)
sdk_update_post_request:
code: return desired, nil
sdk_create_post_set_output:
template_path: hooks/file_system/sdk_create_post_set_output.go.tpl
sdk_read_many_post_set_output:
template_path: hooks/file_system/sdk_read_many_post_set_output.go.tpl
sdk_update_pre_build_request:
template_path: hooks/file_system/sdk_update_pre_build_request.go.tpl
print:
add_age_column: true
add_synced_column: true
order_by: index
additional_columns:
- name: ID
json_path: .status.fileSystemID
type: string
index: 10
- name: ENCRYPTED
json_path: .status.encrypted
type: boolean
index: 11
- name: PERFORMANCEMODE
json_path: .status.performanceMode
type: string
index: 15
priority: 1
- name: THROUGHPUTMODE
json_path: .status.throughputMode
type: string
index: 16
priority: 1
- name: PROVISIONEDTHROUGHPUT
json_path: .status.provisionedThroughputInMiBps
type: string
index: 17
priority: 1
- name: SIZE
json_path: .status.sizeInBytes.value
type: integer
index: 20
- name: MOUNTTARGETS
json_path: .status.numberOfMountTargets
type: integer
index: 25
- name: STATE
json_path: .status.lifeCycleState
type: string
index: 30
Loading

0 comments on commit 9ce40df

Please sign in to comment.