Commit 7211481c authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason
Browse files

fix: unset default service.nodePort value

parent 0b17f471
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
apiVersion: v1
description: GitLab's Auto-deploy Helm Chart
name: auto-deploy-app
version: 2.22.0
version: 2.22.1
icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png
+11 −5
Original line number Diff line number Diff line
@@ -30,10 +30,16 @@ func TestServiceTemplate_ServiceType(t *testing.T) {

		},
		{
			name:         "with NodePort",
			name:         "with type NodePort but no nodePort value",
			values: map[string]string{ "service.type": "NodePort" },
			expectedType: "NodePort",
			expectedPort: coreV1.ServicePort{Port: 5000, TargetPort: intstr.FromInt(5000), NodePort: 30001, Protocol: "TCP", Name: "web"},
			expectedPort: coreV1.ServicePort{Port: 5000, TargetPort: intstr.FromInt(5000), NodePort: 0, Protocol: "TCP", Name: "web"},
		},
		{
			name:         "with type NodePort and nodePort set",
			values: map[string]string{ "service.type": "NodePort", "service.nodePort": "12345" },
			expectedType: "NodePort",
			expectedPort: coreV1.ServicePort{Port: 5000, TargetPort: intstr.FromInt(5000), NodePort: 12345, Protocol: "TCP", Name: "web"},
		},
	}

@@ -159,14 +165,14 @@ func TestServiceExtraPortsServiceDefinition(t *testing.T) {
			name:                "with extra service port",
			valueFiles:  []string{"../testdata/service-definition.yaml"},
			expectedPorts: []coreV1.ServicePort{
				coreV1.ServicePort {
				{
					Name: "web",
					Protocol: "TCP",
					Port: 5000,
					TargetPort: intstr.FromInt(5000),
					NodePort: 0,
				},
				coreV1.ServicePort {
				{
					Name: "port-443",
					Protocol: "TCP",
					Port: 443,
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ service:
  commonName:
  externalPort: 5000
  internalPort: 5000
  nodePort: 30001
  # nodePort: 30001
  extraPorts: []
ingress:
  enabled: true