Skip to content

Commit 87830d5

Browse files
authored
Fix resource synced status (#8)
Issue #, if available: [2581](aws-controllers-k8s/community#2581) Description of changes: - Add synced config for "ACTIVE" status - Move `/pkg/resource/tags/` to `/pkg/tags/` - Rename func `custom_update` to `customUpdate` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 54e6965 commit 87830d5

File tree

9 files changed

+29
-8
lines changed

9 files changed

+29
-8
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-10-10T17:21:27Z"
2+
build_date: "2025-10-15T17:26:29Z"
33
build_hash: eaabefb6bd7b2be8a1baf4478f22b3310e6921c8
44
go_version: go1.25.0
55
version: v0.52.0-6-geaabefb
66
api_directory_checksum: c2a05f6479bd52a75cd0edad0268006c9c330238
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.39.0
99
generator_config_info:
10-
file_checksum: d05d6b6dae697b39793019251b54bcf9766f0238
10+
file_checksum: 52a529428a3927a25df922fa900a75630016a7c7
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ resources:
3232
InferenceProfile:
3333
is_arn_primary_key: true
3434
update_operation:
35-
custom_method_name: custom_update
35+
custom_method_name: customUpdate
3636

3737
fields:
3838
Description:
@@ -56,4 +56,10 @@ resources:
5656
sdk_delete_post_build_request:
5757
template_path: hooks/inference_profile/sdk_delete_post_build_request.go.tpl
5858

59+
synced:
60+
when:
61+
- path: Status.Status
62+
in:
63+
- ACTIVE
64+
5965

generator.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ resources:
3232
InferenceProfile:
3333
is_arn_primary_key: true
3434
update_operation:
35-
custom_method_name: custom_update
35+
custom_method_name: customUpdate
3636

3737
fields:
3838
Description:
@@ -56,4 +56,10 @@ resources:
5656
sdk_delete_post_build_request:
5757
template_path: hooks/inference_profile/sdk_delete_post_build_request.go.tpl
5858

59+
synced:
60+
when:
61+
- path: Status.Status
62+
in:
63+
- ACTIVE
64+
5965

pkg/resource/inference_profile/hooks.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"context"
1818

1919
svcapitypes "github.com/aws-controllers-k8s/bedrock-controller/apis/v1alpha1"
20-
"github.com/aws-controllers-k8s/bedrock-controller/pkg/resource/tags"
20+
"github.com/aws-controllers-k8s/bedrock-controller/pkg/tags"
2121
ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
2222
)
2323

@@ -51,9 +51,9 @@ func (rm *resourceManager) customCheckRequired(r *resource) bool {
5151
return r.ko.Status.ACKResourceMetadata == nil || r.ko.Status.ACKResourceMetadata.ARN == nil
5252
}
5353

54-
// custom_update handles updates for inference profiles. Since inference profiles
54+
// customUpdate handles updates for inference profiles. Since inference profiles
5555
// are immutable resources, only tag updates are supported.
56-
func (rm *resourceManager) custom_update(
56+
func (rm *resourceManager) customUpdate(
5757
ctx context.Context,
5858
desired *resource,
5959
latest *resource,

pkg/resource/inference_profile/manager.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/resource/inference_profile/sdk.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
File renamed without changes.

test/e2e/tests/test_inference_profile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def test_create_delete_inference_profile(self, simple_inference_profile, bedrock
8686
assert inference_profile_arn is not None
8787
assert cr["spec"]["description"] == TEST_DESCRIPTION
8888
assert cr["spec"]["modelSource"]["copyFrom"] == TEST_MODEL_ID
89+
assert cr["status"]["status"] == "ACTIVE"
8990

9091
expected_tags = [
9192
{"key": TAG_KEY_1, "value": TAG_VALUE_1},

0 commit comments

Comments
 (0)