Skip to content

Commit

Permalink
[Misc] Plugin: mta determination of CAP added (#38)
Browse files Browse the repository at this point in the history
* [Misc] Plugin: mta determination of CAP added

Enhance mta to add potential "CAP" type workloads.
Fix issue with CAV.Spec.Version being set as a number.

* Updated changelog and package to version 0.4.0

---------

Co-authored-by: anirudhprasad-sap <126493692+anirudhprasad-sap@users.noreply.github.com>
  • Loading branch information
Pavan-SAP and anirudhprasad-sap authored Sep 16, 2024
1 parent f1b9e60 commit 9e2e656
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 15 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). The format is based on [Keep a Changelog](http://keepachangelog.com/).

## Version 0.4.0 - 16-September-2024

### Added

- Added handling for `CAP` and `Additional` workloads in mta transformer

### Fixed

- Fix issue with CAV.Spec.Version being set as a number

## Version 0.3.0 - 13-September-2024

### Added
Expand Down
2 changes: 1 addition & 1 deletion files/chart/templates/cap-operator-cros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: {{ .Release.Revision }}
version: "{{ .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{.}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: {{ .Release.Revision }}
version: "{{ .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{.}}
Expand Down
7 changes: 6 additions & 1 deletion lib/mta-transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,15 @@ module.exports = class MtaTransformer {
type: module.type === 'com.sap.application.content'? "Content": "TenantOperation",
image: null
}
} else if (module.path.includes("gen/srv")) {
workload.deploymentDefinition = {
type: "CAP",
image: null
}
} else {
workload.deploymentDefinition = {
type: module.path.includes("approuter") ||
module.path.includes("router") ? "Router" : null,
module.path.includes("router") ? "Router" : "Additional",
image: null
}
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cap-js/cap-operator-plugin",
"version": "0.3.0",
"version": "0.4.0",
"description": "Add/Build Plugin for CAP Operator",
"homepage": "https://github.com/cap-js/cap-operator-plugin/blob/main/README.md",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions test/files/expectedChart/valuesWithMTA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ workloads:
- author-readings-auditlog-bind
- author-readings-registry-bind
deploymentDefinition:
type: null
type: CAP
image: null
env:
- name: OTLP_TRACE_URL
Expand All @@ -171,7 +171,7 @@ workloads:
- author-readings-service-manager-author-readings-mtx-srv-bind
- author-readings-logging-bind
deploymentDefinition:
type: null
type: Additional
image: null
authorReadingsAppDeployer:
name: author-readings-app-deployer
Expand All @@ -197,7 +197,7 @@ workloads:
- author-readings-uaa-bind
- author-readings-logging-bind
deploymentDefinition:
type: null
type: Additional
image: null
env:
- name: TENANT_HOST_PATTERN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: {{ .Release.Revision }}
version: "{{ .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{.}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: {{ .Release.Revision }}
version: "{{ .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{.}}
Expand Down Expand Up @@ -84,7 +84,7 @@ spec:
- author-readings-auditlog-bind
- author-readings-registry-bind
deploymentDefinition:
type: null
type: CAP
image: "{{.Values.workloads.authorReadingsSrv.image}}"
env:
- name: OTLP_TRACE_URL
Expand All @@ -101,7 +101,7 @@ spec:
- author-readings-service-manager-author-readings-mtx-srv-bind
- author-readings-logging-bind
deploymentDefinition:
type: null
type: Additional
image: "{{.Values.workloads.authorReadingsMtxSrv.image}}"
- name: author-readings-app-deployer
consumedBTPServices:
Expand All @@ -124,7 +124,7 @@ spec:
- author-readings-uaa-bind
- author-readings-logging-bind
deploymentDefinition:
type: null
type: Additional
image: "{{.Values.workloads.authorReadings.image}}"
env:
- name: TENANT_HOST_PATTERN
Expand Down
2 changes: 1 addition & 1 deletion test/files/mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ modules:
# Multi Tenancy Service Module (Onboarding, Upgrading)
- name: author-readings-mtx-srv
type: nodejs
path: gen/srv
path: gen/multi-tenancy/srv
requires:
- name: author-readings-auditlog
- name: author-readings-uaa
Expand Down

0 comments on commit 9e2e656

Please sign in to comment.