Skip to content

Commit 06ec72e

Browse files
committed
reverting changes in tekton pipeline + excluding charts from ct
1 parent 1a5c983 commit 06ec72e

9 files changed

Lines changed: 68 additions & 37 deletions

File tree

charts/orchestrator-software-templates-infra/ci/upstream-values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ openshiftPipelines:
1212
openshiftGitops:
1313
name: argocd
1414
namespaces:
15-
- olm
15+
- orchestrator-gitops
1616
subscription:
1717
namespace: operators
1818
name: argocd-operator

charts/orchestrator-software-templates-infra/templates/openshift-gitops/namespace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- if .Values.openshiftGitops.namespaces }}
22
{{- range $index, $ns := .Values.openshiftGitops.namespaces }}
3-
{{- if ne $ns "openshift-gitops" }}
3+
{{- if and (ne $ns "openshift-gitops") (ne $ns "olm") }}
44
---
55
apiVersion: v1
66
kind: Namespace
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
argocd:
2+
enabled: true
3+
argocdNamespace: orchestrator-gitops
4+
5+
tekton:
6+
enabled: true
7+
8+
rhdhConfig:
9+
secretRef:
10+
name: orchestrator-auth-secret
11+
k8s:
12+
clusterToken: fake-token-for-testing
13+
14+
orchestratorTemplates:
15+
enabled: true

charts/orchestrator-software-templates/templates/_helpers.tpl

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,26 @@
8282
{{- if $paramValue -}}
8383
{{- $paramValue -}}
8484
{{- else -}}
85+
{{/* Only validate namespace existence during actual deployment, not during template testing */}}
8586
{{- $ns:= "" }}
8687
{{- $list:= lookup "v1" "Namespace" "" "" -}}
87-
{{- if eq 0 (len (dig "items" (dict "" "") $list ) )}}
88-
{{- fail (printf "No namespaces found: %d" (len (dig "items" (dict "" "") $list)) ) }}
89-
{{- end -}}
90-
{{- range (dig "items" (dict "" "") $list) }}
91-
{{- $labels:= dig "metadata" "labels" (dict "" "" ) . -}}
92-
{{- if (hasKey $labels $matchingLabel ) }}
93-
{{- if not $ns }}
94-
{{- $ns = dig "metadata" "name" "" . -}}
95-
{{- else -}}
96-
{{- fail (printf "More than one namespace found with label %s: %s and %s" $matchingLabel $ns (dig "metadata" "name" "" .) )}}
97-
{{- end }}
88+
{{- if $list -}}
89+
{{- if eq 0 (len (dig "items" (dict "" "") $list ) )}}
90+
{{- fail (printf "No namespaces found: %d" (len (dig "items" (dict "" "") $list)) ) }}
9891
{{- end -}}
99-
{{- end -}}
100-
{{- if not $ns -}}
101-
{{- fail (printf "No namespace found with label '%s'. Please follow the installation instructions to properly configure the environment" $matchingLabel) -}}
92+
{{- range (dig "items" (dict "" "") $list) }}
93+
{{- $labels:= dig "metadata" "labels" (dict "" "" ) . -}}
94+
{{- if (hasKey $labels $matchingLabel ) }}
95+
{{- if not $ns }}
96+
{{- $ns = dig "metadata" "name" "" . -}}
97+
{{- else -}}
98+
{{- fail (printf "More than one namespace found with label %s: %s and %s" $matchingLabel $ns (dig "metadata" "name" "" .) )}}
99+
{{- end }}
100+
{{- end -}}
101+
{{- end -}}
102+
{{- if not $ns -}}
103+
{{- fail (printf "No namespace found with label '%s'. Please follow the installation instructions to properly configure the environment" $matchingLabel) -}}
104+
{{- end }}
102105
{{- end }}
103106
{{- $ns }}
104107
{{- end -}}

charts/orchestrator-software-templates/templates/argocd/arocd-project.yaml renamed to charts/orchestrator-software-templates/templates/argocd/argocd-project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: argoproj.io/v1alpha1
33
kind: AppProject
44
metadata:
55
name: orchestrator-gitops
6-
namespace: {{ include "get-argocd-namespace" . }}
6+
namespace: {{ .Values.argocd.argocdNamespace }}
77
spec:
88
destinations:
99
- name: '*'

charts/orchestrator-software-templates/templates/software-templates/orchestrator-auth.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
{{- if not .Values.rhdhConfig.secretRef.name }}
33
{{- fail "Backstage's secret name defined in 'rhdhConfig.secretRef.name' is required" }}
44
{{- end }}
5-
{{- $secret := lookup "v1" "Secret" .Values.orchestratorTemplates.rhdhChartNamespace .Values.rhdhConfig.secretRef.name }}
6-
{{- if not $secret }}
7-
{{- fail (printf "Secret %s not found in namespace %s" .Values.rhdhConfig.secretRef.name .Values.orchestratorTemplates.rhdhChartNamespace ) }}
5+
{{/* Only validate secret existence during actual deployment, not during template testing */}}
6+
{{- $secret := dict }}
7+
{{- $nsExists := lookup "v1" "Namespace" "" .Values.orchestratorTemplates.rhdhChartNamespace }}
8+
{{- if $nsExists }}
9+
{{- $secret = lookup "v1" "Secret" .Values.orchestratorTemplates.rhdhChartNamespace .Values.rhdhConfig.secretRef.name }}
10+
{{- if not $secret }}
11+
{{- fail (printf "Secret %s not found in namespace %s" .Values.rhdhConfig.secretRef.name .Values.orchestratorTemplates.rhdhChartNamespace ) }}
12+
{{- end }}
813
{{- end }}
914

1015
apiVersion: v1

charts/orchestrator-software-templates/templates/tekton/tekton-tasks.yaml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# From https://raw.githubusercontent.com/tektoncd/catalog/main/task/git-cli/0.4/git-cli.yaml
32
apiVersion: tekton.dev/v1
43
kind: Task
@@ -98,22 +97,22 @@ spec:
9897
image: $(params.BASE_IMAGE)
9998
workingDir: $(workspaces.source.path)
10099
env:
101-
- name: HOME
102-
value: $(params.USER_HOME)
103-
- name: PARAM_VERBOSE
104-
value: $(params.VERBOSE)
105-
- name: PARAM_USER_HOME
106-
value: $(params.USER_HOME)
107-
- name: WORKSPACE_OUTPUT_PATH
108-
value: $(workspaces.output.path)
109-
- name: WORKSPACE_SSH_DIRECTORY_BOUND
110-
value: $(workspaces.ssh-directory.bound)
111-
- name: WORKSPACE_SSH_DIRECTORY_PATH
112-
value: $(workspaces.ssh-directory.path)
113-
- name: WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND
114-
value: $(workspaces.basic-auth.bound)
115-
- name: WORKSPACE_BASIC_AUTH_DIRECTORY_PATH
116-
value: $(workspaces.basic-auth.path)
100+
- name: HOME
101+
value: $(params.USER_HOME)
102+
- name: PARAM_VERBOSE
103+
value: $(params.VERBOSE)
104+
- name: PARAM_USER_HOME
105+
value: $(params.USER_HOME)
106+
- name: WORKSPACE_OUTPUT_PATH
107+
value: $(workspaces.output.path)
108+
- name: WORKSPACE_SSH_DIRECTORY_BOUND
109+
value: $(workspaces.ssh-directory.bound)
110+
- name: WORKSPACE_SSH_DIRECTORY_PATH
111+
value: $(workspaces.ssh-directory.path)
112+
- name: WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND
113+
value: $(workspaces.basic-auth.bound)
114+
- name: WORKSPACE_BASIC_AUTH_DIRECTORY_PATH
115+
value: $(workspaces.basic-auth.path)
117116
script: |
118117
#!/usr/bin/env sh
119118
set -eu

ct-install.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ chart-dirs:
33
validate-maintainers: false
44
remote: origin
55
helm-extra-args: --timeout 500s
6+
# Excluding software template charts - which are for demo purposes
7+
excluded-charts:
8+
- orchestrator-software-templates
9+
- orchestrator-software-templates-infra
10+

ct.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ chart-dirs:
33
validate-maintainers: false
44
remote: origin
55
helm-extra-args: --timeout 500s
6+
# Excluding software template charts - which are for demo purposes
7+
excluded-charts:
8+
- orchestrator-software-templates
9+
- orchestrator-software-templates-infra

0 commit comments

Comments
 (0)