Skip to content

Commit

Permalink
fix: fixiate instance name of ff-test and change instance name to rel…
Browse files Browse the repository at this point in the history
…ease name in ff-common
  • Loading branch information
philipsens committed Jun 30, 2023
1 parent ab7cd37 commit c01e54a
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 41 deletions.
2 changes: 1 addition & 1 deletion charts/ff-common/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: ff-common chart building components and helpers for the Frank!Framework
name: ff-common
version: 0.1.9
version: 0.1.10
appVersion: "7.8"
home: https://frankframework.org
icon: https://raw.githubusercontent.com/ibissource/charts/master/charts/ff-common/icon.svg
6 changes: 5 additions & 1 deletion charts/ff-common/templates/_names.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@ Create the instance name for the Frank!.
Will be set to the fullname unless value is set.
*/}}
{{- define "ff-common.instance.name" -}}
{{ default (include "ff-common.fullname" . ) .Values.frank.instance.name }}
{{- if (hasKey .Values.frank "instance") -}}
{{ default .Release.Name .Values.frank.instance.name }}
{{- else -}}
{{ .Release.Name }}
{{- end -}}
{{- end -}}
6 changes: 3 additions & 3 deletions charts/ff-common/templates/_util.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This takes an array of three values:
*/}}
{{- define "ff-common.util.merge" -}}
{{- $top := first . -}}
{{- $overrides := fromYaml (include (index . 1) $top) | default (dict ) -}}
{{- $tpl := fromYaml (include (index . 2) $top) | default (dict ) -}}
{{- toYaml (merge $overrides $tpl) -}}
{{- $tpl := fromYaml (include (index . 1) $top) | default (dict ) -}}
{{- $overrides := fromYaml (include (index . 2) $top) | default (dict ) -}}
{{- toYaml (merge $tpl $overrides) -}}
{{- end -}}
6 changes: 3 additions & 3 deletions charts/ff-test/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: ff-common
repository: file://../ff-common
version: 0.1.9
digest: sha256:3d35b0177f487d60e75e8fb755b7431c8bbde94d7ad447cf39992b1c569e8af1
generated: "2023-06-19T13:54:52.869571205+02:00"
version: 0.1.10
digest: sha256:6377597288293762ef910c31c1157278601b87793bf6503f9791eea7e84bc8b7
generated: "2023-06-30T11:46:15.982788486+02:00"
4 changes: 2 additions & 2 deletions charts/ff-test/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ description: A Helm chart for testing the Frank!Framework on Kubernetes
name: ff-test
icon: https://raw.githubusercontent.com/ibissource/charts/master/charts/ff-test/icon.svg
type: application
version: 0.2.19
version: 0.2.20

dependencies:
- name: ff-common
version: 0.1.x
version: ~0.1.10
repository: file://../ff-common
3 changes: 1 addition & 2 deletions charts/ff-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ To uninstall the chart:
| `frank.dtap.side` | Set the `DTAP` side of where the instance is running | `cluster` |
| `frank.credentials.secret` | Set the secret name of the existing secret | `""` |
| `frank.credentials.key` | Set the key inside the secret that contains the data (e.g. `credentials.properties`) | `""` |
| `frank.instance.name` | Set the name of the Frank! instance (default is the `fullname`) | `""` |
| `frank.configurations.names` | Set the configurations to load. Leave empty to use the default | `[]` |
| `frank.security.http.authentication` | Set http authentication for the Frank! | `false` |
| `frank.security.http.localUsers` | Set localUsers who can log in on the Frank! | `[]` |
Expand All @@ -80,7 +79,7 @@ To uninstall the chart:
| `connections.jdbc` | Set one database connections. The connection should match one in the context.xml | `{}` |
| `connections.jdbc.host` | Host of where the database can be reached (like in the same cluster e.g. `<service>.<namespace>.svc.cluster.local`). For H2 it can be `mem` or a file location | `""` |
| `connections.jdbc.port` | Port for the database (leave empty for default) | `""` |
| `connections.jdbc.database` | Name of the database to use (default is `.Values.instance.name`) | `""` |
| `connections.jdbc.database` | Name of the database to use (default is `.Release.name`) | `""` |
| `connections.jdbc.username` | Username to connect to the database (or use string template for use with credentials e.g. `${database/username}`) | `""` |
| `connections.jdbc.password` | Password to connect to the database (or use string template for use with credentials e.g. `${database/password}`) | `""` |
| `connections.jdbc.ssl` | Set to `true` is the connection uses SSL, default is `false` | `""` |
Expand Down
24 changes: 12 additions & 12 deletions charts/ff-test/templates/configmap.context.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ data:
<!-- IbisProp table has a column named VALUE. VALUE is a keyword in h2 db. -->
{{- with .Values.connections.jdbc }}
<Resource
name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-h2"
name="jdbc/ibis4test-h2"
factory="org.apache.naming.factory.BeanFactory"
type="org.h2.jdbcx.JdbcDataSource"
URL="jdbc:h2:mem:{{ .database | default (include "ff-common.instance.name" $) }};NON_KEYWORDS=VALUE;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;TRACE_LEVEL_FILE=0;"
/>
<Resource
name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-oracle-orcldb"
name="jdbc/ibis4test-oracle-orcldb"
factory="org.apache.naming.factory.BeanFactory"
type="oracle.jdbc.xa.client.OracleXADataSource"
URL="jdbc:oracle:thin:@{{ .host }}:{{ default 1521 .port }}:{{ .database | default (include "ff-common.instance.name" $) }}"
Expand All @@ -38,7 +38,7 @@ data:
/>
<Resource
name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-oracle-xe"
name="jdbc/ibis4test-oracle-xe"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@{{ .host }}:{{default 1521 .port }}:{{ .database | default (include "ff-common.instance.name" $) }}"
Expand All @@ -49,7 +49,7 @@ data:
/>
<Resource
name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-oracle"
name="jdbc/ibis4test-oracle"
factory="org.apache.naming.factory.BeanFactory"
type="oracle.jdbc.xa.client.OracleXADataSource"
URL="jdbc:oracle:thin:@{{ .host }}:{{default 1521 .port }}:{{ .database | default (include "ff-common.instance.name" $) }}"
Expand All @@ -58,7 +58,7 @@ data:
/>
<Resource
name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-mssql"
name="jdbc/ibis4test-mssql"
auth="Container"
factory="org.apache.naming.factory.BeanFactory"
type="com.microsoft.sqlserver.jdbc.SQLServerXADataSource"
Expand All @@ -81,7 +81,7 @@ data:
<!-- serverTimezone is set for docker instances -->
<Resource
name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-mysql"
name="jdbc/ibis4test-mysql"
factory="org.apache.naming.factory.BeanFactory"
type="com.mysql.cj.jdbc.MysqlXADataSource"
URL="jdbc:mysql://{{ .host }}:{{ default 3306 .port }}/{{ .database | default (include "ff-common.instance.name" $) }}"
Expand All @@ -98,7 +98,7 @@ data:
<!-- Use MySQL driver for MariaDB for proper XA support. --> <!-- serverTimezone is set for docker instances -->
<Resource
name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-mariadb"
name="jdbc/ibis4test-mariadb"
factory="org.apache.naming.factory.BeanFactory"
type="com.mysql.cj.jdbc.MysqlXADataSource"
URL="jdbc:mysql://{{ .host }}:{{ default 3306 .port }}/{{ .database | default (include "ff-common.instance.name" $) }}"
Expand All @@ -112,7 +112,7 @@ data:
/>
<!--
<Resource
name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-mariadb"
name="jdbc/ibis4test-mariadb"
factory="org.apache.naming.factory.BeanFactory"
type="org.mariadb.jdbc.MariaDbDataSource"
user="{{ .username }}"
Expand All @@ -124,7 +124,7 @@ data:
<Resource
name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-postgres-xa"
name="jdbc/ibis4test-postgres-xa"
factory="org.apache.naming.factory.BeanFactory"
type="org.postgresql.xa.PGXADataSource"
URL="jdbc:postgresql://{{ .host }}:{{ default 5432 .port }}/{{ .database | default (include "ff-common.instance.name" $) }}"
Expand All @@ -133,7 +133,7 @@ data:
/>
<!-- Postgres XA does not work without BTM/Narayana, gives ClassCastException casting the XA datasource to Java datasource, so add non-XA for those cases -->
<Resource name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-postgres" auth="Container"
<Resource name="jdbc/ibis4test-postgres" auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://{{ .host }}:{{ default 5432 .port }}/{{ .database | default (include "ff-common.instance.name" $) }}"
Expand All @@ -143,7 +143,7 @@ data:
maxWaitMillis="5000"
/>
<Resource name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-db2-xa" auth="Container"
<Resource name="jdbc/ibis4test-db2-xa" auth="Container"
factory="org.apache.naming.factory.BeanFactory"
type="com.ibm.db2.jcc.DB2XADataSource"
serverName="{{ .host }}"
Expand All @@ -155,7 +155,7 @@ data:
/>
<!-- DB2 XA does not work without BTM/Narayana, gives ClassCastException casting the XA datasource to Java datasource, so add non-XA for those cases -->
<Resource name="jdbc/{{ (include "ff-common.instance.name" $) | lower }}-db2" auth="Container"
<Resource name="jdbc/ibis4test-db2" auth="Container"
type="javax.sql.DataSource"
driverClassName="com.ibm.db2.jcc.DB2Driver"
url="jdbc:db2://{{ .host }}:{{ default 50000 .port }}/{{ .database | default (include "ff-common.instance.name" $) }}"
Expand Down
5 changes: 5 additions & 0 deletions charts/ff-test/templates/configmap.env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{- template "ff-common.configmap.env" (list . "frank2example.configmap.env" ) -}}
{{- define "frank2example.configmap.env" -}}
data:
instance.name: Ibis4Test
{{- end -}}
2 changes: 0 additions & 2 deletions charts/ff-test/templates/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{{ template "ff-common.configmap.env.tpl" . }}
---
{{ template "ff-common.configmap.tomcat-users.tpl" . }}
---
{{ template "ff-common.configmap.ldap-role-mapping.tpl" . }}
Expand Down
12 changes: 1 addition & 11 deletions charts/ff-test/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@
}
}
},
"instance": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Set the name of the Frank! instance (default is the `fullname`)",
"default": ""
}
}
},
"configurations": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -204,7 +194,7 @@
},
"database": {
"type": "string",
"description": "Name of the database to use (default is `.Values.instance.name`)",
"description": "Name of the database to use (default is `.Release.name`)",
"default": "",
"nullable": true
},
Expand Down
5 changes: 1 addition & 4 deletions charts/ff-test/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ frank:
secret: ""
key: ""
## @skip frank.instance [string]
## @param frank.instance.name Set the name of the Frank! instance (default is the `fullname`)
instance:
name: ""
## @skip frank.configurations [object]
## @param frank.configurations.names [array] Set the configurations to load. Leave empty to use the default
## e.g.
Expand Down Expand Up @@ -133,7 +130,7 @@ connections:
## @param connections.jdbc [object] Set one database connections. The connection should match one in the context.xml
## @param connections.jdbc.host [string] Host of where the database can be reached (like in the same cluster e.g. `<service>.<namespace>.svc.cluster.local`). For H2 it can be `mem` or a file location
## @param connections.jdbc.port [nullable,string] Port for the database (leave empty for default)
## @param connections.jdbc.database [nullable,string] Name of the database to use (default is `.Values.instance.name`)
## @param connections.jdbc.database [nullable,string] Name of the database to use (default is `.Release.name`)
## @param connections.jdbc.username [string] Username to connect to the database (or use string template for use with credentials e.g. `${database/username}`)
## @param connections.jdbc.password [string] Password to connect to the database (or use string template for use with credentials e.g. `${database/password}`)
## @param connections.jdbc.ssl [nullable,string] Set to `true` is the connection uses SSL, default is `false`
Expand Down

0 comments on commit c01e54a

Please sign in to comment.