Skip to content

Commit bf79f87

Browse files
authored
Merge pull request #236 from kubero-dev/feature/make-appstorage-writable
Feature / Make app storage writable
2 parents f3ecdab + bba3eaa commit bf79f87

File tree

6 files changed

+169
-63
lines changed

6 files changed

+169
-63
lines changed

client/src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ export default {
230230
.get("/api/banner")
231231
.then((result) => {
232232
this.banner = result.data;
233-
this.app.name = "oooo"
234233
})
235234
.catch((err) => {
236235
console.log(err);

client/src/components/apps/addons.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export default {
221221
value: storageClass.name
222222
});
223223
}
224-
console.log(this.availableStorageClasses);
224+
//console.log(this.availableStorageClasses);
225225
})
226226
.catch(error => {
227227
console.log(error);
@@ -237,7 +237,7 @@ export default {
237237
}
238238
},
239239
editAddon(addon){
240-
console.log(addon);
240+
//console.log(addon);
241241
this.mode = 'edit';
242242
243243
// search in available addons for the selected addon
@@ -249,7 +249,7 @@ export default {
249249
}
250250
251251
// set the formfields to the values from the yaml
252-
console.log(this.selectedAddon.formfields);
252+
//console.log(this.selectedAddon.formfields);
253253
Object.entries(this.selectedAddon.formfields).forEach(([field, value]) => {
254254
const fieldvalue = get(addon.resourceDefinitions, field, value.default)
255255
//console.log(field, value, fieldvalue);
@@ -276,7 +276,7 @@ export default {
276276
});
277277
},
278278
addonChange(event) {
279-
console.log(event);
279+
//console.log(event);
280280
this.selectedAddon = event;
281281
},
282282
submitForm() {
@@ -309,7 +309,7 @@ export default {
309309
resourceDefinitions: this.selectedAddon.resourceDefinitions,
310310
};
311311
312-
console.log(addon);
312+
//console.log(addon);
313313
314314
if (this.mode === 'create') {
315315
this.addAddon(addon);

client/src/components/apps/new.vue

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -339,17 +339,25 @@
339339
<v-expansion-panel-header class="text-uppercase text-caption-2 font-weight-medium secondary">Security</v-expansion-panel-header>
340340
<v-expansion-panel-content class="secondary">
341341

342-
<v-row>
342+
<v-row v-if="deploymentstrategy == 'git'">
343343
<v-col
344344
cols="12"
345345
md="6"
346346
>
347347
<v-switch
348-
v-model="security.vulnerabilityScans"
349-
label="Enable Trivy vulnerabfility scans"
348+
v-model="buildpack.run.readOnlyAppStorage"
349+
label="Read only app volume"
350350
color="primary"
351351
></v-switch>
352352
</v-col>
353+
<v-col
354+
cols="12"
355+
md="6"
356+
>
357+
</v-col>
358+
</v-row>
359+
360+
<v-row>
353361
<v-col
354362
cols="12"
355363
md="6"
@@ -360,6 +368,16 @@
360368
color="primary"
361369
></v-switch>
362370
</v-col>
371+
<v-col
372+
cols="12"
373+
md="6"
374+
>
375+
<v-switch
376+
v-model="security.vulnerabilityScans"
377+
label="Enable Trivy vulnerabfility scans"
378+
color="primary"
379+
></v-switch>
380+
</v-col>
363381
</v-row>
364382

365383
<v-row>
@@ -1029,6 +1047,7 @@ export default {
10291047
},
10301048
image: {
10311049
run: {
1050+
readOnlyAppStorage: true,
10321051
command: '',
10331052
securityContext: {
10341053
readOnlyRootFilesystem: true,
@@ -1305,6 +1324,11 @@ export default {
13051324
if (this.cronjobs.length > 0) {
13061325
this.panel.push(4)
13071326
}
1327+
1328+
// Backward compability older v1.11.1
1329+
if (this.buildpack.run && this.buildpack.run.readOnlyAppStorage === undefined) {
1330+
this.buildpack.run.readOnlyAppStorage = true;
1331+
}
13081332
});
13091333
},
13101334
changeName(name) {
@@ -1344,6 +1368,11 @@ export default {
13441368
*/
13451369
}
13461370
1371+
// Backward compability older v1.11.1
1372+
if (this.buildpack.run && this.buildpack.run.readOnlyAppStorage === undefined) {
1373+
this.buildpack.run.readOnlyAppStorage = true;
1374+
}
1375+
13471376
});
13481377
},
13491378
loadStorageClasses() {
@@ -1472,6 +1501,11 @@ export default {
14721501
this.addons= response.data.spec.addons || [];
14731502
this.security.vulnerabilityScans = response.data.spec.vulnerabilityscan.enabled;
14741503
this.ingress = response.data.spec.ingress || {};
1504+
1505+
// Backward compability older v1.11.1
1506+
if (this.buildpack.run && this.buildpack.run.readOnlyAppStorage === undefined) {
1507+
this.buildpack.run.readOnlyAppStorage = true;
1508+
}
14751509
});
14761510
}
14771511
},
@@ -1580,34 +1614,7 @@ export default {
15801614
security: this.security,
15811615
ingress: this.ingress,
15821616
}
1583-
/*
1584-
if (this.security.vulnerabilityScans) {
1585-
postdata.vulnerabilityscan = {
1586-
enabled: true,
1587-
image: {
1588-
repository: "aquasec/trivy",
1589-
tag: "latest",
1590-
},
1591-
}
1592-
} else {
1593-
postdata.vulnerabilityscan = {
1594-
enabled: false,
1595-
}
1596-
}
1597-
*/
15981617
1599-
/*
1600-
postdata.image.run.securityContext = {
1601-
readOnlyRootFilesystem: this.security.readOnlyRootFilesystem,
1602-
runAsNonRoot: this.security.runAsNonRoot,
1603-
runAsUser: parseInt(this.security.runAsUser),
1604-
runAsGroup: parseInt(this.security.runAsGroup),
1605-
capabilities: {
1606-
add: this.security.capabilities.add,
1607-
drop: this.security.capabilities.drop,
1608-
},
1609-
}
1610-
*/
16111618
axios.put(`/api/pipelines/${this.pipeline}/${this.phase}/${this.app}`, postdata
16121619
// eslint-disable-next-line no-unused-vars
16131620
).then(response => {

0 commit comments

Comments
 (0)