Skip to content

Commit 084874a

Browse files
committed
fix container image deployment
1 parent d38dd47 commit 084874a

File tree

5 files changed

+7
-33
lines changed

5 files changed

+7
-33
lines changed

client/src/components/pipelines/appcard.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<v-card-text>
2121
<v-row
22-
v-if="this.app.buildpack != 'Docker'"
22+
v-if="this.app.deploymentstrategy != 'docker'"
2323
class="mx-0"
2424
>
2525
<v-icon left small>mdi-git</v-icon>
@@ -28,7 +28,7 @@
2828
</div>
2929
</v-row>
3030
<v-row
31-
v-if="this.app.buildpack == 'Docker'"
31+
v-if="this.app.deploymentstrategy == 'docker'"
3232
class="mx-0"
3333
>
3434
<v-icon left small>mdi-docker</v-icon>
@@ -37,8 +37,8 @@
3737
</div>
3838
</v-row>
3939
<p></p>
40-
<v-chip label class="mr-1"><span v-if="this.autodeploy">Autodeploy | </span>{{ this.app.branch }}</v-chip>
41-
<v-chip label class="mr-1" v-if="this.app.commithash">{{ this.app.commithash }}</v-chip>
40+
<v-chip label class="mr-1" v-if="this.app.deploymentstrategy != 'docker'"><span v-if="this.autodeploy">Autodeploy | </span>{{ this.app.branch }}</v-chip>
41+
<v-chip label class="mr-1" v-if="this.app.deploymentstrategy != 'docker' && this.app.commithash">{{ this.app.commithash }}</v-chip>
4242

4343
</v-card-text>
4444

src/kubero.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,12 @@ export class Kubero {
188188

189189
// create a new app in a specified pipeline and phase
190190
public async newApp(app: App) {
191-
debug.log('create App: '+app.name+' in '+ app.pipeline+' phase: '+app.phase);
191+
debug.log('create App: '+app.name+' in '+ app.pipeline+' phase: '+app.phase + ' deploymentstrategy: '+app.deploymentstrategy);
192192
const contextName = this.getContext(app.pipeline, app.phase);
193193
if (contextName) {
194194
await this.kubectl.createApp(app, contextName);
195195
this.appStateList.push(app);
196196

197-
let namespace = app.pipeline+'-'+app.phase;
198197
this._io.emit('updatedApps', "created");
199198
this.kubectl.createEvent('Normal', 'Created', 'app.created', 'created new app: '+app.name+' in '+ app.pipeline+' phase: '+app.phase);
200199
}

src/modules/application.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { env } from 'process';
21
import { IApp, IKubectlMetadata, IKubectlApp, IGithubRepository, ICronjob, IPodSize} from '../types';
32
import { IAddon } from './addons';
43

src/modules/kubectl.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ export class Kubectl {
162162

163163
let namespace = app.pipeline+'-'+app.phase;
164164

165-
let pipeline = await this.getPipeline(app.pipeline)
166-
//appl.spec.gitrepo = pipeline.spec.github.repository //FIXME: this overwrites the gitrepo from the app. Is this required?
167-
appl.spec.deploymentstrategy = pipeline.spec.deploymentstrategy
168-
169165
await this.customObjectsApi.createNamespacedCustomObject(
170166
"application.kubero.dev",
171167
"v1alpha1",

src/routes/apps.ts

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,15 @@ function createApp(req: Request,) : IApp {
4545
envVars: req.body.envvars,
4646
image: {
4747
containerPort: req.body.image.containerport,
48-
repository: selectedBuildpack.repository,
49-
tag: selectedBuildpack.tag || "main",
48+
repository: req.body.image.repository,
49+
tag: req.body.image.tag || "main",
5050
pullPolicy: "Always",
5151
fetch: selectedBuildpack.fetch,
5252
build: selectedBuildpack.build,
5353
run: selectedBuildpack.run,
5454
},
5555
web: req.body.web,
5656
worker: req.body.worker,
57-
/*
58-
web: {
59-
replicaCount: req.body.webreplicas,
60-
autoscaling: {
61-
minReplicas: req.body.webreplicasrange[0] || 1,
62-
maxReplicas: req.body.webreplicasrange[1] || 0,
63-
targetCPUUtilizationPercentage: req.body.webtargetCPUUtilizationPercentage || 80,
64-
targetMemoryUtilizationPercentage: req.body.webtargetMemoryUtilizationPercentage || 0
65-
}
66-
},
67-
worker: {
68-
replicaCount: req.body.workerreplicas,
69-
autoscaling: {
70-
minReplicas: req.body.workerreplicasrange[0] || 0,
71-
maxReplicas: req.body.workerreplicasrange[1] || 0,
72-
targetCPUUtilizationPercentage: req.body.workertargetCPUUtilizationPercentage || 80,
73-
targetMemoryUtilizationPercentage: req.body.workertargetMemoryUtilizationPercentage || 0
74-
}
75-
},
76-
*/
7757
cronjobs: req.body.cronjobs,
7858
addons: req.body.addons,
7959
resources: req.body.podsize.resources,

0 commit comments

Comments
 (0)