Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release.name #438

Merged
merged 2 commits into from
Nov 28, 2024
Merged
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
2 changes: 1 addition & 1 deletion charts/prom-aggregation-gateway/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: prom-aggregation-gateway
version: 0.0.1
version: 0.0.2
home: https://github.com/zapier/prom-aggregation-gateway
appVersion: latest
description: cLabs prometheus aggregation gateway
Expand Down
2 changes: 1 addition & 1 deletion charts/prom-aggregation-gateway/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# prom-aggregation-gateway

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

cLabs prometheus aggregation gateway

Expand Down
18 changes: 18 additions & 0 deletions charts/prom-aggregation-gateway/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "prom-aggregation-gateway.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{- define "prom-aggregation-gateway.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: {{ .Values.controller.type }}
metadata:
name: {{ .Release.Name }}
name: {{ include "prom-aggregation-gateway.fullname" . }}
labels:
{{- include "prom-aggregation-gateway.labels" . | nindent 4 }}
{{- if .Values.controller.labels }}
Expand Down
4 changes: 2 additions & 2 deletions charts/prom-aggregation-gateway/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}
name: {{ include "prom-aggregation-gateway.fullname" . }}
labels:
{{- include "prom-aggregation-gateway.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
Expand Down Expand Up @@ -33,7 +33,7 @@ spec:
{{- end }}
backend:
service:
name: {{ .Release.Name }}
name: {{ include "prom-aggregation-gateway.fullname" . }}
port:
number: api-port
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ .Release.Name }}-metrics
name: {{ include "prom-aggregation-gateway.fullname" . }}
{{- with .Values.podMonitor.additionalLabels }}
labels:
{{- toYaml . | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/prom-aggregation-gateway/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
name: {{ include "prom-aggregation-gateway.fullname" . }}
labels:
{{- include "prom-aggregation-gateway.selectorLabels" . | nindent 4 }}
{{- with .Values.service.annotations }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Release.Name }}
name: {{ include "prom-aggregation-gateway.fullname" . }}
{{- with .Values.serviceMonitor.additionalLabels }}
labels:
{{- toYaml . | nindent 4 }}
Expand Down