mirror of
https://github.com/outbackdingo/qdrant-helm.git
synced 2026-01-27 10:20:18 +00:00
Allow annotations on volumeClaimTemplate of qdrant statefulset (#63)
Fixes https://github.com/qdrant/qdrant-helm/issues/45 Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
This commit is contained in:
@@ -149,6 +149,10 @@ spec:
|
||||
name: qdrant-storage
|
||||
labels:
|
||||
app: {{ template "qdrant.name" . }}
|
||||
{{- with .Values.persistence.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
storageClassName: {{ .Values.persistence.storageClassName }}
|
||||
accessModes:
|
||||
|
||||
@@ -94,6 +94,7 @@ affinity: {}
|
||||
persistence:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
size: 10Gi
|
||||
annotations: {}
|
||||
# storageClassName: local-path
|
||||
|
||||
# only supported for single node qdrant clusters.
|
||||
|
||||
40
test/qdrant_annotations_test.go
Normal file
40
test/qdrant_annotations_test.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/gruntwork-io/terratest/modules/helm"
|
||||
"github.com/gruntwork-io/terratest/modules/k8s"
|
||||
"github.com/gruntwork-io/terratest/modules/logger"
|
||||
"github.com/gruntwork-io/terratest/modules/random"
|
||||
"github.com/stretchr/testify/require"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
)
|
||||
|
||||
func TestPvcAnnotations(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
helmChartPath, err := filepath.Abs("../charts/qdrant")
|
||||
releaseName := "qdrant"
|
||||
require.NoError(t, err)
|
||||
|
||||
namespaceName := "qdrant-" + strings.ToLower(random.UniqueId())
|
||||
logger.Log(t, "Namespace: %s\n", namespaceName)
|
||||
|
||||
options := &helm.Options{
|
||||
SetJsonValues: map[string]string{
|
||||
"persistence.annotations": `{"test": "value"}`,
|
||||
},
|
||||
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
|
||||
}
|
||||
|
||||
output := helm.RenderTemplate(t, options, helmChartPath, releaseName, []string{"templates/statefulset.yaml"})
|
||||
|
||||
var statefulSet appsv1.StatefulSet
|
||||
helm.UnmarshalK8SYaml(t, output, &statefulSet)
|
||||
|
||||
require.Contains(t, statefulSet.Spec.VolumeClaimTemplates[0].ObjectMeta.Annotations, "test")
|
||||
require.Equal(t, statefulSet.Spec.VolumeClaimTemplates[0].ObjectMeta.Annotations["test"], "value")
|
||||
}
|
||||
Reference in New Issue
Block a user