Skip to content

Commit

Permalink
Merge pull request #490 from kubero-dev/feature/singlefile-download
Browse files Browse the repository at this point in the history
improve template download
  • Loading branch information
mms-gianni authored Nov 16, 2024
2 parents 93c88a7 + dc61372 commit 4e7331f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
22 changes: 19 additions & 3 deletions server/src/modules/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Expand All @@ -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[] = []
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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)
}
}
5 changes: 3 additions & 2 deletions server/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export interface ITemplate {
name: string,
deploymentstrategy: 'git' | 'docker',
envVars: {}[],
serviceAccount: {
serviceAccount?: {
annotations: {},
create: boolean,
name: string,
Expand All @@ -141,7 +141,7 @@ export interface ITemplate {
tag: string,
pullPolicy?: 'Always',
containerPort: number,
run: {
run?: {
repository: string,
readOnlyAppStorage?: boolean,
tag: string,
Expand Down Expand Up @@ -251,6 +251,7 @@ export interface IKubectlMetadata {
creationTimestamp?: Date;
generation?: number;
//labels?: [Object];
annotations?: Object;
labels?: {
'kubernetes.io/metadata.name'?: String,
manager?: string;
Expand Down

0 comments on commit 4e7331f

Please sign in to comment.