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:
@@ -323,6 +323,7 @@ class Test < ChartTest
|
|||||||
defaultProtocol = "https"
|
defaultProtocol = "https"
|
||||||
defaultHost = "$node_ip"
|
defaultHost = "$node_ip"
|
||||||
defaultPort = "443"
|
defaultPort = "443"
|
||||||
|
defaulturl = "https://$node_ip:443"
|
||||||
testNodePort = "666"
|
testNodePort = "666"
|
||||||
testIngressPort = "888"
|
testIngressPort = "888"
|
||||||
it 'No portal (=configmap) is created by default' do
|
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.protocol', resource('ConfigMap')).must_equal defaultProtocol
|
||||||
jq('.data.host', resource('ConfigMap')).must_equal defaultHost
|
jq('.data.host', resource('ConfigMap')).must_equal defaultHost
|
||||||
jq('.data.port', resource('ConfigMap')).must_equal defaultPort
|
jq('.data.port', resource('ConfigMap')).must_equal defaultPort
|
||||||
|
jq('.data.url', resource('ConfigMap')).must_equal defaulturl
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'portal port can be based on NodePort' do
|
it 'portal port can be based on NodePort' do
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
name: common
|
name: common
|
||||||
version: 2.0.2
|
version: 2.0.3
|
||||||
# upstream_version:
|
# upstream_version:
|
||||||
appVersion: none
|
appVersion: none
|
||||||
description: Function library for TrueCharts
|
description: Function library for TrueCharts
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ data:
|
|||||||
protocol: {{ $protocol }}
|
protocol: {{ $protocol }}
|
||||||
host: {{ $host }}
|
host: {{ $host }}
|
||||||
port: {{ $port | quote }}
|
port: {{ $port | quote }}
|
||||||
|
url: {{ printf "%v%v%v%v%v" $protocol "://" $host ":" $port }}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
Reference in New Issue
Block a user