Skip to content

Commit

Permalink
fix(homepage): try adding more sanitasion for type (#648)
Browse files Browse the repository at this point in the history
**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [ ] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning

**➕ App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
  • Loading branch information
Ornias1993 committed Dec 23, 2023
1 parent e7133dd commit 0595e8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/common/Chart.yaml
Expand Up @@ -15,4 +15,4 @@ maintainers:
name: common
sources: null
type: library
version: 16.2.18
version: 16.2.19
Expand Up @@ -14,7 +14,8 @@
{{- $name := $homepage.name | default ($rootCtx.Chart.Name | camelcase) -}}
{{- $desc := $homepage.description | default $rootCtx.Chart.Description -}}
{{- $icon := $homepage.icon | default $rootCtx.Chart.Icon -}}
{{- $type := $homepage.widget.type | default $rootCtx.Chart.Name -}}
{{- $type := ( $homepage.widget.type | default $rootCtx.Chart.Name ) | lower -}}
{{- $type = regexReplaceAll "\\W+" $type "" -}}
{{- $url := $homepage.widget.url -}}
{{- $href := $homepage.href -}}

Expand All @@ -30,7 +31,7 @@
{{- if not $url -}}
{{- $svc := $svcData.name -}}
{{- $port := $svcData.port -}}
{{- $ns := printf "%s" (include "tc.v1.common.lib.metadata.namespace" (dict "rootCtx" $rootCtx "objectData" $objectData "caller" "Ingress") -}}
{{- $ns := printf "%s" (include "tc.v1.common.lib.metadata.namespace" (dict "rootCtx" $rootCtx "objectData" $objectData "caller" "Ingress")) -}}

{{- $url = printf "http://%s.$ns.svc:%s" $svc $ns $port -}}
{{- end -}}
Expand Down

0 comments on commit 0595e8f

Please sign in to comment.