Skip to content

Commit

Permalink
fix: ensure patch jobs have different selector labels (#123)
Browse files Browse the repository at this point in the history
* fix: ensure patch jobs have different selector labels

Ensure the patch jobs have different labels/label values than the
deployment so HPA does not consider the patch jobs in its
calculations creating errors.

Thanks to @jurgenweber

fixes estahn/k8s-image-swapper#124

* chore: update readme and bump version
  • Loading branch information
estahn committed Jan 30, 2023
1 parent 231b9a3 commit 0c31ec0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions charts/k8s-image-swapper/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: k8s-image-swapper
description: Mirror images into your own registry and swap image references automatically.
type: application
version: 1.4.0
version: 1.5.0
appVersion: 1.3.0
home: https://github.com/estahn/charts/tree/main/charts/k8s-image-swapper
keywords:
Expand All @@ -15,7 +15,7 @@ maintainers:
name: estahn
annotations:
artifacthub.io/changes: |
- "add PDB feature to k8s-image-swapper"
- "Ensure the patch jobs have different labels/label values than the deployment so HPA does not consider the patch jobs in its calculations creating errors."
artifacthub.io/images: |
- name: k8s-image-webhook
image: ghcr.io/estahn/k8s-image-swapper:1.3.0
2 changes: 1 addition & 1 deletion charts/k8s-image-swapper/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# k8s-image-swapper

![Version: 1.4.0](https://img.shields.io/badge/Version-1.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.3.0](https://img.shields.io/badge/AppVersion-1.3.0-informational?style=flat-square)
![Version: 1.5.0](https://img.shields.io/badge/Version-1.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.3.0](https://img.shields.io/badge/AppVersion-1.3.0-informational?style=flat-square)

Mirror images into your own registry and swap image references automatically.

Expand Down
5 changes: 5 additions & 0 deletions charts/k8s-image-swapper/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ Selector labels
{{- define "k8s-image-swapper.selectorLabels" -}}
app.kubernetes.io/name: {{ include "k8s-image-swapper.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if contains "/job-patch/" .Template.Name }}
app.kubernetes.io/component: job-patch
{{- else }}
app.kubernetes.io/component: app
{{- end }}
{{- end }}

{{/*
Expand Down
1 change: 0 additions & 1 deletion charts/k8s-image-swapper/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
# Includes selectorLabels
{{- include "k8s-image-swapper.labels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
Expand Down

0 comments on commit 0c31ec0

Please sign in to comment.