From 8c216e9c990484f72473f395910e682d9553447b Mon Sep 17 00:00:00 2001 From: Ole Lensmar Date: Tue, 5 Dec 2023 08:41:45 +0100 Subject: [PATCH] fix: initial attempt --- src/redux/thunks/updateFileEntry.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/redux/thunks/updateFileEntry.ts b/src/redux/thunks/updateFileEntry.ts index 89997cc2ce..ac23ee1efc 100644 --- a/src/redux/thunks/updateFileEntry.ts +++ b/src/redux/thunks/updateFileEntry.ts @@ -10,6 +10,7 @@ import {HELM_CHART_ENTRY_FILE} from '@constants/constants'; import {UpdateFileEntryPayload} from '@redux/reducers/main'; import {getLocalResourceMetasForPath} from '@redux/services/fileEntry'; import {reprocessHelm} from '@redux/services/helm'; +import {isKustomizationFile} from '@redux/services/kustomize'; import {deleteResource, extractK8sResources, splitK8sResource} from '@redux/services/resource'; import {getFileStats, getFileTimestamp} from '@utils/files'; @@ -101,6 +102,18 @@ export const updateFileEntry = createAsyncThunk< }, }); }); + + // did we just replace a kustomization being dry-run? -> update the kustomizationId to the new one + // and restart the dry-run + if ( + isKustomizationFile(fileEntry, mainState.resourceMetaMapByStorage.local) && + mainState.preview?.type === 'kustomize' && + mainState.preview.kustomizationId === fileSideEffect.affectedResourceIds[0] + ) { + // mainState.preview.kustomizationId = fileSideEffect.affectedResourceIds[1]; + // thunkAPI.dispatch(stopPreview()); + } + mainState.highlights = newHighlights; } }