Skip to content

Commit 1d00b1c

Browse files
authored
Merge pull request #2235 from saiharsha-plivo/fix/ecs-service
fix(ecs): issue with empty network configuration parameter
2 parents 76812a9 + 374cdfb commit 1d00b1c

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

examples/ecs/service.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,41 @@ spec:
3737
name: example
3838
providerConfigRef:
3939
name: example
40+
---
41+
apiVersion: ecs.aws.crossplane.io/v1alpha1
42+
kind: Service
43+
metadata:
44+
name: nginx-test-ecs
45+
annotations:
46+
task-definition-network-mode: awsvpc
47+
spec:
48+
forProvider:
49+
cluster: arn:aws:ecs:us-east-1:123456789:cluster/crossplane-ecs-controller-test
50+
launchType: EC2
51+
region: us-east-1
52+
schedulingStrategy: DAEMON
53+
networkConfiguration:
54+
awsvpcConfiguration:
55+
assignPublicIP: DISABLED
56+
subnets:
57+
- subnet-06338caec7dcf
58+
- subnet-02a8df89fdafa
59+
taskDefinition: arn:aws:ecs:us-east-1:123456789:task-definition/nginx:3
60+
providerConfigRef:
61+
name: providerconfig-aws
62+
---
63+
apiVersion: ecs.aws.crossplane.io/v1alpha1
64+
kind: Service
65+
metadata:
66+
name: filebeat-test
67+
annotations:
68+
task-definition-network-mode: host
69+
spec:
70+
forProvider:
71+
cluster: arn:aws:ecs:us-east-1:123456789:cluster/crossplane-ecs-controller-test
72+
launchType: EC2
73+
region: us-east-1
74+
schedulingStrategy: DAEMON
75+
taskDefinition: arn:aws:ecs:us-east-1:123456789:task-definition/pratyush-filebeat:1
76+
providerConfigRef:
77+
name: providerconfig-aws

pkg/controller/ecs/service/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ func generateNetworkConfiguration(cr *svcapitypes.Service) *svcsdk.NetworkConfig
537537
networkConfiguration := &svcsdk.NetworkConfiguration{}
538538

539539
if cr.Spec.ForProvider.NetworkConfiguration == nil {
540-
return networkConfiguration
540+
return nil
541541
}
542542

543543
if cr.Spec.ForProvider.NetworkConfiguration.AWSvpcConfiguration != nil {

0 commit comments

Comments
 (0)