Skip to content

Commit

Permalink
Merge pull request #438 from celo-org/fix-pag-chart
Browse files Browse the repository at this point in the history
Fix release.name
  • Loading branch information
alvarof2 authored Nov 28, 2024
2 parents 69fa5ab + 77c8234 commit 37e51b4
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 8 deletions.
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
2 changes: 1 addition & 1 deletion charts/prom-aggregation-gateway/templates/controller.yaml
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
2 changes: 1 addition & 1 deletion charts/prom-aggregation-gateway/templates/podmonitor.yaml
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

0 comments on commit 37e51b4

Please sign in to comment.