From e1bcdc003b20fb393cd259236c13fa46f16422e7 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Fri, 7 Nov 2025 19:59:15 +0300 Subject: [PATCH] test(deployment): add revisionHistoryLimit tests and deployment notes Add helm-unittest tests for revisionHistoryLimit: - Default value (3) verification - Custom values support (0, 1, 5, 100) - Ability to disable revision history Add NOTES.txt with revisionHistoryLimit information: - Show configured revision history limit - Warning when disabled (0) - Note for minimal history (1) - Rollback command example for normal values This parameter controls how many old ReplicaSets are retained for rollback purposes, reducing etcd storage usage. Co-Authored-By: Claude Signed-off-by: Aleksei Sviridkin --- charts/jellyfin/templates/NOTES.txt | 35 ++++++++++++++++ .../jellyfin/tests/revision_history_test.yaml | 41 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 charts/jellyfin/templates/NOTES.txt create mode 100644 charts/jellyfin/tests/revision_history_test.yaml diff --git a/charts/jellyfin/templates/NOTES.txt b/charts/jellyfin/templates/NOTES.txt new file mode 100644 index 0000000..83dd7c5 --- /dev/null +++ b/charts/jellyfin/templates/NOTES.txt @@ -0,0 +1,35 @@ +Thank you for installing {{ .Chart.Name }}. + +Your release is named {{ .Release.Name }}. + +To learn more about the release, try: + + $ helm status {{ .Release.Name }} + $ helm get all {{ .Release.Name }} + +{{- if .Values.ingress.enabled }} + +Jellyfin is available via Ingress at: +{{- range .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .host }}{{ (index .paths 0).path }} +{{- end }} +{{- else }} + +To access Jellyfin, you can use port-forwarding: + + $ kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "jellyfin.fullname" . }} {{ .Values.service.port }}:{{ .Values.service.port }} + +Then visit http://localhost:{{ .Values.service.port }} in your browser. +{{- end }} + +Deployment Configuration: + Revision History Limit: {{ .Values.revisionHistoryLimit }} + {{- $limit := int .Values.revisionHistoryLimit }} + {{- if eq $limit 0 }} + ⚠ WARNING: Revision history is disabled - rollback will not be possible! + {{- else if eq $limit 1 }} + ⚠ NOTE: Only 1 revision kept - limited rollback capability + {{- else }} + You can rollback to any of the last {{ .Values.revisionHistoryLimit }} revisions using: + kubectl rollout undo deployment/{{ include "jellyfin.fullname" . }} --namespace {{ .Release.Namespace }} + {{- end }} diff --git a/charts/jellyfin/tests/revision_history_test.yaml b/charts/jellyfin/tests/revision_history_test.yaml new file mode 100644 index 0000000..0a2b903 --- /dev/null +++ b/charts/jellyfin/tests/revision_history_test.yaml @@ -0,0 +1,41 @@ +suite: test revision history limit +templates: + - deployment.yaml +tests: + - it: should set revisionHistoryLimit to 3 by default + asserts: + - equal: + path: spec.revisionHistoryLimit + value: 3 + + - it: should allow custom revisionHistoryLimit + set: + revisionHistoryLimit: 5 + asserts: + - equal: + path: spec.revisionHistoryLimit + value: 5 + + - it: should allow revisionHistoryLimit of 0 + set: + revisionHistoryLimit: 0 + asserts: + - equal: + path: spec.revisionHistoryLimit + value: 0 + + - it: should allow revisionHistoryLimit of 1 + set: + revisionHistoryLimit: 1 + asserts: + - equal: + path: spec.revisionHistoryLimit + value: 1 + + - it: should allow large revisionHistoryLimit + set: + revisionHistoryLimit: 100 + asserts: + - equal: + path: spec.revisionHistoryLimit + value: 100