Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
feat: add fallback value for janus-idp.hostname for openshift clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaperex committed Jan 9, 2024
1 parent a20e258 commit a7fa12f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/backstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.11.4
version: 2.12.0
2 changes: 1 addition & 1 deletion charts/backstage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Janus-IDP Backstage Helm Chart

[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/janus-idp&style=flat-square)](https://artifacthub.io/packages/search?repo=janus-idp)
![Version: 2.11.4](https://img.shields.io/badge/Version-2.11.4-informational?style=flat-square)
![Version: 2.12.0](https://img.shields.io/badge/Version-2.12.0-informational?style=flat-square)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A Helm chart for deploying a Backstage application
Expand Down
10 changes: 9 additions & 1 deletion charts/backstage/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ Returns custom hostname
{{- else if .Values.global.clusterRouterBase -}}
{{- printf "%s-%s.%s" (include "common.names.fullname" .) .Release.Namespace .Values.global.clusterRouterBase -}}
{{- else -}}
{{ fail "Unable to generate hostname" }}
{{/*
Attempt to obtain a fallback value for the hostname from the openshift cluster if both global.host and global.clusterRouterBase are ""
*/}}
{{- $cluster := (lookup "config.openshift.io/v1" "Ingress" "" "cluster") -}}
{{- if and (hasKey $cluster "spec") (hasKey $cluster.spec "domain") }}
{{- printf "%s-%s.%s" (include "common.names.fullname" .) .Release.Namespace $cluster.spec.domain -}}
{{- else -}}
{{ fail "Unable to generate hostname" }}
{{- end }}
{{- end -}}
{{- end -}}

Expand Down

0 comments on commit a7fa12f

Please sign in to comment.