Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions charts/osm-arc/templates/check-distro.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#
# The job in this YAML file verifies if the current k8s distribution has been tested for osm-arc.
# The job is executed in helm pre-install phase of OSM release lifecycle.
#
apiVersion: v1
kind: ServiceAccount
metadata:
name: check-distro-account
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook-weight": "10"
"helm.sh/hook": pre-install
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
---
apiVersion: batch/v1
kind: Job
metadata:
name: check-distro
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook-weight": "15"
"helm.sh/hook": pre-install
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeededd
spec:
template:
metadata:
labels:
app: check-distro
spec:
serviceAccountName: check-distro-account
automountServiceAccountToken: true
restartPolicy: Never
terminationGracePeriodSeconds: 0
containers:
- name: check-distro
image: {{ .Values.alpine.image.name }}:{{ .Values.alpine.image.tag }}
imagePullPolicy: IfNotPresent
env:
- name: testedDistros
value: {{ .Values.OpenServiceMesh.testedDistros }}
- name: currentDistro
value: {{ .Values.Azure.Cluster.Distribution }}
command:
- "/bin/sh"
- "-ec"
- |
set -o pipefail
token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
testedDistrosList=${testedDistros}
current=${currentDistro}
tested=false
for distro in ${testedDistrosList}
do
if [[ "${distro}" == "${current}" ]]; then
echo "${current} is a tested distribution for osm-arc"
tested=true
fi
done
if [[ "$tested" = "false" ]]; then
echo "Warning: ${current} is not a tested distribution for osm-arc"
exit 0
fi
3 changes: 2 additions & 1 deletion charts/osm-arc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Azure:
Distribution: <cluster_distribution>

OpenServiceMesh:
ignoreNamespaces: "kube-system azure-arc arc-osm-system"
ignoreNamespaces: "kube-system azure-arc arc-osm-system"
testedDistros: "aks gke eks rancher_rke openshift"

osm:
OpenServiceMesh:
Expand Down