From a383388e542bdb92d47a9ebbf7351bbcc2144168 Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Tue, 29 Dec 2020 11:42:14 +0300 Subject: [PATCH] feat(context-delete): restricted system compute context deletion --- src/ContextManager.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ContextManager.ts b/src/ContextManager.ts index cf0b603..04023f0 100644 --- a/src/ContextManager.ts +++ b/src/ContextManager.ts @@ -422,6 +422,14 @@ export class ContextManager { throw new Error('Invalid context name.') } + if (this.defaultComputeContexts.includes(contextName)) { + throw new Error( + `Deleting default SAS compute contexts is not allowed.\nDefault contexts:${this.defaultComputeContexts.map( + (context, i) => `\n${i + 1}. ${context}` + )}` + ) + } + const headers: any = { 'Content-Type': 'application/json' }