skip existing database statefulset on runtime apply
This commit is contained in:
@@ -1312,8 +1312,9 @@ export class AppsService {
|
|||||||
}) {
|
}) {
|
||||||
const name = sanitizeK8sName(input.componentName);
|
const name = sanitizeK8sName(input.componentName);
|
||||||
const values = getDatabaseValues(input.appKey, input.variables);
|
const values = getDatabaseValues(input.appKey, input.variables);
|
||||||
|
const statefulSetExists = await this.statefulSetExists(input.namespace, name);
|
||||||
|
|
||||||
input.logs.push(`[database] ${name} service/statefulset`);
|
input.logs.push(`[database] ${name} secret/service`);
|
||||||
appendOutput(
|
appendOutput(
|
||||||
input.logs,
|
input.logs,
|
||||||
await this.applyK8sManifest(createPostgresSecretManifest({
|
await this.applyK8sManifest(createPostgresSecretManifest({
|
||||||
@@ -1329,6 +1330,13 @@ export class AppsService {
|
|||||||
name,
|
name,
|
||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (statefulSetExists) {
|
||||||
|
input.logs.push(`[skip] statefulset/${name} already exists`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
input.logs.push(`[create] statefulset/${name}`);
|
||||||
appendOutput(
|
appendOutput(
|
||||||
input.logs,
|
input.logs,
|
||||||
await this.applyK8sManifest(createPostgresStatefulSetManifest({
|
await this.applyK8sManifest(createPostgresStatefulSetManifest({
|
||||||
|
|||||||
Reference in New Issue
Block a user