Skip to content

Commit

Permalink
Merge pull request #236 from kubero-dev/feature/make-appstorage-writable
Browse files Browse the repository at this point in the history
Feature / Make app storage writable
  • Loading branch information
mms-gianni authored Oct 18, 2023
2 parents f3ecdab + bba3eaa commit bf79f87
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 63 deletions.
1 change: 0 additions & 1 deletion client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ export default {
.get("/api/banner")
.then((result) => {
this.banner = result.data;
this.app.name = "oooo"
})
.catch((err) => {
console.log(err);
Expand Down
10 changes: 5 additions & 5 deletions client/src/components/apps/addons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export default {
value: storageClass.name
});
}
console.log(this.availableStorageClasses);
//console.log(this.availableStorageClasses);
})
.catch(error => {
console.log(error);
Expand All @@ -237,7 +237,7 @@ export default {
}
},
editAddon(addon){
console.log(addon);
//console.log(addon);
this.mode = 'edit';
// search in available addons for the selected addon
Expand All @@ -249,7 +249,7 @@ export default {
}
// set the formfields to the values from the yaml
console.log(this.selectedAddon.formfields);
//console.log(this.selectedAddon.formfields);
Object.entries(this.selectedAddon.formfields).forEach(([field, value]) => {
const fieldvalue = get(addon.resourceDefinitions, field, value.default)
//console.log(field, value, fieldvalue);
Expand All @@ -276,7 +276,7 @@ export default {
});
},
addonChange(event) {
console.log(event);
//console.log(event);
this.selectedAddon = event;
},
submitForm() {
Expand Down Expand Up @@ -309,7 +309,7 @@ export default {
resourceDefinitions: this.selectedAddon.resourceDefinitions,
};
console.log(addon);
//console.log(addon);
if (this.mode === 'create') {
this.addAddon(addon);
Expand Down
67 changes: 37 additions & 30 deletions client/src/components/apps/new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -339,17 +339,25 @@
<v-expansion-panel-header class="text-uppercase text-caption-2 font-weight-medium secondary">Security</v-expansion-panel-header>
<v-expansion-panel-content class="secondary">

<v-row>
<v-row v-if="deploymentstrategy == 'git'">
<v-col
cols="12"
md="6"
>
<v-switch
v-model="security.vulnerabilityScans"
label="Enable Trivy vulnerabfility scans"
v-model="buildpack.run.readOnlyAppStorage"
label="Read only app volume"
color="primary"
></v-switch>
</v-col>
<v-col
cols="12"
md="6"
>
</v-col>
</v-row>

<v-row>
<v-col
cols="12"
md="6"
Expand All @@ -360,6 +368,16 @@
color="primary"
></v-switch>
</v-col>
<v-col
cols="12"
md="6"
>
<v-switch
v-model="security.vulnerabilityScans"
label="Enable Trivy vulnerabfility scans"
color="primary"
></v-switch>
</v-col>
</v-row>

<v-row>
Expand Down Expand Up @@ -1029,6 +1047,7 @@ export default {
},
image: {
run: {
readOnlyAppStorage: true,
command: '',
securityContext: {
readOnlyRootFilesystem: true,
Expand Down Expand Up @@ -1305,6 +1324,11 @@ export default {
if (this.cronjobs.length > 0) {
this.panel.push(4)
}
// Backward compability older v1.11.1
if (this.buildpack.run && this.buildpack.run.readOnlyAppStorage === undefined) {
this.buildpack.run.readOnlyAppStorage = true;
}
});
},
changeName(name) {
Expand Down Expand Up @@ -1344,6 +1368,11 @@ export default {
*/
}
// Backward compability older v1.11.1
if (this.buildpack.run && this.buildpack.run.readOnlyAppStorage === undefined) {
this.buildpack.run.readOnlyAppStorage = true;
}
});
},
loadStorageClasses() {
Expand Down Expand Up @@ -1472,6 +1501,11 @@ export default {
this.addons= response.data.spec.addons || [];
this.security.vulnerabilityScans = response.data.spec.vulnerabilityscan.enabled;
this.ingress = response.data.spec.ingress || {};
// Backward compability older v1.11.1
if (this.buildpack.run && this.buildpack.run.readOnlyAppStorage === undefined) {
this.buildpack.run.readOnlyAppStorage = true;
}
});
}
},
Expand Down Expand Up @@ -1580,34 +1614,7 @@ export default {
security: this.security,
ingress: this.ingress,
}
/*
if (this.security.vulnerabilityScans) {
postdata.vulnerabilityscan = {
enabled: true,
image: {
repository: "aquasec/trivy",
tag: "latest",
},
}
} else {
postdata.vulnerabilityscan = {
enabled: false,
}
}
*/
/*
postdata.image.run.securityContext = {
readOnlyRootFilesystem: this.security.readOnlyRootFilesystem,
runAsNonRoot: this.security.runAsNonRoot,
runAsUser: parseInt(this.security.runAsUser),
runAsGroup: parseInt(this.security.runAsGroup),
capabilities: {
add: this.security.capabilities.add,
drop: this.security.capabilities.drop,
},
}
*/
axios.put(`/api/pipelines/${this.pipeline}/${this.phase}/${this.app}`, postdata
// eslint-disable-next-line no-unused-vars
).then(response => {
Expand Down
Loading

0 comments on commit bf79f87

Please sign in to comment.