Skip to content

Commit

Permalink
OPSEXP-2116 repository service named template alfresco-connector-ms365 (
Browse files Browse the repository at this point in the history
  • Loading branch information
slohe1 authored Jul 14, 2023
1 parent 384441a commit fe668c6
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 18 deletions.
2 changes: 1 addition & 1 deletion charts/alfresco-connector-ms365/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: alfresco-connector-ms365
description: A Helm chart for deploying Alfresco connector ms365 service
type: application
version: 0.1.0
version: 0.2.0
appVersion: "2.0.0"
dependencies:
- name: alfresco-common
Expand Down
3 changes: 2 additions & 1 deletion charts/alfresco-connector-ms365/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# alfresco-connector-ms365

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

A Helm chart for deploying Alfresco connector ms365 service

Expand Down Expand Up @@ -33,6 +33,7 @@ A Helm chart for deploying Alfresco connector ms365 service
| readinessProbe.periodSeconds | int | `60` | |
| readinessProbe.timeoutSeconds | int | `10` | |
| replicaCount | int | `2` | |
| repository.existingConfigMap | string | `nil` | a pre-existing configmap which provides expected configuration for ms365 |
| repository.host | string | `"acs-alfresco-cs-repository"` | ACS repository host |
| repository.port | int | `80` | ACS repository port |
| resources.limits.cpu | string | `"2"` | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Defines the properties required by the alfresco-connector-ms365 container
{{- if not .Values.repository.existingConfigMap -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "alfresco-connector-ms365.fullname" . }}
labels:
{{- include "alfresco-connector-ms365.labels" . | nindent 4 }}
data:
{{- $alfbaseurl := printf "-Dalfresco.base-url=http://%s:%d" .Values.repository.host (int .Values.repository.port ) -}}
{{- $environment := .Values.environment | default dict }}
JAVA_OPTS: {{ tpl (printf "%s %s" ($environment.JAVA_OPTS | default "") $alfbaseurl) $ | trim | quote }}
{{- range $key, $val := omit $environment "JAVA_OPTS" }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- $alfbaseurl := printf "http://%s:%d" .Values.repository.host (int .Values.repository.port ) }}
REPO_URL: {{ $alfbaseurl }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ spec:
template:
metadata:
annotations:
{{- if not .Values.repository.existingConfigMap }}
checksum/config: {{ include (print $.Template.BasePath "/config-connector-ms365.yaml") . | sha256sum }}
{{- end }}
labels:
{{- include "alfresco-connector-ms365.selectorLabels" . | nindent 8 }}
spec:
Expand Down Expand Up @@ -62,7 +64,15 @@ spec:
{{- include "component-security-context" .Values | indent 8 }}
envFrom:
- configMapRef:
name: {{ template "alfresco-connector-ms365.fullname" . }}
name: {{ .Values.repository.existingConfigMap | default (print (include "alfresco-connector-ms365.fullname" .)) }}
env:
{{- range $key, $value := (omit .Values.environment "JAVA_OPTS") }}
- name: {{ $key }}
value: {{ $value }}
{{- end }}
- name: JAVA_OPTS
value: >-
{{ (printf "%s %s" (.Values.environment.JAVA_OPTS | default "") "-Dalfresco.base-url=$REPO_URL") }}
ports:
- containerPort: {{ .Values.image.internalPort }}
resources: {{- toYaml .Values.resources | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ suite: test connector-ms365 deployment
templates:
- config-connector-ms365.yaml
tests:
- it: should render just the URL in JAVA_OPTS
values: &testvalues
set:
repository.host: acs-alfresco-cs-repository
repository.port: 80
asserts:
- equal:
path: data.JAVA_OPTS
value: -Dalfresco.base-url=http://acs-alfresco-cs-repository:80
- it: should not render a configmap
set:
repository:
existingConfigMap: myns/mycm
asserts:
- hasDocuments:
count: 0
template: config-connector-ms365.yaml

- it: should render a default config
asserts:
- equal:
path: data.REPO_URL
value: http://acs-alfresco-cs-repository:80
template: config-connector-ms365.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ tests:
cpu: "2"
memory: "1000Mi"
template: deployment-connector-ms365.yaml

- it: should leverage provided exisintg configmap
set:
repository:
existingConfigMap: service/test
asserts:
- contains:
path: spec.template.spec.containers[0].envFrom
content:
configMapRef:
name: service/test
template: deployment-connector-ms365.yaml
2 changes: 2 additions & 0 deletions charts/alfresco-connector-ms365/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ repository:
host: acs-alfresco-cs-repository
# -- ACS repository port
port: 80
# -- a pre-existing configmap which provides expected configuration for ms365
existingConfigMap: null

0 comments on commit fe668c6

Please sign in to comment.