-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cluster version probe on installation time
- Loading branch information
1 parent
27fa93b
commit 297d596
Showing
9 changed files
with
69 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,11 @@ name: Lint and Test Charts | |
|
||
on: pull_request | ||
|
||
env: | ||
MINIKUBE_VERSION: v1.33.1 | ||
KUBERNETES_VERSION: v1.28.11 | ||
HELM_VERSION: v3.14.4 | ||
|
||
jobs: | ||
codespell: | ||
name: Check spelling | ||
|
@@ -32,7 +37,7 @@ jobs: | |
- uses: helm/[email protected] | ||
- uses: azure/setup-helm@v4 | ||
with: | ||
version: 'v3.0.0' | ||
version: ${{ env.HELM_VERSION }} | ||
|
||
- name: Set up helm-unittest | ||
run: helm plugin install https://github.com/helm-unittest/helm-unittest | ||
|
@@ -76,13 +81,13 @@ jobs: | |
- uses: helm/[email protected] | ||
- uses: azure/setup-helm@v4 | ||
with: | ||
version: 'v3.0.0' | ||
version: ${{ env.HELM_VERSION }} | ||
|
||
- name: Install Minikube | ||
uses: manusa/[email protected] | ||
with: | ||
minikube version: v1.33.1 | ||
kubernetes version: v1.28.11 | ||
minikube version: ${{ env.MINIKUBE_VERSION }} | ||
kubernetes version: ${{ env.KUBERNETES_VERSION }} | ||
github token: ${{ secrets.GITHUB_TOKEN }} | ||
driver: docker | ||
start args: "--container-runtime=containerd" | ||
|
@@ -109,7 +114,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: azure/setup-helm@v4 | ||
with: | ||
version: 'v3.0.0' | ||
version: ${{ env.HELM_VERSION }} | ||
|
||
- name: Add helm repositories | ||
run: | | ||
|
@@ -157,7 +162,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: azure/setup-helm@v4 | ||
with: | ||
version: 'v3.0.0' | ||
version: ${{ env.HELM_VERSION }} | ||
|
||
- name: Add helm repositories | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{- define "newrelic-super-agent.capabilites-tester" -}} | ||
{{- $minimum_supported_version := (.Values.experimental).forceMinimumSupportedVersion | default .Chart.KubeVersion -}} | ||
|
||
{{- $cluster_version := (.Values.experimental).forceKubeVersion | default .Capabilities.KubeVersion.Version | toString -}} | ||
|
||
{{- if not (semverCompare $minimum_supported_version $cluster_version) -}} | ||
{{- $error_message := printf "Kubernetes version is not supported. Cluster says its on version %s and does not meet %s" $cluster_version $minimum_supported_version -}} | ||
{{- fail $error_message -}} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{- include "newrelic-super-agent.capabilites-tester" . -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
suite: super agent is able to fail if it does not meet cluster version | ||
templates: | ||
- templates/capabilities-tester.yaml | ||
release: | ||
name: my-release | ||
namespace: my-namespace | ||
|
||
tests: | ||
- it: Cluster above the requirements | ||
set: | ||
experimental: | ||
forceMinimumSupportedVersion: ">=1.28.0-0" | ||
forceKubeVersion: v1.29 | ||
asserts: | ||
- notFailedTemplate: {} | ||
|
||
- it: Cluster below the requirements | ||
set: | ||
experimental: | ||
forceMinimumSupportedVersion: ">=1.28.0-0" | ||
forceKubeVersion: v1.27 | ||
asserts: | ||
- failedTemplate: {} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters