-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some more goldenfile tests (#614)
* Add more golden file tests - patch 1 Signed-off-by: Mustafa Abdelrahman <[email protected]> * remove `resourcesType` field which is unnecessary Signed-off-by: Mustafa Abdelrahman <[email protected]> * Fix existing Golden file tests Signed-off-by: Lucas Thiesen <[email protected]> * Fix remaining goldenfile tests Signed-off-by: Lucas Thiesen <[email protected]> * Fix ingress sharing parameter in test fixtures Signed-off-by: Lucas Thiesen <[email protected]> * Add ability to check multiple input/output to golden files tests Signed-off-by: Lucas Thiesen <[email protected]> * Sync annotation and improve naming in golden file tests Signed-off-by: Lucas Thiesen <[email protected]> * Add issue link to TODO comment in CF mocks Signed-off-by: Lucas Thiesen <[email protected]> * Fix identation Signed-off-by: Lucas Thiesen <[email protected]> --------- Signed-off-by: Mustafa Abdelrahman <[email protected]> Signed-off-by: Lucas Thiesen <[email protected]> Co-authored-by: Lucas Thiesen <[email protected]>
- Loading branch information
1 parent
152d27c
commit dd95fc2
Showing
36 changed files
with
2,157 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
testdata/ing_shared_rg_notshared_alb/input/k8s/01-ing.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: myingress | ||
annotations: | ||
zalando.org/aws-load-balancer-shared: "true" | ||
spec: | ||
rules: | ||
- host: foo.bar.org | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: foo-bar-service | ||
port: | ||
name: main-port | ||
path: / | ||
pathType: ImplementationSpecific |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: zalando.org/v1 | ||
kind: RouteGroup | ||
metadata: | ||
name: my-route-group | ||
annotations: | ||
zalando.org/aws-load-balancer-shared: "false" | ||
spec: | ||
hosts: | ||
- foo.bar.org | ||
backends: | ||
- name: my-backend | ||
type: service | ||
serviceName: my-service | ||
servicePort: 80 | ||
routes: | ||
- pathSubtree: / | ||
backends: | ||
- backendName: my-backend |
File renamed without changes.
54 changes: 54 additions & 0 deletions
54
testdata/ing_shared_rg_notshared_alb/output/params/02-rg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
[ | ||
{ | ||
"parameterKey": "LoadBalancerSchemeParameter", | ||
"parameterValue": "internet-facing" | ||
}, | ||
{ | ||
"parameterKey": "LoadBalancerSecurityGroupParameter", | ||
"parameterValue": "42" | ||
}, | ||
{ | ||
"parameterKey": "LoadBalancerSubnetsParameter", | ||
"parameterValue": "foo1" | ||
}, | ||
{ | ||
"parameterKey": "TargetGroupVPCIDParameter", | ||
"parameterValue": "1" | ||
}, | ||
{ | ||
"parameterKey": "TargetGroupTargetPortParameter", | ||
"parameterValue": "0" | ||
}, | ||
{ | ||
"parameterKey": "ListenerSslPolicyParameter", | ||
"parameterValue": "ELBSecurityPolicy-2016-08" | ||
}, | ||
{ | ||
"parameterKey": "IpAddressType", | ||
"parameterValue": "ipv4" | ||
}, | ||
{ | ||
"parameterKey": "Type", | ||
"parameterValue": "application" | ||
}, | ||
{ | ||
"parameterKey": "HTTP2", | ||
"parameterValue": "true" | ||
}, | ||
{ | ||
"parameterKey": "TargetGroupHealthCheckPathParameter", | ||
"parameterValue": "" | ||
}, | ||
{ | ||
"parameterKey": "TargetGroupHealthCheckPortParameter", | ||
"parameterValue": "0" | ||
}, | ||
{ | ||
"parameterKey": "TargetGroupHealthCheckIntervalParameter", | ||
"parameterValue": "0" | ||
}, | ||
{ | ||
"parameterKey": "TargetGroupHealthCheckTimeoutParameter", | ||
"parameterValue": "0" | ||
} | ||
] |
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
testdata/ing_shared_rg_notshared_alb/output/tags/02-rg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[ | ||
{ | ||
"key": "kubernetes:application", | ||
"value": "" | ||
},{ | ||
"key": "kubernetes.io/cluster/aws:123:eu-central-1:kube-1", | ||
"value": "owned" | ||
},{ | ||
"key": "ingress:certificate-arn/DUMMY", | ||
"value": "0001-01-01T00:00:00Z" | ||
},{ | ||
"key": "ingress:owner", | ||
"value": "/my-route-group" | ||
} | ||
] |
File renamed without changes.
219 changes: 219 additions & 0 deletions
219
testdata/ing_shared_rg_notshared_alb/output/templates/02-rg.cf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Description": "Load Balancer for Kubernetes Ingress", | ||
"Parameters": { | ||
"HTTP2": { | ||
"Type": "String", | ||
"Default": "true", | ||
"Description": "H2 Enabled" | ||
}, | ||
"IpAddressType": { | ||
"Type": "String", | ||
"Default": "ipv4", | ||
"Description": "IP Address Type, 'ipv4' or 'dualstack'" | ||
}, | ||
"ListenerSslPolicyParameter": { | ||
"Type": "String", | ||
"Default": "ELBSecurityPolicy-2016-08", | ||
"Description": "The HTTPS SSL Security Policy Name" | ||
}, | ||
"LoadBalancerSchemeParameter": { | ||
"Type": "String", | ||
"Default": "internet-facing", | ||
"Description": "The Load Balancer scheme - 'internal' or 'internet-facing'" | ||
}, | ||
"LoadBalancerSecurityGroupParameter": { | ||
"Type": "List\u003cAWS::EC2::SecurityGroup::Id\u003e", | ||
"Description": "The security group ID for the Load Balancer" | ||
}, | ||
"LoadBalancerSubnetsParameter": { | ||
"Type": "List\u003cAWS::EC2::Subnet::Id\u003e", | ||
"Description": "The list of subnets IDs for the Load Balancer" | ||
}, | ||
"TargetGroupHealthCheckIntervalParameter": { | ||
"Type": "Number", | ||
"Default": "10", | ||
"Description": "The healthcheck interval" | ||
}, | ||
"TargetGroupHealthCheckPathParameter": { | ||
"Type": "String", | ||
"Default": "/kube-system/healthz", | ||
"Description": "The healthcheck path" | ||
}, | ||
"TargetGroupHealthCheckPortParameter": { | ||
"Type": "Number", | ||
"Default": "9999", | ||
"Description": "The healthcheck port" | ||
}, | ||
"TargetGroupHealthCheckTimeoutParameter": { | ||
"Type": "Number", | ||
"Default": "5", | ||
"Description": "The healthcheck timeout" | ||
}, | ||
"TargetGroupTargetPortParameter": { | ||
"Type": "Number", | ||
"Default": "9999", | ||
"Description": "The target port" | ||
}, | ||
"TargetGroupVPCIDParameter": { | ||
"Type": "AWS::EC2::VPC::Id", | ||
"Description": "The VPCID for the TargetGroup" | ||
}, | ||
"Type": { | ||
"Type": "String", | ||
"Default": "application", | ||
"Description": "Loadbalancer Type, 'application' or 'network'" | ||
} | ||
}, | ||
"Resources": { | ||
"HTTPListener": { | ||
"Type": "AWS::ElasticLoadBalancingV2::Listener", | ||
"Properties": { | ||
"DefaultActions": [ | ||
{ | ||
"TargetGroupArn": { | ||
"Ref": "TG" | ||
}, | ||
"Type": "forward" | ||
} | ||
], | ||
"LoadBalancerArn": { | ||
"Ref": "LB" | ||
}, | ||
"Port": 80, | ||
"Protocol": "HTTP" | ||
} | ||
}, | ||
"HTTPSListener": { | ||
"Type": "AWS::ElasticLoadBalancingV2::Listener", | ||
"Properties": { | ||
"Certificates": [ | ||
{ | ||
"CertificateArn": "DUMMY" | ||
} | ||
], | ||
"DefaultActions": [ | ||
{ | ||
"TargetGroupArn": { | ||
"Ref": "TG" | ||
}, | ||
"Type": "forward" | ||
} | ||
], | ||
"LoadBalancerArn": { | ||
"Ref": "LB" | ||
}, | ||
"Port": 443, | ||
"Protocol": "HTTPS", | ||
"SslPolicy": { | ||
"Ref": "ListenerSslPolicyParameter" | ||
} | ||
} | ||
}, | ||
"HTTPSListenerCertificatefc48082457b770e278fc0bd3d392d127869993166f76e8df57d19a0e662820ea": { | ||
"Type": "AWS::ElasticLoadBalancingV2::ListenerCertificate", | ||
"Properties": { | ||
"Certificates": [ | ||
{ | ||
"CertificateArn": "DUMMY" | ||
} | ||
], | ||
"ListenerArn": { | ||
"Ref": "HTTPSListener" | ||
} | ||
} | ||
}, | ||
"LB": { | ||
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", | ||
"Properties": { | ||
"IpAddressType": { | ||
"Ref": "IpAddressType" | ||
}, | ||
"LoadBalancerAttributes": [ | ||
{ | ||
"Key": "idle_timeout.timeout_seconds", | ||
"Value": "0" | ||
}, | ||
{ | ||
"Key": "routing.http2.enabled", | ||
"Value": "true" | ||
}, | ||
{ | ||
"Key": "access_logs.s3.enabled", | ||
"Value": "false" | ||
} | ||
], | ||
"Scheme": { | ||
"Ref": "LoadBalancerSchemeParameter" | ||
}, | ||
"SecurityGroups": { | ||
"Ref": "LoadBalancerSecurityGroupParameter" | ||
}, | ||
"Subnets": { | ||
"Ref": "LoadBalancerSubnetsParameter" | ||
}, | ||
"Tags": [ | ||
{ | ||
"Key": "StackName", | ||
"Value": { | ||
"Ref": "AWS::StackName" | ||
} | ||
} | ||
], | ||
"Type": { | ||
"Ref": "Type" | ||
} | ||
} | ||
}, | ||
"TG": { | ||
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup", | ||
"Properties": { | ||
"HealthCheckIntervalSeconds": { | ||
"Ref": "TargetGroupHealthCheckIntervalParameter" | ||
}, | ||
"HealthCheckPath": { | ||
"Ref": "TargetGroupHealthCheckPathParameter" | ||
}, | ||
"HealthCheckPort": { | ||
"Ref": "TargetGroupHealthCheckPortParameter" | ||
}, | ||
"HealthCheckProtocol": "HTTP", | ||
"HealthCheckTimeoutSeconds": { | ||
"Ref": "TargetGroupHealthCheckTimeoutParameter" | ||
}, | ||
"HealthyThresholdCount": 0, | ||
"Port": { | ||
"Ref": "TargetGroupTargetPortParameter" | ||
}, | ||
"Protocol": "HTTP", | ||
"TargetGroupAttributes": [ | ||
{ | ||
"Key": "deregistration_delay.timeout_seconds", | ||
"Value": "0" | ||
} | ||
], | ||
"UnhealthyThresholdCount": 0, | ||
"VpcId": { | ||
"Ref": "TargetGroupVPCIDParameter" | ||
} | ||
} | ||
} | ||
}, | ||
"Outputs": { | ||
"LoadBalancerDNSName": { | ||
"Description": "DNS name for the LoadBalancer", | ||
"Value": { | ||
"Fn::GetAtt": [ | ||
"LB", | ||
"DNSName" | ||
] | ||
} | ||
}, | ||
"TargetGroupARN": { | ||
"Description": "The ARN of the TargetGroup", | ||
"Value": { | ||
"Ref": "TG" | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.