Skip to content

Commit e16fcab

Browse files
authored
Merge pull request #617 from kubero-dev/feature/add-versions-for-addons
add version field for addons
2 parents 4c3a9eb + 31eb2f7 commit e16fcab

File tree

9 files changed

+83
-4
lines changed

9 files changed

+83
-4
lines changed

client/src/components/apps/addons.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@
119119
dense
120120
v-model="field.default"
121121
></v-select>
122+
<v-combobox
123+
v-if="field.type === 'combobox' && typeof field.default === 'string'"
124+
:items="field.options"
125+
:label="field.label"
126+
item-title="text"
127+
item-value="value"
128+
dense
129+
v-model="field.default"
130+
></v-combobox>
122131
<v-text-field
123132
v-if="field.type === 'text'"
124133
v-model="field.default"
@@ -309,7 +318,7 @@ export default defineComponent({
309318
310319
// set the formfields to the values from the yaml
311320
//console.log(this.selectedAddon.formfields);
312-
Object.entries(this.selectedAddon.formfields).forEach(([field, value]) => {
321+
Object.entries(this.selectedAddon.formfields as FormField[]).forEach(([field, value]) => {
313322
const fieldvalue = get(addon.resourceDefinitions, field, value.default)
314323
//console.log(field, value, fieldvalue);
315324
value.default = fieldvalue;
@@ -338,7 +347,7 @@ export default defineComponent({
338347
this.dialog = false;
339348
340349
// replace the formfields with the form value
341-
Object.entries(this.selectedAddon.formfields).forEach(([field, value]) => {
350+
Object.entries(this.selectedAddon.formfields as FormField[]).forEach(([field, value]) => {
342351
343352
// Cast number fields to int
344353
if (value.type === 'number' && typeof value.default === 'string') {
@@ -364,8 +373,6 @@ export default defineComponent({
364373
resourceDefinitions: this.selectedAddon.resourceDefinitions,
365374
} as Addon;
366375
367-
//console.log(addon);
368-
369376
if (this.mode === 'create') {
370377
this.addAddon(addon);
371378
} else {

server/src/addons/kuberoCouchDB.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export class KuberoCouchDB extends Plugin implements IPlugin {
2424
default: 'couchdb',
2525
description: 'The name of the Couchdb instance'
2626
},
27+
'KuberoCouchDB.spec.couchdb.image.tag':{
28+
type: 'combobox',
29+
label: 'Version/Tag',
30+
options: ['3.2.1', '3.3', '3.4.2', 'latest'], // TODO - load this dynamically
31+
name: 'spec.couchdb.image.tag',
32+
required: true,
33+
default: '3.2.1'
34+
description: 'Version of the PostgreSQL image to use'
35+
},
2736
'KuberoCouchDB.spec.couchdb.clusterSize':{
2837
type: 'number',
2938
label: 'Cluster Size*',

server/src/addons/kuberoElasticsearch.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export class KuberoElasticsearch extends Plugin implements IPlugin {
2424
default: 'elasticsearch',
2525
description: 'The name of the elasticsearch instance'
2626
},
27+
'KuberoElasticsearch.spec.elasticsearch.image.tag':{
28+
type: 'combobox',
29+
label: 'Version/Tag',
30+
options: ['7', '7.17.26', '8.6.0-debian-11-r0', '8', '8.17.1', 'latest'], // TODO - load this dynamically
31+
name: 'spec.couchdb.image.tag',
32+
required: true,
33+
default: '8.6.0-debian-11-r0'
34+
description: 'Version of the PostgreSQL image to use'
35+
},
2736
'KuberoElasticsearch.spec.elasticsearch.global.storageClass':{
2837
type: 'select-storageclass',
2938
label: 'Storage Class',

server/src/addons/kuberoMemcached.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export class KuberoMemcached extends Plugin implements IPlugin {
2424
default: 'memcached',
2525
description: 'The name of the Memcached instance'
2626
},
27+
'KuberoMemcached.spec.memcached.image.tag':{
28+
type: 'combobox',
29+
label: 'Version/Tag',
30+
options: ['1.6.22-debian-11-r1', '1', '1.6.34', 'latest'], // TODO - load this dynamically
31+
name: 'spec.memcached.image.tag',
32+
required: true,
33+
default: '1.6.22-debian-11-r1'
34+
description: 'Version of the PostgreSQL image to use'
35+
},
2736
'KuberoMemcached.spec.memcached.architecture':{
2837
type: 'select',
2938
label: 'Architecture*',

server/src/addons/kuberoMongoDB.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export class KuberoMongoDB extends Plugin implements IPlugin {
2424
default: 'mongodb',
2525
description: 'The name of tht MongoDB instance'
2626
},
27+
'KuberoMongoDB.spec.mongodb.image.tag':{
28+
type: 'combobox',
29+
label: 'Version/Tag',
30+
options: ['6.0.6-debian-11-r3', '7.0.15', '8.0', '8.0.4', 'latest'], // TODO - load this dynamically
31+
name: 'spec.mongodb.image.tag',
32+
required: true,
33+
default: '8.0'
34+
description: 'Version of the PostgreSQL image to use'
35+
},
2736
'KuberoMongoDB.spec.mongodb.global.storageClass':{
2837
type: 'select-storageclass',
2938
label: 'Storage Class',

server/src/addons/kuberoMysql.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export class KuberoMysql extends Plugin implements IPlugin {
2424
default: 'mysql',
2525
description: 'The name of the MySQL instance'
2626
},
27+
'KuberoMysql.spec.mysql.image.tag':{
28+
type: 'combobox',
29+
label: 'Version/Tag',
30+
options: ['8.0.33-debian-11-r12', '8.1', '8.2-debian-11', '8.4.4', '9.0', 'latest'], // TODO - load this dynamically
31+
name: 'spec.mysql.image.tag',
32+
required: true,
33+
default: '8.4.4'
34+
description: 'Version of the PostgreSQL image to use'
35+
},
2736
'KuberoMysql.spec.mysql.global.storageClass':{
2837
type: 'select-storageclass',
2938
label: 'Storage Class',

server/src/addons/kuberoPostgresql.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export class KuberoPostgresql extends Plugin implements IPlugin {
2424
default: 'postgresql',
2525
description: 'The name of the PostgreSQL instance'
2626
},
27+
'KuberoPostgresql.spec.postgresql.image.tag':{
28+
type: 'combobox',
29+
label: 'Version/Tag',
30+
options: ['13', '14', '15', '16.6.0', '17.2.0', 'latest'], // TODO - load this dynamically
31+
name: 'spec.postgresql.image.tag',
32+
required: true,
33+
default: '16'
34+
description: 'Version of the PostgreSQL image to use'
35+
},
2736
'KuberoPostgresql.spec.postgresql.global.postgresql.auth.postgresPassword':{
2837
type: 'text',
2938
label: 'Postgres admin Password*',

server/src/addons/kuberoRabbitMQ.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export class KuberoRabbitMQ extends Plugin implements IPlugin {
2424
default: 'rabbitmq',
2525
description: 'The name of the PostgreSQL instance'
2626
},
27+
'KuberoRabbitMQ.spec.rabbitmq.image.tag':{
28+
type: 'combobox',
29+
label: 'Version/Tag',
30+
options: ['3.12.10-debian-11-r1', '3.13.7', '4.0.5', 'latest'], // TODO - load this dynamically
31+
name: 'spec.rabbitmq.image.tag',
32+
required: true,
33+
default: '3.12.10-debian-11-r1',
34+
description: 'Version of the PostgreSQL image to use'
35+
},
2736
'KuberoRabbitMQ.spec.rabbitmq.auth.username':{
2837
type: 'text',
2938
label: 'User Name*',

server/src/addons/kuberoRedis.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export class KuberoRedis extends Plugin implements IPlugin {
2424
default: 'redis',
2525
description: 'The name of the redis instance'
2626
},
27+
'KuberoRedis.spec.redis.image.tag':{
28+
type: 'combobox',
29+
label: 'Version/Tag',
30+
options: ['7.0.7-debian-11-r7', '6.2', '7.4.2', 'latest'], // TODO - load this dynamically
31+
name: 'spec.redis.image.tag',
32+
required: true,
33+
default: '7.0-debian-12',
34+
description: 'Version of the PostgreSQL image to use'
35+
},
2736
'KuberoRedis.spec.redis.replica.replicaCount':{
2837
type: 'number',
2938
label: 'Replica Count*',

0 commit comments

Comments
 (0)