Skip to content

Commit 4de4040

Browse files
Barkha Choithanibarkhachoithani
authored andcommitted
added support for security realm
1 parent 729043f commit 4de4040

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Following table lists all the parameters supported by the latest MarkLogic Helm
9696
| `auth.adminUsername` | Username for default MarkLogic Administrator | `admin` |
9797
| `auth.adminPassword` | Password for default MarkLogic Administrator | ``
9898
| `auth.walletPassword` | Password for wallet | ``
99+
| `auth.realm` | Realm of the security database | ``
99100
| `auth.secretName` | Kubernetes Secret name for MarkLogic Admin credentials | ``
100101
| `bootstrapHostName` | Host name of MarkLogic bootstrap host | `""`
101102
| `group.name` | group name for joining MarkLogic cluster | `Default` |

charts/templates/statefulset.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ spec:
119119
value: {{ .Values.license.key | quote }}
120120
- name: LICENSEE
121121
value: {{ .Values.license.licensee | quote }}
122+
- name: REALM
123+
value: {{ .Values.auth.realm | quote }}
122124
envFrom:
123125
- configMapRef:
124126
name: {{ include "marklogic.fullname" . }}

charts/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ auth:
6868
# adminUsername: "admin"
6969
# adminPassword: ""
7070
# walletPassword: ""
71+
realm: ""
7172

7273
# Optionally install converters package on MarkLogic
7374
enableConverters: false

test/template/env_param_templ_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,41 @@ func TestChartTemplateLicenseValues(t *testing.T) {
132132
require.Equal(t, actualLicenseKey, expectedLicenseKey)
133133
require.Equal(t, actualLicensee, expectedLicensee)
134134
}
135+
136+
func TestChartTemplateAuthRealmValue(t *testing.T) {
137+
138+
// Path to the helm chart we will test
139+
helmChartPath, err := filepath.Abs("../../charts")
140+
releaseName := "marklogic-container-env-test"
141+
t.Log(helmChartPath, releaseName)
142+
require.NoError(t, err)
143+
144+
// Set up the namespace; confirm that the template renders the expected value for the namespace.
145+
namespaceName := "marklogic-" + strings.ToLower(random.UniqueId())
146+
t.Logf("Namespace: %s\n", namespaceName)
147+
148+
// Setup the args for helm install
149+
options := &helm.Options{
150+
SetValues: map[string]string{
151+
"image.repository": "marklogicdb/marklogic-db",
152+
"image.tag": "latest",
153+
"persistence.enabled": "false",
154+
"auth.realm": "public",
155+
},
156+
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
157+
}
158+
159+
// render the tempate
160+
output := helm.RenderTemplate(t, options, helmChartPath, releaseName, []string{"templates/statefulset.yaml"})
161+
162+
var statefulset appsv1.StatefulSet
163+
helm.UnmarshalK8SYaml(t, output, &statefulset)
164+
165+
// Verify the name and namespace matches
166+
require.Equal(t, namespaceName, statefulset.Namespace)
167+
168+
// Verify the value of security realm
169+
expectedRealm := "public"
170+
actualRealm := statefulset.Spec.Template.Spec.Containers[0].Env[6].Value
171+
require.Equal(t, actualRealm, expectedRealm)
172+
}

0 commit comments

Comments
 (0)