charts/karmada: remove duplicate app label config in scheduler-estimator

Signed-off-by: Xinzhao Xu <z2d@jifangcheng.com>
This commit is contained in:
Xinzhao Xu 2024-08-13 17:21:46 +08:00
parent 235ec911b1
commit 405c08eb55
2 changed files with 34 additions and 9 deletions

View File

@ -3,6 +3,7 @@ name: Chart Lint
env: env:
HELM_VERSION: v3.11.2 HELM_VERSION: v3.11.2
KUSTOMIZE_VERSION: 5.4.3
KIND_VERSION: v0.22.0 KIND_VERSION: v0.22.0
KIND_NODE_IMAGE: kindest/node:v1.29.0 KIND_NODE_IMAGE: kindest/node:v1.29.0
K8S_VERSION: v1.29.0 K8S_VERSION: v1.29.0
@ -39,13 +40,37 @@ jobs:
with: with:
version: ${{ env.HELM_VERSION }} version: ${{ env.HELM_VERSION }}
- name: Set up Kustomize
uses: syntaqx/setup-kustomize@v1
with:
kustomize-version: ${{ env.KUSTOMIZE_VERSION }}
- name: Run chart-testing (template) - name: Run chart-testing (template)
run: | run: |
helm template --set components={"search,descheduler,schedulerEstimator"} --dependency-update ./charts/karmada --debug > /dev/null cat <<EOF > post-render.sh
helm template --set components={"search,descheduler,schedulerEstimator"},certs.mode=custom --dependency-update ./charts/karmada --debug > /dev/null #!/bin/sh
helm template --set components={"search,descheduler,schedulerEstimator"},installMode=component --dependency-update ./charts/karmada --debug > /dev/null # save helm stdout to file, kustomize will read this
helm template --set installMode=agent --dependency-update ./charts/karmada --debug > /dev/null cat > all.yaml
helm template --dependency-update ./charts/karmada-operator --debug > /dev/null kustomize build
EOF
chmod +x post-render.sh
cat <<EOF > kustomization.yaml
resources:
- all.yaml
EOF
helm template --set components={"search,descheduler,schedulerEstimator"} --dependency-update ./charts/karmada \
--post-renderer ./post-render.sh --debug > /dev/null
helm template --set components={"search,descheduler,schedulerEstimator"},certs.mode=custom --dependency-update \
./charts/karmada --post-renderer ./post-render.sh --debug > /dev/null
helm template --set components={"search,descheduler,schedulerEstimator"},installMode=component --dependency-update \
./charts/karmada --post-renderer ./post-render.sh --debug > /dev/null
helm template --set installMode=agent --dependency-update ./charts/karmada --post-renderer ./post-render.sh --debug > /dev/null
helm template --dependency-update ./charts/karmada-operator --post-renderer ./post-render.sh --debug > /dev/null
rm post-render.sh all.yaml kustomization.yaml
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python # yamllint (https://github.com/adrienverge/yamllint) which require Python

View File

@ -17,7 +17,7 @@ spec:
replicas: {{ $member.replicaCount }} replicas: {{ $member.replicaCount }}
selector: selector:
matchLabels: matchLabels:
app: karmada-scheduler-estimator-{{ $clusterName }} cluster: {{ $clusterName }}
{{- include "karmada.schedulerEstimator.labels" $ | nindent 6 }} {{- include "karmada.schedulerEstimator.labels" $ | nindent 6 }}
{{- with $.Values.schedulerEstimator.strategy }} {{- with $.Values.schedulerEstimator.strategy }}
strategy: strategy:
@ -30,7 +30,7 @@ spec:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
labels: labels:
app: karmada-scheduler-estimator-{{ $clusterName }} cluster: {{ $clusterName }}
{{- include "karmada.schedulerEstimator.labels" $ | nindent 8 }} {{- include "karmada.schedulerEstimator.labels" $ | nindent 8 }}
{{- include "karmada.schedulerEstimator.podLabels" $ | nindent 8 }} {{- include "karmada.schedulerEstimator.podLabels" $ | nindent 8 }}
spec: spec:
@ -91,7 +91,7 @@ metadata:
cluster: {{ $clusterName }} cluster: {{ $clusterName }}
spec: spec:
selector: selector:
app: karmada-scheduler-estimator-{{ $clusterName }} cluster: {{ $clusterName }}
{{- include "karmada.schedulerEstimator.labels" $ | nindent 4 }} {{- include "karmada.schedulerEstimator.labels" $ | nindent 4 }}
ports: ports:
- protocol: TCP - protocol: TCP
@ -138,7 +138,7 @@ metadata:
spec: spec:
selector: selector:
matchLabels: matchLabels:
app: karmada-scheduler-estimator-{{ $clusterName }} cluster: {{ $clusterName }}
{{- include "karmada.schedulerEstimator.labels" $ | nindent 6 }} {{- include "karmada.schedulerEstimator.labels" $ | nindent 6 }}
{{ toYaml $.Values.schedulerEstimator.podDisruptionBudget | nindent 2 }} {{ toYaml $.Values.schedulerEstimator.podDisruptionBudget | nindent 2 }}
{{- end -}} {{- end -}}