From 5488bbc1653be44d92563845f6eac216665f2986 Mon Sep 17 00:00:00 2001 From: d3adb5 Date: Sun, 7 Jan 2024 14:20:58 -0800 Subject: [PATCH] feat: warn the user of the deprecation of load-balancer-ip Warn the chart's user of the deprecation of the Service loadBalacerIP field since Kubernetes v1.24. --- application/templates/NOTES.txt | 8 ++++++++ application/tests/notes_test.yaml | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 application/templates/NOTES.txt create mode 100644 application/tests/notes_test.yaml diff --git a/application/templates/NOTES.txt b/application/templates/NOTES.txt new file mode 100644 index 00000000..e0c46719 --- /dev/null +++ b/application/templates/NOTES.txt @@ -0,0 +1,8 @@ +{{- if .Values.service.loadBalancerIP }} +service.loadBalancerIP: + You have defined the value of service.loadBalancerIP for this release. Please + be mindful that this field has been deprecated as of Kubernetes v1.24 and may + be removed from the API in a later release. + + Please refer to the Kubernetes documentation for more information. +{{- end }} diff --git a/application/tests/notes_test.yaml b/application/tests/notes_test.yaml new file mode 100644 index 00000000..c80e08e8 --- /dev/null +++ b/application/tests/notes_test.yaml @@ -0,0 +1,19 @@ +suite: NOTES.txt + +templates: + - NOTES.txt + +tests: + - it: warns the user of the deprecation of loadBalancerIP + set: + service.loadBalancerIP: 1.1.1.1 + asserts: + - matchRegexRaw: + pattern: 'service.loadBalancerIP:' + + - it: does not emit a warning for loadBalancerIP when not set + set: + service.loadBalancerIP: null + asserts: + - notMatchRegexRaw: + pattern: 'service.loadBalancerIP:'