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 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(
|
||||
input.logs,
|
||||
await this.applyK8sManifest(createPostgresSecretManifest({
|
||||
@@ -1329,6 +1330,13 @@ export class AppsService {
|
||||
name,
|
||||
})),
|
||||
);
|
||||
|
||||
if (statefulSetExists) {
|
||||
input.logs.push(`[skip] statefulset/${name} already exists`);
|
||||
return;
|
||||
}
|
||||
|
||||
input.logs.push(`[create] statefulset/${name}`);
|
||||
appendOutput(
|
||||
input.logs,
|
||||
await this.applyK8sManifest(createPostgresStatefulSetManifest({
|
||||
|
||||
Reference in New Issue
Block a user