From dc613723f213793ac8d7afe1a7ab3ffd18dc0063 Mon Sep 17 00:00:00 2001 From: Gianni Carafa Date: Fri, 15 Nov 2024 00:04:28 +0100 Subject: [PATCH] improve template download --- server/src/modules/application.ts | 22 +++++++++++++++++++--- server/src/types.ts | 5 +++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/server/src/modules/application.ts b/server/src/modules/application.ts index aa0746a0..7277ee72 100644 --- a/server/src/modules/application.ts +++ b/server/src/modules/application.ts @@ -221,6 +221,18 @@ export class KubectlTemplate implements IKubectlTemplate{ this.kind = "KuberoApp"; this.metadata = { name: app.name, + annotations: { + 'kubero.dev/template.architecture': '[]', + 'kubero.dev/template.description': '', + 'kubero.dev/template.icon': '', + 'kubero.dev/template.installation': '', + 'kubero.dev/template.links': '[]', + 'kubero.dev/template.screenshots': '[]', + 'kubero.dev/template.source': '', + 'kubero.dev/template.tags': '[]', + 'kubero.dev/template.title': '', + 'kubero.dev/template.website': '' + }, labels: { manager: 'kubero', } @@ -233,11 +245,13 @@ export class Template implements ITemplate{ public name: string public deploymentstrategy: 'git' | 'docker' public envVars: {}[] = [] + /* public serviceAccount: { annotations: Object create: boolean, name: string, }; + */ public extraVolumes: IExtraVolume[] = [] public cronjobs: ICronjob[] = [] public addons: IAddon[] = [] @@ -255,12 +269,14 @@ export class Template implements ITemplate{ pullPolicy?: 'Always', repository: string, tag: string, + /* run: { repository: string, tag: string, readOnlyAppStorage?: boolean, securityContext: ISecurityContext } + */ }; constructor( app: IApp @@ -270,7 +286,7 @@ export class Template implements ITemplate{ this.envVars = app.envVars - this.serviceAccount = app.serviceAccount; + //this.serviceAccount = app.serviceAccount; this.extraVolumes = app.extraVolumes @@ -290,11 +306,11 @@ export class Template implements ITemplate{ pullPolicy: 'Always', repository: app.image.repository || 'ghcr.io/kubero-dev/idler', tag: app.image.tag || 'v1', - run: app.image.run, + //run: app.image.run, } // function to set security context, required for backwards compatibility // Added in v1.11.0 - this.image.run.securityContext = Buildpack.SetSecurityContext(this.image.run.securityContext) + //this.image.run.securityContext = Buildpack.SetSecurityContext(this.image.run.securityContext) } } diff --git a/server/src/types.ts b/server/src/types.ts index c2cc4c1a..36e0edf6 100644 --- a/server/src/types.ts +++ b/server/src/types.ts @@ -131,7 +131,7 @@ export interface ITemplate { name: string, deploymentstrategy: 'git' | 'docker', envVars: {}[], - serviceAccount: { + serviceAccount?: { annotations: {}, create: boolean, name: string, @@ -141,7 +141,7 @@ export interface ITemplate { tag: string, pullPolicy?: 'Always', containerPort: number, - run: { + run?: { repository: string, readOnlyAppStorage?: boolean, tag: string, @@ -251,6 +251,7 @@ export interface IKubectlMetadata { creationTimestamp?: Date; generation?: number; //labels?: [Object]; + annotations?: Object; labels?: { 'kubernetes.io/metadata.name'?: String, manager?: string;