Skip to content

Commit

Permalink
Reduce string size (#60)
Browse files Browse the repository at this point in the history
Signed-off-by: roliszewski-equinix <126172374+roliszewski-equinix@users.noreply.github.com>
  • Loading branch information
roliszewski-equinix authored Jul 1, 2024
1 parent d11308a commit 3bbc069
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions chart/iam-runtime-infratographer/templates/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

{{- define "iam-runtime-infratographer.resource.fullname" }}
{{- $prefix := include "iam-runtime-infratographer.fullname" .context }}
{{- $reduce := sub (add (len $prefix) (len .suffix) 1) 63 }}
{{- if gt $reduce 0 }}
{{- $prefix = trunc (add 63 $reduce | int) $prefix | trimSuffix "-" }}
{{- end }}
{{- $totalLength := add (len $prefix) (len .suffix) 1 | int }}
{{- $trimLength := sub $totalLength 63 | int }}
{{- $prefix = trunc (sub (len $prefix) $trimLength | int) $prefix | trimSuffix "-" }}
{{- printf "%s-%s" $prefix .suffix -}}
{{- end }}

Expand Down

0 comments on commit 3bbc069

Please sign in to comment.