Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Check code format'
on:
pull_request:
defaults:
run:
working-directory: ./server
jobs:
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # checkout the repo
- name: Install dependencies # install dependencies
run: yarn install --frozen-lockfile
- run: yarn format-check
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"private": true,
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format": "prettier --write \"src/**/*.ts\"",
"format-check": "prettier --check \"src/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
Expand Down
4 changes: 1 addition & 3 deletions server/src/addons/addons.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ export class AddonsService {
// Load all Custom Resource Definitions to get the list of installed operators
this.CRDList = await this.kubectl.getCustomresources();


const kuberoAddonPostgres = new KuberoAddonPostgres(this.CRDList);
this.addonsList.push(kuberoAddonPostgres);

const kuberoAddonRedis = new KuberoAddonRedis(this.CRDList);
this.addonsList.push(kuberoAddonRedis);

const kuberoAddonMysql = new KuberoAddonMysql(this.CRDList);
this.addonsList.push(kuberoAddonMysql);

Expand Down Expand Up @@ -120,7 +119,6 @@ export class AddonsService {

const kuberoRabbitMQ = new KuberoRabbitMQ(this.CRDList);
this.addonsList.push(kuberoRabbitMQ);

}

public async getAddonsList(): Promise<IPlugin[]> {
Expand Down
4 changes: 2 additions & 2 deletions server/src/addons/plugins/clickhouse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Plugin, } from './plugin';
import { IPlugin, IPluginFormFields } from './plugin.interface';
import { Plugin } from './plugin';
import { IPlugin, IPluginFormFields } from './plugin.interface';

// Classname must be same as the CRD's Name
export class ClickHouseInstallation extends Plugin implements IPlugin {
Expand Down
4 changes: 2 additions & 2 deletions server/src/addons/plugins/cloudflare.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Plugin, } from './plugin';
import { IPlugin, IPluginFormFields } from './plugin.interface';
import { Plugin } from './plugin';
import { IPlugin, IPluginFormFields } from './plugin.interface';

// Classname must be same as the CRD's Name
export class Tunnel extends Plugin implements IPlugin {
Expand Down
56 changes: 30 additions & 26 deletions server/src/addons/plugins/cloudnativePG.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Plugin, } from './plugin';
import { IPlugin, IPluginFormFields } from './plugin.interface';

import { Plugin } from './plugin';
import { IPlugin, IPluginFormFields } from './plugin.interface';

// Classname must be same as the CRD's Name
export class Cluster extends Plugin implements IPlugin {
Expand All @@ -9,7 +8,8 @@ export class Cluster extends Plugin implements IPlugin {
public description: string =
'CloudNativePG is the Kubernetes operator that covers the full lifecycle of a highly available PostgreSQL database cluster with a primary/standby architecture, using native streaming replication.';
public icon = '/img/addons/pgsql.svg';
public install: string = 'kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.27/releases/cnpg-1.27.0.yaml';
public install: string =
'kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.27/releases/cnpg-1.27.0.yaml';
public url =
'https://artifacthub.io/packages/olm/community-operators/kubero-operator';
public docs = [
Expand All @@ -35,7 +35,11 @@ export class Cluster extends Plugin implements IPlugin {
'CloudnativePG.spec.image.tag': {
type: 'combobox',
label: 'Version/Tag',
options: ['ghcr.io/cloudnative-pg/postgresql:17-minimal-bookworm', 'ghcr.io/cloudnative-pg/postgresql:16-minimal-bookworm', 'ghcr.io/cloudnative-pg/postgresql:15-minimal-bookworm'], // TODO - load this dynamically
options: [
'ghcr.io/cloudnative-pg/postgresql:17-minimal-bookworm',
'ghcr.io/cloudnative-pg/postgresql:16-minimal-bookworm',
'ghcr.io/cloudnative-pg/postgresql:15-minimal-bookworm',
], // TODO - load this dynamically
name: 'spec.image.tag',
required: true,
default: 'ghcr.io/cloudnative-pg/postgresql:17-minimal-bookworm',
Expand Down Expand Up @@ -104,18 +108,18 @@ export class Cluster extends Plugin implements IPlugin {

public resourceDefinitions: object = {
CloudnativePG: {
apiVersion: "postgresql.cnpg.io/v1",
kind: "Cluster",
apiVersion: 'postgresql.cnpg.io/v1',
kind: 'Cluster',
metadata: {
name: "cluster-example-full"
name: 'cluster-example-full',
},
spec: {
description: "Kubero generated postgresql cluster",
imageName: "ghcr.io/cloudnative-pg/postgresql:17.5",
description: 'Kubero generated postgresql cluster',
imageName: 'ghcr.io/cloudnative-pg/postgresql:17.5',
instances: 3,
startDelay: 300,
stopDelay: 300,
primaryUpdateStrategy: "unsupervised",
primaryUpdateStrategy: 'unsupervised',
/*
postgresql: {
parameters: {
Expand All @@ -135,23 +139,23 @@ export class Cluster extends Plugin implements IPlugin {
*/
bootstrap: {
initdb: {
database: "app",
owner: "app",
database: 'app',
owner: 'app',
secret: {
name: "cluster-app-user"
}
}
name: 'cluster-app-user',
},
},
},
enableSuperuserAccess: true,
superuserSecret: {
name: "cluster-superuser"
name: 'cluster-superuser',
},
storage: {
storageClass: "standard",
size: "1Gi"
storageClass: 'standard',
size: '1Gi',
},
backup: null
}
backup: null,
},
},
superuserSecret: {
apiVersion: 'v1',
Expand All @@ -161,8 +165,8 @@ export class Cluster extends Plugin implements IPlugin {
},
type: 'Opaque',
stringData: {
'username': 'postgres',
'password': 'changeme',
username: 'postgres',
password: 'changeme',
},
},
appUserSecret: {
Expand All @@ -173,11 +177,11 @@ export class Cluster extends Plugin implements IPlugin {
},
type: 'Opaque',
stringData: {
'username': 'app',
'password': 'app',
username: 'app',
password: 'app',
},
},
}
};

protected additionalResourceDefinitions: object = {};

Expand Down
4 changes: 2 additions & 2 deletions server/src/addons/plugins/cockroachDB.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Plugin, } from './plugin';
import { IPlugin, IPluginFormFields } from './plugin.interface';
import { Plugin } from './plugin';
import { IPlugin, IPluginFormFields } from './plugin.interface';

// Classname must be same as the CRD's Name
export class Cockroachdb extends Plugin implements IPlugin {
Expand Down
Loading