Skip to content

Commit

Permalink
SONAR-21727 fix mpdev verify
Browse files Browse the repository at this point in the history
  • Loading branch information
jCOTINEAU committed Feb 23, 2024
1 parent f64fe39 commit 11203fd
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 3 deletions.
6 changes: 4 additions & 2 deletions charts/sonarqube-dce/templates/application.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.application .Values.application.create }} # declared in schema.yaml
{{- if not .Values.application_uid }} # declared in schema.yaml
apiVersion: app.k8s.io/v1beta1
kind: Application
metadata:
Expand Down Expand Up @@ -34,7 +34,9 @@ spec:
For extended documentation on how to configure this app, please refer to the [official SonarQube helm chart documentation](https://artifacthub.io/packages/helm/sonarqube/sonarqube-dce) and the main [README](https://github.com/SonarSource/helm-chart-sonarqube/blob/master/README.md)
selector:
matchLabels:
app.kubernetes.io/name: "{{ .Release.Name }}"
# we should use app.kubernetes.io/name, which should be set by default to all pods, but this is not working.
# so we rely on our own custom release field
release: "{{ .Release.Name }}"
addOwnerRef: true
componentKinds:
- group: v1
Expand Down
2 changes: 1 addition & 1 deletion charts/sonarqube-dce/templates/tests/sonarqube-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
'--waitretry=1',
'--timeout=5',
'-t',
'12',
'1200',
'-qO-',
'{{ template "sonarqube.fullname" . }}:{{ .Values.service.internalPort }}/api/system/status'
]
Expand Down
14 changes: 14 additions & 0 deletions google-cloud-marketplace-k8s-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ARG FROM=gcr.io/cloud-marketplace-tools/k8s/deployer_helm:latest
FROM $FROM

ENV WAIT_FOR_READY_TIMEOUT 1200
ENV TESTER_TIMEOUT 1200

COPY charts/sonarqube-dce /tmp/chart.tmp/sonarqube-dce
RUN cd /tmp \
&& mv chart.tmp/* chart \
Expand All @@ -11,9 +14,20 @@ RUN cd /tmp \

COPY google-cloud-marketplace-k8s-app/schema.yaml /data/schema.yaml
# Provide registry prefix and tag for default values for images.
# Might not be needed on V2 schema
ARG REGISTRY
ARG TAG
RUN cat /data/schema.yaml \
| env -i "REGISTRY=$REGISTRY" "TAG=$TAG" envsubst \
> /data/schema.yaml.new \
&& mv /data/schema.yaml.new /data/schema.yaml

COPY google-cloud-marketplace-k8s-app/data-test/schema.yaml /data-test/schema.yaml
# Provide registry prefix and tag for default values for images.
# Might not be needed on V2 schema
ARG REGISTRY
ARG TAG
RUN cat /data-test/schema.yaml \
| env -i "REGISTRY=$REGISTRY" "TAG=$TAG" envsubst \
> /data-test/schema.yaml.new \
&& mv /data-test/schema.yaml.new /data-test/schema.yaml
1 change: 1 addition & 0 deletions google-cloud-marketplace-k8s-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export VERSION=10.4.0
export MINOR_VERSION=$(echo $VERSION | cut -d. -f1,2)
# Deployer does not care about patch version. see [here](https://github.com/GoogleCloudPlatform/marketplace-k8s-app-tools/blob/master/docs/building-deployer-helm.md#images-in-staging-gcr)
docker build -f google-cloud-marketplace-k8s-app/Dockerfile --tag $REGISTRY/$APP_NAME/deployer:$MINOR_VERSION .
docker push $REGISTRY/$APP_NAME/deployer:$MINOR_VERSION
```

With the deployer being built, one can deploy the app as is, with
Expand Down
78 changes: 78 additions & 0 deletions google-cloud-marketplace-k8s-app/data-test/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
x-google-marketplace:
clusterConstraints:
istio:
type: UNSUPPORTED
schemaVersion: v2
applicationApiVersion: v1beta1
publishedVersion: '10.4.0'
publishedVersionMetadata:
releaseNote: >-
A first release.
images:
'':
properties:
ApplicationNodes.image.repository:
type: REPO_WITH_REGISTRY
ApplicationNodes.image.tag:
type: TAG
sonarqube-dce-search:
properties:
searchNodes.image.repository:
type: REPO_WITH_REGISTRY
searchNodes.image.tag:
type: TAG

properties:
name:
type: string
x-google-marketplace:
type: NAME
namespace:
type: string
x-google-marketplace:
type: NAMESPACE
appUid:
type: string
x-google-marketplace:
type: APPLICATION_UID
applicationUid:
generatedProperties:
createApplicationBoolean: application.create
ApplicationNodes.jwtSecret:
title: JWT Token for app authentication
description: A HS256 key encoded with base64 (This value must be set before installing the app, see documentation for more details)
maxLength: 44
type: string
default: dZ0EB0KxnF++nr5+4vfTCaun/eWbv6gOoXodiAMqcFo=
x-google-marketplace:
type: MASKED_FIELD
postgresql.enabled:
title: Enable embedeed PostgreSQL
description: If true, PostgreSQL will be installed (not recommended for production use case)
type: boolean
default: true
jdbcOverwrite.enable:
title: Enable external DB configuration
description: If true, the JDBC URL, username and password will be used to connect to the database. Make sure enable embedeed PostgreSQL is set to false
type: boolean
default: false
jdbcOverwrite.jdbcUrl:
title: JDBC URL
description: The JDBC URL to connect to the database
type: string
default: ''
jdbcOverwrite.jdbcUsername:
title: JDBC Username
description: The username to connect to the database
type: string
default: ''
jdbcOverwrite.jdbcPassword:
title: JDBC Password
description: The password to connect to the database
type: string
default: ''

required:
- name
- namespace
- ApplicationNodes.jwtSecret

0 comments on commit 11203fd

Please sign in to comment.