mirror of https://github.com/status-im/consul.git
ui: Ensure value is always passed to CONSUL_SSO_ENABLED (#7913)
ACLsEnabled is always set to either true or false. .SSOEnabled is only set if you are running enterprise (the same as .NamespacesEnabled). Therefore .SSOEnabled and .NamespacesEnabled require conditionals to check their existence. In order to avoid future confusion we moved all go-template variables to use the conditional form, and added a comment to that effect. Tests have been added to reflect this, but they only test that the template outputs what we expect, true e2e testing here would be advantageous.
This commit is contained in:
parent
228284758b
commit
5d5bb6cca6
|
@ -127,9 +127,11 @@ module.exports = function(environment, $ = process.env) {
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case environment === 'production':
|
case environment === 'production':
|
||||||
|
// Make sure all templated variables check for existence first
|
||||||
|
// before outputting them, this means they all should be conditionals
|
||||||
ENV = Object.assign({}, ENV, {
|
ENV = Object.assign({}, ENV, {
|
||||||
CONSUL_ACLS_ENABLED: '{{.ACLsEnabled}}',
|
CONSUL_ACLS_ENABLED: '{{ if .ACLsEnabled }}{{.ACLsEnabled}}{{ else }}false{{ end }}',
|
||||||
CONSUL_SSO_ENABLED: '{{.SSOEnabled}}',
|
CONSUL_SSO_ENABLED: '{{ if .SSOEnabled }}{{.SSOEnabled}}{{ else }}false{{ end }}',
|
||||||
CONSUL_NSPACES_ENABLED:
|
CONSUL_NSPACES_ENABLED:
|
||||||
'{{ if .NamespacesEnabled }}{{.NamespacesEnabled}}{{ else }}false{{ end }}',
|
'{{ if .NamespacesEnabled }}{{.NamespacesEnabled}}{{ else }}false{{ end }}',
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,8 +9,8 @@ test(
|
||||||
{
|
{
|
||||||
environment: 'production',
|
environment: 'production',
|
||||||
CONSUL_BINARY_TYPE: 'oss',
|
CONSUL_BINARY_TYPE: 'oss',
|
||||||
CONSUL_ACLS_ENABLED: '{{.ACLsEnabled}}',
|
CONSUL_ACLS_ENABLED: '{{ if .ACLsEnabled }}{{.ACLsEnabled}}{{ else }}false{{ end }}',
|
||||||
CONSUL_SSO_ENABLED: '{{.SSOEnabled}}',
|
CONSUL_SSO_ENABLED: '{{ if .SSOEnabled }}{{.SSOEnabled}}{{ else }}false{{ end }}',
|
||||||
CONSUL_NSPACES_ENABLED: '{{ if .NamespacesEnabled }}{{.NamespacesEnabled}}{{ else }}false{{ end }}',
|
CONSUL_NSPACES_ENABLED: '{{ if .NamespacesEnabled }}{{.NamespacesEnabled}}{{ else }}false{{ end }}',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue