Skip to content

Commit 9a670ef

Browse files
committed
Removed eks:call.sync as it is not supported and removed logoptions parasms for eks:runJob
1 parent 1907b7d commit 9a670ef

File tree

2 files changed

+12
-58
lines changed

2 files changed

+12
-58
lines changed

src/stepfunctions/steps/service.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ class EksCallStep(Task):
507507
Creates a Task state that allows you to use the Kubernetes API to read and write Kubernetes resource objects via a Kubernetes API endpoint. See `Call Amazon EKS with Step Functions <https://docs.aws.amazon.com/step-functions/latest/dg/connect-eks.html>`_ for more details.
508508
"""
509509

510-
def __init__(self, state_id, wait_for_completion=True, **kwargs):
510+
def __init__(self, state_id, **kwargs):
511511
"""
512512
Args:
513513
state_id (str): State name whose length **must be** less than or equal to 128 unicode characters. State names **must be** unique within the scope of the whole state machine.
@@ -520,23 +520,14 @@ def __init__(self, state_id, wait_for_completion=True, **kwargs):
520520
parameters (dict, optional): The value of this field becomes the effective input for the state.
521521
result_path (str, optional): Path specifying the raw input’s combination with or replacement by the state’s result. (default: '$')
522522
output_path (str, optional): Path applied to the state’s output after the application of `result_path`, producing the effective output which serves as the raw input for the next state. (default: '$')
523-
wait_for_completion (bool, optional): Boolean value set to `True` if the Task state should wait to complete before proceeding to the next step in the workflow. (default: True)
524523
"""
525-
if wait_for_completion:
526-
"""
527-
Example resource arn: arn:aws:states:::eks:createCluster.sync
528-
"""
529524

530-
kwargs[Field.Resource.value] = get_service_integration_arn(EKS_SERVICES_NAME,
531-
EksApi.Call,
532-
IntegrationPattern.WaitForCompletion)
533-
else:
534-
"""
535-
Example resource arn: arn:aws:states:::eks:createCluster
536-
"""
525+
"""
526+
Example resource arn: arn:aws:states:::eks:createCluster
527+
"""
537528

538-
kwargs[Field.Resource.value] = get_service_integration_arn(EKS_SERVICES_NAME,
539-
EksApi.Call)
529+
kwargs[Field.Resource.value] = get_service_integration_arn(EKS_SERVICES_NAME,
530+
EksApi.Call)
540531

541532
super(EksCallStep, self).__init__(state_id, **kwargs)
542533

tests/unit/test_service_steps.py

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -984,9 +984,6 @@ def test_eks_run_job_step_creation():
984984
'ClusterName': 'MyCluster',
985985
'CertificateAuthority': 'ANPAJ2UCCR6DPCEXAMPLE',
986986
'Endpoint': 'https://AKIAIOSFODNN7EXAMPLE.yl4.us-east-1.eks.amazonaws.com',
987-
'LogOptions': {
988-
'RetrieveLogs': True
989-
},
990987
'Job': {
991988
'apiVersion': 'batch/v1',
992989
'kind': 'Job',
@@ -1046,8 +1043,7 @@ def test_eks_run_job_step_creation():
10461043
'restartPolicy': 'Never'}
10471044
}
10481045
}
1049-
},
1050-
'LogOptions': {'RetrieveLogs': True}
1046+
}
10511047
},
10521048
'End': True
10531049
}
@@ -1101,6 +1097,9 @@ def test_eks_run_job_step_creation_sync():
11011097
'CertificateAuthority': 'ANPAJ2UCCR6DPCEXAMPLE',
11021098
'ClusterName': 'MyCluster',
11031099
'Endpoint': 'https://AKIAIOSFODNN7EXAMPLE.yl4.us-east-1.eks.amazonaws.com',
1100+
'LogOptions': {
1101+
'RetrieveLogs': True
1102+
},
11041103
'Job': {
11051104
'apiVersion': 'batch/v1',
11061105
'kind': 'Job',
@@ -1121,16 +1120,15 @@ def test_eks_run_job_step_creation_sync():
11211120
'restartPolicy': 'Never'}
11221121
}
11231122
}
1124-
},
1125-
'LogOptions': {'RetrieveLogs': True}
1123+
}
11261124
},
11271125
'End': True
11281126
}
11291127

11301128

11311129
@patch.object(boto3.session.Session, 'region_name', 'us-east-1')
11321130
def test_eks_call_step_creation():
1133-
step = EksCallStep("Call", wait_for_completion=False, parameters={
1131+
step = EksCallStep("Call", parameters={
11341132
'ClusterName': 'MyCluster',
11351133
'CertificateAuthority': 'ANPAJ2UCCR6DPCEXAMPLE',
11361134
'Endpoint': 'https://444455556666.yl4.us-east-1.eks.amazonaws.com',
@@ -1160,38 +1158,3 @@ def test_eks_call_step_creation():
11601158
},
11611159
'End': True
11621160
}
1163-
1164-
1165-
@patch.object(boto3.session.Session, 'region_name', 'us-east-1')
1166-
def test_eks_call_step_creation_sync():
1167-
step = EksCallStep("Call sync", parameters={
1168-
'ClusterName': 'MyCluster',
1169-
'CertificateAuthority': 'ANPAJ2UCCR6DPCEXAMPLE',
1170-
'Endpoint': 'https://444455556666.yl4.us-east-1.eks.amazonaws.com',
1171-
'Method': 'GET',
1172-
'Path': '/api/v1/namespaces/default/pods',
1173-
'QueryParameters': {
1174-
'labelSelector': [
1175-
'job-name=example-job'
1176-
]
1177-
}
1178-
})
1179-
1180-
assert step.to_dict() == {
1181-
'Type': 'Task',
1182-
'Resource': 'arn:aws:states:::eks:call.sync',
1183-
'Parameters': {
1184-
'ClusterName': 'MyCluster',
1185-
'CertificateAuthority': 'ANPAJ2UCCR6DPCEXAMPLE',
1186-
'Endpoint': 'https://444455556666.yl4.us-east-1.eks.amazonaws.com',
1187-
'Method': 'GET',
1188-
'Path': '/api/v1/namespaces/default/pods',
1189-
'QueryParameters': {
1190-
'labelSelector': [
1191-
'job-name=example-job'
1192-
]
1193-
}
1194-
},
1195-
'End': True
1196-
}
1197-

0 commit comments

Comments
 (0)