Skip to content

Commit 4ea0400

Browse files
committed
Apply ServiceId as matching field for VPC Endpoint Service
- Use ServiceID as matching field for list operation - Update synced check to use Available instead of available
1 parent 944d51d commit 4ea0400

File tree

8 files changed

+41
-34
lines changed

8 files changed

+41
-34
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-06-16T02:14:15Z"
3-
build_hash: e675923dfc54d8b6e09730098c3e3e1056d3c1e9
4-
go_version: go1.24.0
5-
version: v0.48.0
2+
build_date: "2025-07-10T22:19:07Z"
3+
build_hash: 580a56e85fed07f60089ef2cae634548b523981b
4+
go_version: go1.24.3
5+
version: v0.48.0-2-g580a56e
66
api_directory_checksum: d162a6e9df2d4861d6c01d42047402b51f341293
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: e6a6ff840d55df735215ac04826122ebf89eb79a
10+
file_checksum: a3b7769e44651dbf7cdf955e76e47458b3436550
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,6 @@ operations:
254254
operation_type:
255255
- Delete
256256
resource_name: VpcEndpointServiceConfiguration
257-
CreateVpcEndpointServiceConfiguration:
258-
output_wrapper_field_path: ServiceConfiguration
259-
DeleteVpcEndpointServiceConfigurations:
260-
operation_type:
261-
- Delete
262-
resource_name: VpcEndpointServiceConfiguration
263257
CreateFlowLogs:
264258
operation_type:
265259
- Create
@@ -1068,7 +1062,10 @@ resources:
10681062
when:
10691063
- path: Status.ServiceState
10701064
in:
1071-
- available
1065+
- Available
1066+
list_operation:
1067+
match_fields:
1068+
- ServiceId
10721069
hooks:
10731070
sdk_delete_post_build_request:
10741071
template_path: hooks/vpc_endpoint_service_configuration/sdk_delete_post_build_request.go.tpl

generator.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,6 @@ operations:
254254
operation_type:
255255
- Delete
256256
resource_name: VpcEndpointServiceConfiguration
257-
CreateVpcEndpointServiceConfiguration:
258-
output_wrapper_field_path: ServiceConfiguration
259-
DeleteVpcEndpointServiceConfigurations:
260-
operation_type:
261-
- Delete
262-
resource_name: VpcEndpointServiceConfiguration
263257
CreateFlowLogs:
264258
operation_type:
265259
- Create
@@ -1068,7 +1062,10 @@ resources:
10681062
when:
10691063
- path: Status.ServiceState
10701064
in:
1071-
- available
1065+
- Available
1066+
list_operation:
1067+
match_fields:
1068+
- ServiceId
10721069
hooks:
10731070
sdk_delete_post_build_request:
10741071
template_path: hooks/vpc_endpoint_service_configuration/sdk_delete_post_build_request.go.tpl

pkg/resource/elastic_ip_address/sdk.go

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

pkg/resource/vpc_endpoint_service_configuration/manager.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.

pkg/resource/vpc_endpoint_service_configuration/sdk.go

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

test/e2e/tests/test_vpc_endpoint_service_configuration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ def test_vpc_endpoint_service_configuration_create_delete(self, ec2_client, simp
100100
# Check VPC Endpoint Service exists in AWS
101101
ec2_validator = EC2Validator(ec2_client)
102102
ec2_validator.assert_vpc_endpoint_service_configuration(resource_id)
103+
assert k8s.wait_on_condition(ref, "ACK.ResourceSynced", "True", wait_periods=5)
104+
103105

104106
# Check that the allowedPrincipal is properly set
105107
allowed_principals = ec2_validator.get_vpc_endpoint_service_permissions(resource_id)

test/e2e/tests/test_vpc_endpoint_service_configuration_adoption.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from e2e.replacement_values import REPLACEMENT_VALUES
2828
from acktest.resources import random_suffix_name
2929
from acktest.k8s import resource as k8s
30+
from acktest import tags
3031

3132
from e2e.tests.helper import EC2Validator
3233

@@ -41,11 +42,13 @@
4142
@pytest.fixture
4243
def vpc_endpoint_service_adoption():
4344
replacements = REPLACEMENT_VALUES.copy()
44-
resource_name = random_suffix_name("vpc-es-adoption", 32)
45+
resource_name = random_suffix_name("vpc-es-adoption", 24)
4546
service_id = get_bootstrap_resources().AdoptedVpcEndpointService.service_id
46-
replacements["VPC_ADOPTION_NAME"] = resource_name
47+
assert service_id is not None
48+
49+
replacements["VPC_ENDPOINT_SERVICE_ADOPTED_NAME"] = resource_name
4750
replacements["ADOPTION_POLICY"] = "adopt"
48-
replacements["ADOPTION_FIELDS"] = f"{{\\\"serviceId\\\": \\\"{service_id}\\\"}}"
51+
replacements["ADOPTION_FIELDS"] = f"{{\\\"serviceID\\\": \\\"{service_id}\\\"}}"
4952

5053
resource_data = load_ec2_resource(
5154
"vpc_endpoint_service_adoption",
@@ -77,6 +80,8 @@ class TestVpcAdoption:
7780
def test_vpc_endpoint_service_configuration_adopt_update(self, ec2_client, vpc_endpoint_service_adoption):
7881
(ref, cr) = vpc_endpoint_service_adoption
7982

83+
time.sleep(CREATE_WAIT_AFTER_SECONDS)
84+
8085
assert cr is not None
8186
assert 'status' in cr
8287
assert 'serviceID' in cr['status']
@@ -90,22 +95,27 @@ def test_vpc_endpoint_service_configuration_adopt_update(self, ec2_client, vpc_e
9095
ec2_validator.assert_vpc_endpoint_service_configuration(resource_id)
9196

9297
endpoint_service_config = ec2_validator.get_vpc_endpoint_service_configuration(resource_id)
93-
assert len(endpoint_service_config['Tags']) == 1
94-
current_tag = endpoint_service_config['Tags'][0]
95-
new_tag = {'Key': 'TestName', 'Value': 'test-value'}
9698

99+
actual_tags = endpoint_service_config['Tags']
100+
tags.assert_ack_system_tags(actual_tags)
101+
102+
name_tag = next((tag for tag in actual_tags if tag['Key'] == 'Name'), None)
103+
assert name_tag is not None
104+
105+
new_tag = {'Key': 'TestName', 'Value': 'test-value'}
97106
updates = {
98-
"spec": {"tags": [current_tag, new_tag]}
107+
"spec": {"tags": [name_tag, new_tag]}
99108
}
100109
k8s.patch_custom_resource(ref, updates)
101110
time.sleep(MODIFY_WAIT_AFTER_SECONDS)
102111

103112
assert k8s.wait_on_condition(ref, "ACK.ResourceSynced", "True", wait_periods=5)
104113

105114
endpoint_service_config = ec2_validator.get_vpc_endpoint_service_configuration(resource_id)
106-
assert len(endpoint_service_config['Tags']) == 2
107-
assert endpoint_service_config['Tags'][0] == current_tag
108-
assert endpoint_service_config['Tags'][1] == new_tag
115+
tags.assert_equal_without_ack_tags(
116+
actual=endpoint_service_config['Tags'],
117+
expected=[name_tag, new_tag],
118+
)
109119

110120

111121

0 commit comments

Comments
 (0)