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 long validator name for polygonzkevmtestnet #2832

Merged
merged 2 commits into from
Oct 23, 2023
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
9 changes: 9 additions & 0 deletions rust/helm/hyperlane-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{/*
We truncate at 63 chars - (11 + (len $suffix)) because the controller-revision-hash label adds an 11 character suffix
to the pod name, and we want the -validator suffix to still be present, but are happy to truncate the preceding name.
See https://github.com/kubernetes/kubernetes/issues/64023 for controller-revision-hash details.
*/}}
{{- define "validator.fullname" -}}
{{- $suffix := "-validator" }}
{{- include "agent-common.fullname" . | trunc (int (sub 63 (add 11 (len $suffix)))) | trimSuffix "-" }}{{ print $suffix }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "agent-common.fullname" . }}-validator
name: {{ include "validator.fullname" . }}
labels:
{{- include "agent-common.labels" . | nindent 4 }}
data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: {{ include "agent-common.fullname" . }}-validator-external-secret
name: {{ include "validator.fullname" . }}-external-secret
labels:
{{- include "agent-common.labels" . | nindent 4 }}
annotations:
Expand All @@ -14,7 +14,7 @@ spec:
refreshInterval: "1h"
# The secret that will be created
target:
name: {{ include "agent-common.fullname" . }}-validator-secret
name: {{ include "validator.fullname" . }}-secret
template:
type: Opaque
metadata:
Expand Down
10 changes: 5 additions & 5 deletions rust/helm/hyperlane-agent/templates/validator-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "agent-common.fullname" . }}-validator
name: {{ include "validator.fullname" . }}
labels:
{{- include "agent-common.labels" . | nindent 4 }}
app.kubernetes.io/component: validator
Expand All @@ -12,7 +12,7 @@ spec:
{{- include "agent-common.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: validator
replicas: {{ len .Values.hyperlane.validator.configs }}
serviceName: {{ include "agent-common.fullname" . }}-validator
serviceName: {{ include "validator.fullname" . }}
template:
metadata:
annotations:
Expand Down Expand Up @@ -58,7 +58,7 @@ spec:
- secretRef:
name: {{ include "agent-common.fullname" . }}-secret
- secretRef:
name: {{ include "agent-common.fullname" . }}-validator-secret
name: {{ include "validator.fullname" . }}-secret
env:
- name: REPLICA_NAME
valueFrom:
Expand All @@ -79,10 +79,10 @@ spec:
volumes:
- name: config-env-vars
configMap:
name: {{ include "agent-common.fullname" . }}-validator
name: {{ include "validator.fullname" . }}
- name: secret-env-vars
secret:
secretName: {{ include "agent-common.fullname" . }}-validator-secret
secretName: {{ include "validator.fullname" . }}-secret
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
Loading