From 9532601b2af49c7da2cf0d542557c637c8443a2f Mon Sep 17 00:00:00 2001 From: Lucas Thiesen Date: Thu, 19 Oct 2023 17:55:25 +0200 Subject: [PATCH] Fix remaining goldenfile tests Signed-off-by: Lucas Thiesen --- .../{ => k8s}/ing.yaml | 0 .../{ => k8s}/rg.yaml | 0 testdata/ingress_rg_notshared_alb/params.json | 54 +++++++++++++++++++ testdata/ingress_rg_notshared_alb/tags.json | 15 ++++++ .../{expected.cf => template.cf} | 0 .../ingress_rg_shared_alb/{ => k8s}/ing.yaml | 0 .../ingress_rg_shared_alb/{ => k8s}/rg.yaml | 0 testdata/ingress_rg_shared_alb/params.json | 54 +++++++++++++++++++ testdata/ingress_rg_shared_alb/tags.json | 15 ++++++ .../{expected.cf => template.cf} | 0 .../ingress_rg_shared_nlb/{ => k8s}/ing.yaml | 0 .../ingress_rg_shared_nlb/{ => k8s}/rg.yaml | 0 testdata/ingress_rg_shared_nlb/params.json | 54 +++++++++++++++++++ testdata/ingress_rg_shared_nlb/tags.json | 15 ++++++ .../{expected.cf => template.cf} | 0 testdata/rg_alb/{ => k8s}/rg.yaml | 0 testdata/rg_alb/params.json | 54 +++++++++++++++++++ testdata/rg_alb/tags.json | 12 +++++ testdata/rg_alb/{expected.cf => template.cf} | 0 testdata/rg_nlb/{ => k8s}/rg.yaml | 0 testdata/rg_nlb/params.json | 54 +++++++++++++++++++ testdata/rg_nlb/tags.json | 12 +++++ testdata/rg_nlb/{expected.cf => template.cf} | 0 worker_test.go | 2 - 24 files changed, 339 insertions(+), 2 deletions(-) rename testdata/ingress_rg_notshared_alb/{ => k8s}/ing.yaml (100%) rename testdata/ingress_rg_notshared_alb/{ => k8s}/rg.yaml (100%) create mode 100644 testdata/ingress_rg_notshared_alb/params.json create mode 100644 testdata/ingress_rg_notshared_alb/tags.json rename testdata/ingress_rg_notshared_alb/{expected.cf => template.cf} (100%) rename testdata/ingress_rg_shared_alb/{ => k8s}/ing.yaml (100%) rename testdata/ingress_rg_shared_alb/{ => k8s}/rg.yaml (100%) create mode 100644 testdata/ingress_rg_shared_alb/params.json create mode 100644 testdata/ingress_rg_shared_alb/tags.json rename testdata/ingress_rg_shared_alb/{expected.cf => template.cf} (100%) rename testdata/ingress_rg_shared_nlb/{ => k8s}/ing.yaml (100%) rename testdata/ingress_rg_shared_nlb/{ => k8s}/rg.yaml (100%) create mode 100644 testdata/ingress_rg_shared_nlb/params.json create mode 100644 testdata/ingress_rg_shared_nlb/tags.json rename testdata/ingress_rg_shared_nlb/{expected.cf => template.cf} (100%) rename testdata/rg_alb/{ => k8s}/rg.yaml (100%) create mode 100644 testdata/rg_alb/params.json create mode 100644 testdata/rg_alb/tags.json rename testdata/rg_alb/{expected.cf => template.cf} (100%) rename testdata/rg_nlb/{ => k8s}/rg.yaml (100%) create mode 100644 testdata/rg_nlb/params.json create mode 100644 testdata/rg_nlb/tags.json rename testdata/rg_nlb/{expected.cf => template.cf} (100%) diff --git a/testdata/ingress_rg_notshared_alb/ing.yaml b/testdata/ingress_rg_notshared_alb/k8s/ing.yaml similarity index 100% rename from testdata/ingress_rg_notshared_alb/ing.yaml rename to testdata/ingress_rg_notshared_alb/k8s/ing.yaml diff --git a/testdata/ingress_rg_notshared_alb/rg.yaml b/testdata/ingress_rg_notshared_alb/k8s/rg.yaml similarity index 100% rename from testdata/ingress_rg_notshared_alb/rg.yaml rename to testdata/ingress_rg_notshared_alb/k8s/rg.yaml diff --git a/testdata/ingress_rg_notshared_alb/params.json b/testdata/ingress_rg_notshared_alb/params.json new file mode 100644 index 00000000..c1ecf899 --- /dev/null +++ b/testdata/ingress_rg_notshared_alb/params.json @@ -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" + } +] diff --git a/testdata/ingress_rg_notshared_alb/tags.json b/testdata/ingress_rg_notshared_alb/tags.json new file mode 100644 index 00000000..04f7153a --- /dev/null +++ b/testdata/ingress_rg_notshared_alb/tags.json @@ -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" + } +] diff --git a/testdata/ingress_rg_notshared_alb/expected.cf b/testdata/ingress_rg_notshared_alb/template.cf similarity index 100% rename from testdata/ingress_rg_notshared_alb/expected.cf rename to testdata/ingress_rg_notshared_alb/template.cf diff --git a/testdata/ingress_rg_shared_alb/ing.yaml b/testdata/ingress_rg_shared_alb/k8s/ing.yaml similarity index 100% rename from testdata/ingress_rg_shared_alb/ing.yaml rename to testdata/ingress_rg_shared_alb/k8s/ing.yaml diff --git a/testdata/ingress_rg_shared_alb/rg.yaml b/testdata/ingress_rg_shared_alb/k8s/rg.yaml similarity index 100% rename from testdata/ingress_rg_shared_alb/rg.yaml rename to testdata/ingress_rg_shared_alb/k8s/rg.yaml diff --git a/testdata/ingress_rg_shared_alb/params.json b/testdata/ingress_rg_shared_alb/params.json new file mode 100644 index 00000000..c1ecf899 --- /dev/null +++ b/testdata/ingress_rg_shared_alb/params.json @@ -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" + } +] diff --git a/testdata/ingress_rg_shared_alb/tags.json b/testdata/ingress_rg_shared_alb/tags.json new file mode 100644 index 00000000..04f7153a --- /dev/null +++ b/testdata/ingress_rg_shared_alb/tags.json @@ -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" + } +] diff --git a/testdata/ingress_rg_shared_alb/expected.cf b/testdata/ingress_rg_shared_alb/template.cf similarity index 100% rename from testdata/ingress_rg_shared_alb/expected.cf rename to testdata/ingress_rg_shared_alb/template.cf diff --git a/testdata/ingress_rg_shared_nlb/ing.yaml b/testdata/ingress_rg_shared_nlb/k8s/ing.yaml similarity index 100% rename from testdata/ingress_rg_shared_nlb/ing.yaml rename to testdata/ingress_rg_shared_nlb/k8s/ing.yaml diff --git a/testdata/ingress_rg_shared_nlb/rg.yaml b/testdata/ingress_rg_shared_nlb/k8s/rg.yaml similarity index 100% rename from testdata/ingress_rg_shared_nlb/rg.yaml rename to testdata/ingress_rg_shared_nlb/k8s/rg.yaml diff --git a/testdata/ingress_rg_shared_nlb/params.json b/testdata/ingress_rg_shared_nlb/params.json new file mode 100644 index 00000000..adec04c7 --- /dev/null +++ b/testdata/ingress_rg_shared_nlb/params.json @@ -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": "network" + }, + { + "parameterKey": "HTTP2", + "parameterValue": "true" + }, + { + "parameterKey": "TargetGroupHealthCheckPathParameter", + "parameterValue": "" + }, + { + "parameterKey": "TargetGroupHealthCheckPortParameter", + "parameterValue": "0" + }, + { + "parameterKey": "TargetGroupHealthCheckIntervalParameter", + "parameterValue": "0" + }, + { + "parameterKey": "TargetGroupHealthCheckTimeoutParameter", + "parameterValue": "0" + } +] diff --git a/testdata/ingress_rg_shared_nlb/tags.json b/testdata/ingress_rg_shared_nlb/tags.json new file mode 100644 index 00000000..04f7153a --- /dev/null +++ b/testdata/ingress_rg_shared_nlb/tags.json @@ -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" + } +] diff --git a/testdata/ingress_rg_shared_nlb/expected.cf b/testdata/ingress_rg_shared_nlb/template.cf similarity index 100% rename from testdata/ingress_rg_shared_nlb/expected.cf rename to testdata/ingress_rg_shared_nlb/template.cf diff --git a/testdata/rg_alb/rg.yaml b/testdata/rg_alb/k8s/rg.yaml similarity index 100% rename from testdata/rg_alb/rg.yaml rename to testdata/rg_alb/k8s/rg.yaml diff --git a/testdata/rg_alb/params.json b/testdata/rg_alb/params.json new file mode 100644 index 00000000..c1ecf899 --- /dev/null +++ b/testdata/rg_alb/params.json @@ -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" + } +] diff --git a/testdata/rg_alb/tags.json b/testdata/rg_alb/tags.json new file mode 100644 index 00000000..d64eed43 --- /dev/null +++ b/testdata/rg_alb/tags.json @@ -0,0 +1,12 @@ +[ + { + "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" + } +] diff --git a/testdata/rg_alb/expected.cf b/testdata/rg_alb/template.cf similarity index 100% rename from testdata/rg_alb/expected.cf rename to testdata/rg_alb/template.cf diff --git a/testdata/rg_nlb/rg.yaml b/testdata/rg_nlb/k8s/rg.yaml similarity index 100% rename from testdata/rg_nlb/rg.yaml rename to testdata/rg_nlb/k8s/rg.yaml diff --git a/testdata/rg_nlb/params.json b/testdata/rg_nlb/params.json new file mode 100644 index 00000000..adec04c7 --- /dev/null +++ b/testdata/rg_nlb/params.json @@ -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": "network" + }, + { + "parameterKey": "HTTP2", + "parameterValue": "true" + }, + { + "parameterKey": "TargetGroupHealthCheckPathParameter", + "parameterValue": "" + }, + { + "parameterKey": "TargetGroupHealthCheckPortParameter", + "parameterValue": "0" + }, + { + "parameterKey": "TargetGroupHealthCheckIntervalParameter", + "parameterValue": "0" + }, + { + "parameterKey": "TargetGroupHealthCheckTimeoutParameter", + "parameterValue": "0" + } +] diff --git a/testdata/rg_nlb/tags.json b/testdata/rg_nlb/tags.json new file mode 100644 index 00000000..d64eed43 --- /dev/null +++ b/testdata/rg_nlb/tags.json @@ -0,0 +1,12 @@ +[ + { + "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" + } +] diff --git a/testdata/rg_nlb/expected.cf b/testdata/rg_nlb/template.cf similarity index 100% rename from testdata/rg_nlb/expected.cf rename to testdata/rg_nlb/template.cf diff --git a/worker_test.go b/worker_test.go index 2533d6d7..f3daa2e7 100644 --- a/worker_test.go +++ b/worker_test.go @@ -458,8 +458,6 @@ func TestResourceConversion(tt *testing.T) { t.Fatal(err) } - // numberOfFiles := len(files) - 1 , TODO: use to compare with metrics later. - for _, file := range files { f, err := os.Open("./testdata/" + scenario.name + "/k8s/" + file.Name()) if err != nil {