Commit 889667e4 authored by Joao Cunha's avatar Joao Cunha
Browse files

fix: Trim whitespaces from hosts

- tests that multiple additional host with comma and space separation
are parsed correctly.
parent d01f68d5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ test-deploy:
    CI_APPLICATION_TAG: "5d248f6fa69a"
    CI_ENVIRONMENT_SLUG: production
    CI_ENVIRONMENT_URL: example.com
    ADDITIONAL_HOSTS: '*.example.com'
    ADDITIONAL_HOSTS: '*.example.com, extra.host.com'
    CI_PROJECT_PATH_SLUG: "gitlab-org/cluster-integration/auto-build-image"
    CI_PROJECT_VISIBILITY: public
    KUBE_NAMESPACE: default
+1 −1
Original line number Diff line number Diff line
apiVersion: v1
description: GitLab's Auto-deploy Helm Chart
name: auto-deploy-app
version: 1.0.2
version: 1.0.3
icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
Get a hostname from URL
*/}}
{{- define "hostname" -}}
{{- . | trimPrefix "http://" |  trimPrefix "https://" | trimSuffix "/" | quote -}}
{{- . | trimPrefix "http://" |  trimPrefix "https://" | trimSuffix "/" | trim | quote -}}
{{- end -}}

{{/*
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ import (
)

const (
	chartName     = "auto-deploy-app-1.0.2"
	chartName     = "auto-deploy-app-1.0.3"
	helmChartPath = ".."
)

+3 −3
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ describe Gitlab::Chart do
        apiVersion: v1
        description: GitLab's Auto-deploy Helm Chart
        name: auto-deploy-app
        version: 1.0.2
        version: 1.0.3
        icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png
      EOS
    end
@@ -120,7 +120,7 @@ describe Gitlab::Chart do

        expect(chart.major).to eq(1)
        expect(chart.minor).to eq(0)
        expect(chart.patch).to eq(2)
        expect(chart.patch).to eq(3)
      end
    end

@@ -130,7 +130,7 @@ describe Gitlab::Chart do
          apiVersion: v1
          description: GitLab's Auto-deploy Helm Chart
          name: custom-chart
          version: 1.0.2
          version: 1.0.3
          icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png
        EOS
      end