Skip to content

Commit

Permalink
Merge pull request #307 from kubero-dev/release/v2.1.0
Browse files Browse the repository at this point in the history
Release/v2.1.0
  • Loading branch information
mms-gianni authored Mar 24, 2024
2 parents 87cde41 + 7da1d22 commit 91cbc25
Show file tree
Hide file tree
Showing 34 changed files with 2,839 additions and 401 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ example-*.json
.dockerdata

secrets.yaml
config.yaml

db
22 changes: 22 additions & 0 deletions client/src/components/apps/appstats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,28 @@
</tbody>
</v-table>
</div>
<div class="mb-5 mt-10">
<h3>Service Acccount Annotations</h3>
<v-table density="compact" style="background:rgb(var(--v-theme-background))">
<thead>
<tr>
<th class="text-left">
Name
</th>
<th class="text-left">
Value
</th>
</tr>
</thead>
<tbody>
<tr
v-for="saAnnotation in appData.spec.saAnnotations" :key="saAnnotation.name">
<td>{{ saAnnotation.name }}</td>
<td>{{ saAnnotation.value }}</td>
</tr>
</tbody>
</v-table>
</div>
<div class="mb-5" v-if="appData.spec?.extraVolumes?.length > 0">
<h3>Volumes</h3>
<!--{{ appData.spec.extraVolumes }}-->
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/apps/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,22 @@ export default defineComponent({
tab: null,
breadcrumbItems: [
{
text: 'DASHBOARD',
title: 'dashboard.-',
disabled: false,
to: { name: 'Pipelines', params: {}}
},
{
text: 'PIPELINE:'+this.pipeline,
title: 'Pipeline.'+this.pipeline,
disabled: false,
to: { name: 'Pipeline Apps', params: { pipeline: this.pipeline }}
},
{
text: 'PHASE:'+this.phase,
title: 'Phase.'+this.phase,
disabled: true,
href: `/pipeline/${this.pipeline}/${this.phase}/${this.app}/detail`,
},
{
text: 'APP:'+this.app,
title: 'App-'+this.app,
disabled: true,
href: `/pipeline/${this.pipeline}/${this.phase}/${this.app}/detail`,
}
Expand Down
154 changes: 137 additions & 17 deletions client/src/components/apps/form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
</v-expansion-panel>

<!-- SECURITY -->
<v-expansion-panel bg-color="rgb(var(--v-theme-cardBackground))" :style="advanced ? 'display: block;' : 'display: none;'">
<v-expansion-panel bg-color="rgb(var(--v-theme-on-surface-variant))" :style="advanced ? 'display: block;' : 'display: none;'">
<v-expansion-panel-title class="text-uppercase text-caption-2 font-weight-medium" color="secondary">Security</v-expansion-panel-title>
<v-expansion-panel-text color="secondary">

Expand Down Expand Up @@ -481,7 +481,7 @@


<!-- NETWORKING -->
<v-expansion-panel bg-color="rgb(var(--v-theme-cardBackground))" :style="advanced ? 'display: block;' : 'display: none;'">
<v-expansion-panel bg-color="rgb(var(--v-theme-on-surface-variant))" :style="advanced ? 'display: block;' : 'display: none;'">
<v-expansion-panel-title class="text-uppercase text-caption-2 font-weight-medium" color="secondary">Networking</v-expansion-panel-title>
<v-expansion-panel-text color="secondary">

Expand Down Expand Up @@ -534,7 +534,7 @@


<!-- CORS -->
<v-expansion-panel bg-color="rgb(var(--v-theme-cardBackground))" :style="advanced ? 'display: block;' : 'display: none;'">
<v-expansion-panel bg-color="rgb(var(--v-theme-on-surface-variant))" :style="advanced ? 'display: block;' : 'display: none;'">
<v-expansion-panel-title class="text-uppercase text-caption-2 font-weight-medium" color="secondary">Cors</v-expansion-panel-title>
<v-expansion-panel-text color="secondary">

Expand Down Expand Up @@ -624,6 +624,65 @@
</v-expansion-panel-text>
</v-expansion-panel>

<!-- SERVICEACCOUNT ANNOTATIONS -->
<v-expansion-panel bg-color="rgb(var(--v-theme-on-surface-variant))" :style="advanced ? 'display: block;' : 'display: none;'">
<v-expansion-panel-title class="text-uppercase text-caption-2 font-weight-medium" color="secondary">ServiceAcccount Annotations</v-expansion-panel-title>
<v-expansion-panel-text color="secondary">
<v-row v-for="(annotation, index) in sAAnnotations" :key="index">
<v-col
cols="12"
md="5"
>
<v-text-field
v-model="annotation.annotation"
label="annotation"
:counter="120"
></v-text-field>
</v-col>
<v-col
cols="12"
md="6"
>
<v-text-field
v-model="annotation.value"
label="value"
></v-text-field>
</v-col>
<v-col
cols="12"
md="1"
>
<v-btn
elevation="2"
icon
small
@click="removeSAAnnotationLine(annotation.annotation)"
>
<v-icon dark >
mdi-minus
</v-icon>
</v-btn>
</v-col>
</v-row>
<v-row>
<v-col
cols="12"
>
<v-btn
elevation="2"
icon
small
@click="addSAAnnotationLine()"
>
<v-icon dark >
mdi-plus
</v-icon>
</v-btn>
</v-col>
</v-row>
</v-expansion-panel-text>
</v-expansion-panel>

<!-- ENVIRONMENT VARS -->
<v-expansion-panel bg-color="rgb(var(--v-theme-cardBackground))">
<v-expansion-panel-title class="text-uppercase text-caption-2 font-weight-medium" color="cardBackground">Environment Variables</v-expansion-panel-title>
Expand Down Expand Up @@ -1016,7 +1075,7 @@ import { defineComponent } from 'vue'
import { useKuberoStore } from '../../stores/kubero'
import { mapState } from 'pinia'
import Breadcrumbs from "../breadcrumbs.vue";
import { remove } from "lodash";
type App = {
name: string,
Expand Down Expand Up @@ -1084,6 +1143,10 @@ type Ingress = {
}[],
}
type ServiceAccount = {
annotations: any,
}
type Buildpack = {
name?: string,
run: BuildpackStepConfig,
Expand Down Expand Up @@ -1131,6 +1194,11 @@ type EnvVar = {
value: string,
}
type SAAnnotations = {
annotation: string,
value: string,
}
export default defineComponent({
props: {
pipeline: {
Expand All @@ -1144,28 +1212,29 @@ export default defineComponent({
app: {
type: String,
default: "new"
}
},
},
data () {
return {
breadcrumbItems: [
{
text: 'DASHBOARD',
title: 'dashboard.-',
disabled: false,
to: { name: 'Pipelines', params: {}}
},
{
text: 'PIPELINE:'+this.pipeline,
title: 'Pipeline.'+this.pipeline,
text: this.pipeline,
disabled: false,
to: { name: 'Pipeline Apps', params: { pipeline: this.pipeline }}
},
{
text: 'PHASE:'+this.phase,
title: 'Phase.'+this.phase,
disabled: false,
to: this.getAppBreadcrumbLink(),
},
{
text: 'APP:'+this.app,
title: 'App.'+this.app,
disabled: false,
to: this.getAppBreadcrumbLink(),
}
Expand Down Expand Up @@ -1295,6 +1364,9 @@ export default defineComponent({
envvars: [
//{ name: '', value: '' },
] as EnvVar[],
sAAnnotations: [
//{ annotation: '', value: '' },
] as SAAnnotations[],
containerPort: 8080,
podsize: '',
podsizes: [
Expand Down Expand Up @@ -1363,6 +1435,9 @@ export default defineComponent({
drop: [],
}
},
serviceAccount: {
annotations: {} as any,
} as ServiceAccount,
ingress: {
annotations: {
'nginx.ingress.kubernetes.io/whitelist-source-range': '',
Expand Down Expand Up @@ -1524,6 +1599,7 @@ export default defineComponent({
this.docker.tag = response.data.image.tag;
this.envvars = response.data.envVars;
this.sAAnnotations = Object.entries(response.data.serviceAccount.annotations).map(([key, value]) => ({annotation: key, value: value as string}));
this.extraVolumes = response.data.extraVolumes;
this.cronjobs = response.data.cronjobs;
this.addons = response.data.addons;
Expand All @@ -1539,13 +1615,16 @@ export default defineComponent({
// Open Panel if there is some data to show
if (this.envvars.length > 0) {
this.panel.push(1)
this.panel.push(5)
}
if (Object.keys(this.sAAnnotations).length > 0) {
this.panel.push(4)
}
if (this.extraVolumes.length > 0) {
this.panel.push(3)
this.panel.push(7)
}
if (this.cronjobs.length > 0) {
this.panel.push(4)
this.panel.push(8)
}
// Backward compatibility older v1.11.1
Expand Down Expand Up @@ -1617,9 +1696,21 @@ export default defineComponent({
const gitprovider = this.pipelineData.git.provider;
axios.get('/api/repo/'+gitprovider+"/"+gitrepoB64+"/branches/list").then(response => {
if (response.data.length === 0) {
return;
}
for (let i = 0; i < response.data.length; i++) {
this.branchesList.push(response.data[i]);
}
// set default branch based on te repository's default branch
let defaultBranch = this.pipelineData.git.repository.default_branch;
if (this.branchesList.includes(defaultBranch)) {
this.branch = defaultBranch;
} else {
this.branch = this.branchesList[0];
}
});
},
Expand Down Expand Up @@ -1684,13 +1775,16 @@ export default defineComponent({
// Open Panel if there is some data to show
if (response.data.spec.envVars.length > 0) {
this.panel.push(1)
this.panel.push(5)
}
if (Object.entries(response.data.spec.serviceAccount.annotations).length > 0) {
this.panel.push(4)
}
if (response.data.spec.extraVolumes.length > 0) {
this.panel.push(3)
this.panel.push(7)
}
if (response.data.spec.cronjobs.length > 0) {
this.panel.push(4)
this.panel.push(8)
}
this.security = response.data.spec.image.run.securityContext || {};
Expand All @@ -1712,6 +1806,8 @@ export default defineComponent({
this.autodeploy = response.data.spec.autodeploy;
this.domain = response.data.spec.domain;
this.envvars = response.data.spec.envVars;
this.serviceAccount = response.data.spec.serviceAccount;
this.sAAnnotations = Object.entries(response.data.spec.serviceAccount.annotations).map(([key, value]) => ({annotation: key, value: value as string}));
this.extraVolumes = response.data.spec.extraVolumes;
this.containerPort = response.data.spec.image.containerPort;
this.podsize = response.data.spec.podsize;
Expand Down Expand Up @@ -1814,6 +1910,13 @@ export default defineComponent({
domain: this.domain,
ssl: this.ssl,
envvars: this.envvars,
// loop through serviceaccount annotations and convert to object
serviceAccount: {
annotations: this.sAAnnotations.reduce((acc, cur) => {
acc[cur.annotation] = cur.value;
return acc;
}, {} as any),
},
podsize: this.podsize,
autoscale: this.autoscale,
web: {
Expand Down Expand Up @@ -1905,6 +2008,12 @@ export default defineComponent({
domain: this.domain.toLowerCase(),
ssl: this.ssl,
envvars: this.envvars,
serviceAccount: {
annotations: this.sAAnnotations.reduce((acc, cur) => {
acc[cur.annotation] = cur.value;
return acc;
}, {} as any),
},
podsize: this.podsize,
autoscale: this.autoscale,
web: {
Expand Down Expand Up @@ -1978,6 +2087,19 @@ export default defineComponent({
}
}
},
addSAAnnotationLine() {
this.sAAnnotations.push({
annotation: '',
value: '',
});
},
removeSAAnnotationLine(index: string) {
for (let i = 0; i < this.sAAnnotations.length; i++) {
if (this.sAAnnotations[i].annotation === index) {
this.sAAnnotations.splice(i, 1);
}
}
},
handleFileInput() {
for (let i = 0; i < this.envFile.length; i++) {
const file = this.envFile[i];
Expand All @@ -1992,8 +2114,6 @@ export default defineComponent({
// clear file input
this.envFile = [];
},
parseEnvFile(text: any) {
const lines = text.split('\n');
for (const line of lines) {
Expand Down
Loading

0 comments on commit 91cbc25

Please sign in to comment.