Skip to content

Commit

Permalink
Delete conflit dspa secret when creating pipeline server
Browse files Browse the repository at this point in the history
  • Loading branch information
DaoDaoNoCode committed Jul 16, 2024
1 parent 279d95d commit b6730d4
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createSecret, assembleSecret } from '~/api';
import { createSecret, assembleSecret, deleteSecret } from '~/api';
import { DSPipelineKind } from '~/k8sTypes';
import { AwsKeys, PIPELINE_AWS_FIELDS } from '~/pages/projects/dataConnections/const';
import { dataEntryToRecord } from '~/utilities/dataEntryToRecord';
Expand Down Expand Up @@ -81,7 +81,13 @@ const createSecrets = (config: PipelineServerConfigType, projectName: string) =>
new Promise<SecretsResponse>((resolve, reject) => {
Promise.all([
createDatabaseSecret(config.database, projectName, true),
createObjectStorageSecret(config.objectStorage, projectName, true),
createObjectStorageSecret(config.objectStorage, projectName, true).catch((e) => {
if (e.statusObject.code === 409 && e.statusObject.reason === 'AlreadyExists') {
deleteSecret(projectName, DSPA_SECRET_NAME);
} else {
throw e;
}
}),
])
.then(() => {
Promise.all([
Expand Down

0 comments on commit b6730d4

Please sign in to comment.