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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ The generated `chart/values.yaml` contains two types of information:

After execution, the `runtime-values.yaml` file is created in the chart folder of your project directory.

> **Note:** By default, the `CAPApplicationVersion` resource uses the Helm release revision as its version (`.Release.Revision`). If you are not using `helm install`/`helm upgrade` directly — for example, when templating the chart and applying the rendered manifests via GitOps tools like Argo CD, the revision may always be `1`. In such cases, you can explicitly set a version string via `app.version` in your runtime-values.yaml (e.g., `app.version: "1.2.3"`). When set, this value takes precedence over the release revision.

7. Now, you can deploy the application using the following command:

```sh
Expand Down
3 changes: 3 additions & 0 deletions files/chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3204,6 +3204,9 @@
"type": "string"
},
"type": "object"
},
"version": {
"type": "string"
}
},
"required": [
Expand Down
3 changes: 3 additions & 0 deletions files/configurableTemplatesChart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
"type": "string"
},
"type": "object"
},
"version": {
"type": "string"
}
},
"required": [
Expand Down
1 change: 1 addition & 0 deletions hack/schema-generation.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type provider struct {
type app struct {
Domains Domains `json:"domains"`
IstioIngressGatewayLabels map[string]string `json:"istioIngressGatewayLabels"`
Version string `json:"version,omitempty"`
}

type serviceInstanceExt struct {
Expand Down
4 changes: 2 additions & 2 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ function writeCAPApplicationVersionCommonCRO(yaml) {
' name: {{ include "capApplicationVersionName" $ }}',
'spec:',
' capApplicationInstance: {{ include "appName" $ }}',
' version: "{{ .Release.Revision }}"',
' version: "{{ .Values.app.version | default .Release.Revision }}"',
Comment thread
anirudhprasad-sap marked this conversation as resolved.
' registrySecrets:',
' {{- range .Values.imagePullSecrets }}',
' - {{ . }}',
Expand Down Expand Up @@ -689,7 +689,7 @@ function getHelperTpl(project, isConfigurableTemplateChart) {

yaml.push([
'{{- define "capApplicationVersionName" -}}',
'{{ printf "%s-%d" (include "appName" $) (.Release.Revision) }}',
'{{ printf "%s-%v" (include "appName" $) (.Values.app.version | default .Release.Revision) }}',
'{{- end -}}',
'\n',
'{{- define "domainName" -}}',
Expand Down
2 changes: 1 addition & 1 deletion test/files/expectedChart/templates/_helpers-ias.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- define "capApplicationVersionName" -}}
{{ printf "%s-%d" (include "appName" $) (.Release.Revision) }}
{{ printf "%s-%v" (include "appName" $) (.Values.app.version | default .Release.Revision) }}
{{- end -}}

{{- define "domainName" -}}
Expand Down
2 changes: 1 addition & 1 deletion test/files/expectedChart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- define "capApplicationVersionName" -}}
{{ printf "%s-%d" (include "appName" $) (.Release.Revision) }}
{{ printf "%s-%v" (include "appName" $) (.Values.app.version | default .Release.Revision) }}
{{- end -}}

{{- define "domainName" -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
2 changes: 1 addition & 1 deletion test/files/expectedChart/templates/cap-operator-cros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- define "capApplicationVersionName" -}}
{{ printf "%s-%d" (include "appName" $) (.Release.Revision) }}
{{ printf "%s-%v" (include "appName" $) (.Values.app.version | default .Release.Revision) }}
{{- end -}}

{{- define "domainName" -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- define "capApplicationVersionName" -}}
{{ printf "%s-%d" (include "appName" $) (.Release.Revision) }}
{{ printf "%s-%v" (include "appName" $) (.Values.app.version | default .Release.Revision) }}
{{- end -}}

{{- define "domainName" -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ metadata:
name: {{ include "capApplicationVersionName" $ }}
spec:
capApplicationInstance: {{ include "appName" $ }}
version: "{{ .Release.Revision }}"
version: "{{ .Values.app.version | default .Release.Revision }}"
registrySecrets:
{{- range .Values.imagePullSecrets }}
- {{ . }}
Expand Down
Loading