mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-03 02:09:14 -03:00
fix: remove tc-system namespace creation and fix operator verification code (#442)
**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._
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
global:
|
||||
createTCNamespace: true
|
||||
|
||||
workload:
|
||||
main:
|
||||
enabled: true
|
||||
|
||||
@@ -4,8 +4,6 @@ templates:
|
||||
tests:
|
||||
- it: should pass with defaults
|
||||
set:
|
||||
global:
|
||||
createTCNamespace: true
|
||||
service:
|
||||
main:
|
||||
enabled: true
|
||||
@@ -22,21 +20,11 @@ tests:
|
||||
enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &namespaceDoc 0
|
||||
isKind:
|
||||
of: Namespace
|
||||
- documentIndex: *namespaceDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: tc-system
|
||||
- documentIndex: *namespaceDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: &deploymentDoc 1
|
||||
count: 2
|
||||
- documentIndex: &deploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: &serviceDoc 2
|
||||
- documentIndex: &serviceDoc 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *serviceDoc
|
||||
|
||||
@@ -15,4 +15,4 @@ maintainers:
|
||||
name: common
|
||||
sources: null
|
||||
type: library
|
||||
version: 12.10.7
|
||||
version: 12.10.8
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{{- define "tc.v1.common.lib.util.tcnamespace" -}}
|
||||
{{- if $.Values.global.createTCNamespace -}}
|
||||
{{/* Only create it if it does not exist */}}
|
||||
{{- if not (lookup "v1" "Namespace" "" "tc-system") }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: tc-system
|
||||
annotations:
|
||||
"helm.sh/resource-policy": keep
|
||||
"helm.sh/hook": pre-install
|
||||
"helm.sh/hook-weight": "-20"
|
||||
"helm.sh/hook-delete-policy": hook-failed
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -19,13 +19,15 @@
|
||||
|
||||
{{/* Go over all configmaps */}}
|
||||
{{- range $index, $cm := (lookup "v1" "ConfigMap" "" "").items -}}
|
||||
{{/* If "tc-operator-name" does not exist will return "" */}}
|
||||
{{- $name := (get $cm.data "tc-operator-name") -}}
|
||||
{{- if $cm.data -}}
|
||||
{{/* If "tc-operator-name" does not exist will return "" */}}
|
||||
{{- $name := (get $cm.data "tc-operator-name") -}}
|
||||
|
||||
{{/* If fetched name matches the "$opName"... */}}
|
||||
{{- if eq $name $opName -}}
|
||||
{{/* Mark operator as found*/}}
|
||||
{{- $opExists = true -}}
|
||||
{{/* If fetched name matches the "$opName"... */}}
|
||||
{{- if eq $name $opName -}}
|
||||
{{/* Mark operator as found*/}}
|
||||
{{- $opExists = true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
{{/* Merge chart values and the common chart defaults */}}
|
||||
{{- include "tc.v1.common.values.init" . -}}
|
||||
|
||||
{{/* Create tc-system namespace */}}
|
||||
{{- include "tc.v1.common.lib.util.tcnamespace" . -}}
|
||||
|
||||
{{/* Parse lists and append to values */}}
|
||||
{{- include "tc.v1.common.loader.lists" . -}}
|
||||
|
||||
|
||||
@@ -13,8 +13,6 @@ global:
|
||||
# -- Enable to stop most pods and containers including cnpg
|
||||
# does not include stand-alone pods
|
||||
stopAll: false
|
||||
# -- Creates the tc-system namespace. Used for operator charts
|
||||
createTCNamespace: true
|
||||
|
||||
fallbackDefaults:
|
||||
# -- Define a storageClassName that will be used for all PVCs
|
||||
|
||||
Reference in New Issue
Block a user