Skip to content

Commit

Permalink
Merge pull request #121 from mallardduck/fix-default-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mallardduck authored Nov 25, 2024
2 parents 9ba63cd + aec84bf commit a8cead8
Show file tree
Hide file tree
Showing 33 changed files with 1,386 additions and 123 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/e2e/scripts/cluster-args.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash
set -e
set -x

source $(dirname $0)/entry

cd $(dirname $0)/../../../..

case "${KUBERNETES_DISTRIBUTION_TYPE}" in
"k3s")
cluster_args=""
kubernetes_version=$(kubectl version | grep "Server Version" | cut -d ' ' -f3)
case "${kubernetes_version}" in
v1.23.*)
embedded_helm_controller_fixed_version="v1.23.14"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
v1.24.*)
embedded_helm_controller_fixed_version="v1.24.8"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
v1.25.*)
embedded_helm_controller_fixed_version="v1.25.4"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
esac
;;
"rke")
cluster_args=""
;;
"rke2")
cluster_args=""
kubernetes_version=$(kubectl version | grep "Server Version" | cut -d ' ' -f3)
case "${kubernetes_version}" in
v1.23.*)
embedded_helm_controller_fixed_version="v1.23.14"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
v1.24.*)
embedded_helm_controller_fixed_version="v1.24.8"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
v1.25.*)
embedded_helm_controller_fixed_version="v1.25.4"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
esac
;;
*)
echo "KUBERNETES_DISTRIBUTION_TYPE=${KUBERNETES_DISTRIBUTION_TYPE} is unknown"
exit 1
esac
60 changes: 2 additions & 58 deletions .github/workflows/e2e/scripts/hpo-install-helm-project-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,12 @@
set -e

source $(dirname $0)/entry
source $(dirname $0)/cluster-args.sh

cd $(dirname $0)/../../../..

latest_chart=./packages/helm-project-operator/charts

case "${KUBERNETES_DISTRIBUTION_TYPE}" in
"k3s")
cluster_args=""
kubernetes_version=$(kubectl version --short | grep "Server Version" | cut -d ' ' -f3)
case "${kubernetes_version}" in
v1.23.*)
embedded_helm_controller_fixed_version="v1.23.14"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmController.enabled=false"
fi
;;
v1.24.*)
embedded_helm_controller_fixed_version="v1.24.8"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmController.enabled=false"
fi
;;
*)
embedded_helm_controller_fixed_version="v1.25.4"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmController.enabled=false"
fi
;;
esac
;;
"rke")
cluster_args=""
;;
"rke2")
cluster_args=""
kubernetes_version=$(kubectl version --short | grep "Server Version" | cut -d ' ' -f3)
case "${kubernetes_version}" in
v1.23.*)
embedded_helm_controller_fixed_version="v1.23.14"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmController.enabled=false"
fi
;;
v1.24.*)
embedded_helm_controller_fixed_version="v1.24.8"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmController.enabled=false"
fi
;;
*)
embedded_helm_controller_fixed_version="v1.25.4"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmController.enabled=false"
fi
;;
esac
;;
*)
echo "KUBERNETES_DISTRIBUTION_TYPE=${KUBERNETES_DISTRIBUTION_TYPE} is unknown"
exit 1
esac

helm upgrade --install --create-namespace -n cattle-helm-system helm-project-operator --set image.repository=${REPO:-rancher}/helm-project-operator --set image.tag=${TAG:-dev} ${cluster_args} ${RANCHER_HELM_ARGS} ${latest_chart}
helm upgrade --install --create-namespace -n cattle-helm-system helm-project-operator --set image.registry='',image.repository=${REPO:-rancher}/helm-project-operator,image.tag=${TAG:-dev} ${cluster_args} ${RANCHER_HELM_ARGS} ${latest_chart}

echo "PASS: Helm Project Operator has been installed"
58 changes: 1 addition & 57 deletions .github/workflows/e2e/scripts/install-federator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,12 @@ set -e
set -x

source $(dirname $0)/entry
source $(dirname $0)/cluster-args.sh

cd $(dirname $0)/../../../..

latest_chart=$(find ./charts/prometheus-federator -type d -maxdepth 1 -mindepth 1 | tr - \~ | sort -rV | tr \~ - | head -n1)

case "${KUBERNETES_DISTRIBUTION_TYPE}" in
"k3s")
cluster_args=""
kubernetes_version=$(kubectl version --short | grep "Server Version" | cut -d ' ' -f3)
case "${kubernetes_version}" in
v1.23.*)
embedded_helm_controller_fixed_version="v1.23.14"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
v1.24.*)
embedded_helm_controller_fixed_version="v1.24.8"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
v1.25.*)
embedded_helm_controller_fixed_version="v1.25.4"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
esac
;;
"rke")
cluster_args=""
;;
"rke2")
cluster_args=""
kubernetes_version=$(kubectl version --short | grep "Server Version" | cut -d ' ' -f3)
case "${kubernetes_version}" in
v1.23.*)
embedded_helm_controller_fixed_version="v1.23.14"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
v1.24.*)
embedded_helm_controller_fixed_version="v1.24.8"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
v1.25.*)
embedded_helm_controller_fixed_version="v1.25.4"
if [[ $(echo ${kubernetes_version} ${embedded_helm_controller_fixed_version} | tr " " "\n" | sort -rV | head -n 1 ) == "${embedded_helm_controller_fixed_version}" ]]; then
cluster_args="--set helmProjectOperator.helmController.enabled=false"
fi
;;
esac
;;
*)
echo "KUBERNETES_DISTRIBUTION_TYPE=${KUBERNETES_DISTRIBUTION_TYPE} is unknown"
exit 1
esac

helm upgrade --install --create-namespace -n cattle-monitoring-system prometheus-federator --set helmProjectOperator.image.repository=${REPO:-rancher}/prometheus-federator --set helmProjectOperator.image.tag=${TAG:-dev} ${cluster_args} ${RANCHER_HELM_ARGS} ${latest_chart}

echo "PASS: Prometheus Federator has been installed"
Binary file not shown.
18 changes: 18 additions & 0 deletions charts/prometheus-federator/0.4.4/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
annotations:
catalog.cattle.io/certified: rancher
catalog.cattle.io/display-name: Prometheus Federator
catalog.cattle.io/namespace: cattle-monitoring-system
catalog.cattle.io/os: linux,windows
catalog.cattle.io/permits-os: linux,windows
catalog.cattle.io/provides-gvr: helm.cattle.io.projecthelmchart/v1alpha1
catalog.cattle.io/release-name: prometheus-federator
apiVersion: v2
appVersion: 0.4.3
dependencies:
- name: helmProjectOperator
repository: file://./charts/helmProjectOperator
version: 0.3.2
description: Prometheus Federator
icon: https://raw.githubusercontent.com/rancher/prometheus-federator/main/assets/logos/prometheus-federator.svg
name: prometheus-federator
version: 0.4.4
Loading

0 comments on commit a8cead8

Please sign in to comment.