Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type: application
# 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: 0.1.2
version: 0.1.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# letsencrypt

![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)
![Version: 0.1.3](https://img.shields.io/badge/Version-0.1.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)

A Helm chart to add letsencrypt support to Validated Patterns.

Expand Down
11 changes: 11 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{/*
Name (and namespace) of the cluster Argo CD CR to patch for ingress TLS (see templates/default-routes.yaml).
Presets: vp-gitops (Validated Patterns), openshift-gitops (OpenShift GitOps operator default).
*/}}
{{- define "letsencrypt.gitopsInstanceName" -}}
{{- $i := .Values.letsencrypt.gitopsInstance | default "vp-gitops" -}}
{{- if not (or (eq $i "vp-gitops") (eq $i "openshift-gitops")) -}}
{{- fail (printf "letsencrypt.gitopsInstance must be \"vp-gitops\" or \"openshift-gitops\", got %q" $i) -}}
{{- end -}}
{{- print $i -}}
{{- end -}}
4 changes: 2 additions & 2 deletions templates/default-routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ spec:
apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
name: openshift-gitops
namespace: openshift-gitops
name: {{ include "letsencrypt.gitopsInstanceName" . }}
namespace: {{ include "letsencrypt.gitopsInstanceName" . }}
annotations:
argocd.argoproj.io/sync-options: ServerSideApply=true, Validate=false, SkipDryRunOnMissingResource=true
spec:
Expand Down
29 changes: 29 additions & 0 deletions tests/default-routes_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
suite: Test default-routes Argo CD target
templates:
- templates/default-routes.yaml
release:
name: release-test
tests:
- it: patches vp-gitops Argo CD by default
asserts:
- hasDocuments:
count: 3
- containsDocument:
any: true
kind: ArgoCD
apiVersion: argoproj.io/v1alpha1
name: vp-gitops
namespace: vp-gitops
- it: patches openshift-gitops when gitopsInstance is set
set:
letsencrypt:
gitopsInstance: openshift-gitops
asserts:
- hasDocuments:
count: 3
- containsDocument:
any: true
kind: ArgoCD
apiVersion: argoproj.io/v1alpha1
name: openshift-gitops
namespace: openshift-gitops
5 changes: 5 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ letsencrypt:

# -- String the channel to install cert-manager from (Defaults to "stable-v1")
certmanagerChannel: "stable-v1"

# -- Which cluster Argo CD instance to patch for the server route TLS settings (`name` and `namespace` on the ArgoCD CR).
# Use `vp-gitops` when Argo CD runs in the Validated Patterns `vp-gitops` namespace (default).
# Use `openshift-gitops` for the default OpenShift GitOps operator instance.
gitopsInstance: vp-gitops