diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index 08147ac..dab985e 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,5 +1,5 @@ ack_generate_info: - build_date: "2025-10-10T17:21:27Z" + build_date: "2025-10-15T17:26:29Z" build_hash: eaabefb6bd7b2be8a1baf4478f22b3310e6921c8 go_version: go1.25.0 version: v0.52.0-6-geaabefb @@ -7,7 +7,7 @@ api_directory_checksum: c2a05f6479bd52a75cd0edad0268006c9c330238 api_version: v1alpha1 aws_sdk_go_version: v1.39.0 generator_config_info: - file_checksum: d05d6b6dae697b39793019251b54bcf9766f0238 + file_checksum: 52a529428a3927a25df922fa900a75630016a7c7 original_file_name: generator.yaml last_modification: reason: API generation diff --git a/apis/v1alpha1/generator.yaml b/apis/v1alpha1/generator.yaml index 0d06bc3..5204bc8 100644 --- a/apis/v1alpha1/generator.yaml +++ b/apis/v1alpha1/generator.yaml @@ -32,7 +32,7 @@ resources: InferenceProfile: is_arn_primary_key: true update_operation: - custom_method_name: custom_update + custom_method_name: customUpdate fields: Description: @@ -56,4 +56,10 @@ resources: sdk_delete_post_build_request: template_path: hooks/inference_profile/sdk_delete_post_build_request.go.tpl + synced: + when: + - path: Status.Status + in: + - ACTIVE + diff --git a/generator.yaml b/generator.yaml index 0d06bc3..5204bc8 100644 --- a/generator.yaml +++ b/generator.yaml @@ -32,7 +32,7 @@ resources: InferenceProfile: is_arn_primary_key: true update_operation: - custom_method_name: custom_update + custom_method_name: customUpdate fields: Description: @@ -56,4 +56,10 @@ resources: sdk_delete_post_build_request: template_path: hooks/inference_profile/sdk_delete_post_build_request.go.tpl + synced: + when: + - path: Status.Status + in: + - ACTIVE + diff --git a/pkg/resource/inference_profile/hooks.go b/pkg/resource/inference_profile/hooks.go index 2f068b9..a5130d4 100644 --- a/pkg/resource/inference_profile/hooks.go +++ b/pkg/resource/inference_profile/hooks.go @@ -17,7 +17,7 @@ import ( "context" svcapitypes "github.com/aws-controllers-k8s/bedrock-controller/apis/v1alpha1" - "github.com/aws-controllers-k8s/bedrock-controller/pkg/resource/tags" + "github.com/aws-controllers-k8s/bedrock-controller/pkg/tags" ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare" ) @@ -51,9 +51,9 @@ func (rm *resourceManager) customCheckRequired(r *resource) bool { return r.ko.Status.ACKResourceMetadata == nil || r.ko.Status.ACKResourceMetadata.ARN == nil } -// custom_update handles updates for inference profiles. Since inference profiles +// customUpdate handles updates for inference profiles. Since inference profiles // are immutable resources, only tag updates are supported. -func (rm *resourceManager) custom_update( +func (rm *resourceManager) customUpdate( ctx context.Context, desired *resource, latest *resource, diff --git a/pkg/resource/inference_profile/manager.go b/pkg/resource/inference_profile/manager.go index ec0f10f..3a2ffd6 100644 --- a/pkg/resource/inference_profile/manager.go +++ b/pkg/resource/inference_profile/manager.go @@ -268,6 +268,14 @@ func (rm *resourceManager) IsSynced(ctx context.Context, res acktypes.AWSResourc panic("resource manager's IsSynced() method received resource with nil CR object") } + if r.ko.Status.Status == nil { + return false, nil + } + statusCandidates := []string{"ACTIVE"} + if !ackutil.InStrings(*r.ko.Status.Status, statusCandidates) { + return false, nil + } + return true, nil } diff --git a/pkg/resource/inference_profile/sdk.go b/pkg/resource/inference_profile/sdk.go index 6c0ee1f..e779457 100644 --- a/pkg/resource/inference_profile/sdk.go +++ b/pkg/resource/inference_profile/sdk.go @@ -247,7 +247,7 @@ func (rm *resourceManager) sdkUpdate( latest *resource, delta *ackcompare.Delta, ) (*resource, error) { - return rm.custom_update(ctx, desired, latest, delta) + return rm.customUpdate(ctx, desired, latest, delta) } // sdkDelete deletes the supplied resource in the backend AWS service API diff --git a/pkg/resource/tags/sync.go b/pkg/tags/sync.go similarity index 100% rename from pkg/resource/tags/sync.go rename to pkg/tags/sync.go diff --git a/pkg/resource/tags/sync_test.go b/pkg/tags/sync_test.go similarity index 100% rename from pkg/resource/tags/sync_test.go rename to pkg/tags/sync_test.go diff --git a/test/e2e/tests/test_inference_profile.py b/test/e2e/tests/test_inference_profile.py index 2100b61..7de9df9 100644 --- a/test/e2e/tests/test_inference_profile.py +++ b/test/e2e/tests/test_inference_profile.py @@ -86,6 +86,7 @@ def test_create_delete_inference_profile(self, simple_inference_profile, bedrock assert inference_profile_arn is not None assert cr["spec"]["description"] == TEST_DESCRIPTION assert cr["spec"]["modelSource"]["copyFrom"] == TEST_MODEL_ID + assert cr["status"]["status"] == "ACTIVE" expected_tags = [ {"key": TAG_KEY_1, "value": TAG_VALUE_1},