Add url option to portal configmap (#315)

* Add url option to portal configmap

It makes it easier to consume the portal url in other places, without all sorts of translation scripting

* add portal-url test
This commit is contained in:
Kjeld Schouten-Lebbing 2021-04-10 15:07:21 +02:00 committed by GitHub
parent 64aa712dab
commit 8349a1c750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -323,6 +323,7 @@ class Test < ChartTest
defaultProtocol = "https"
defaultHost = "$node_ip"
defaultPort = "443"
defaulturl = "https://$node_ip:443"
testNodePort = "666"
testIngressPort = "888"
it 'No portal (=configmap) is created by default' do
@ -340,6 +341,7 @@ class Test < ChartTest
jq('.data.protocol', resource('ConfigMap')).must_equal defaultProtocol
jq('.data.host', resource('ConfigMap')).must_equal defaultHost
jq('.data.port', resource('ConfigMap')).must_equal defaultPort
jq('.data.url', resource('ConfigMap')).must_equal defaulturl
end
it 'portal port can be based on NodePort' do

View File

@ -1,7 +1,7 @@
apiVersion: v2
kubeVersion: ">=1.16.0-0"
name: common
version: 2.0.2
version: 2.0.3
# upstream_version:
appVersion: none
description: Function library for TrueCharts

View File

@ -57,6 +57,7 @@ data:
protocol: {{ $protocol }}
host: {{ $host }}
port: {{ $port | quote }}
url: {{ printf "%v%v%v%v%v" $protocol "://" $host ":" $port }}
{{- end }}
{{- end }}