diff --git a/electron/app/createWindow.ts b/electron/app/createWindow.ts index 120d996bfb..9509741123 100644 --- a/electron/app/createWindow.ts +++ b/electron/app/createWindow.ts @@ -198,7 +198,7 @@ export const createWindow = (givenPath?: string) => { await checkNewVersion(dispatch, true); }, NEW_VERSION_CHECK_INTERVAL); - initKubeconfig(dispatch, userHomeDir); + initKubeconfig(dispatch, userHomeDir, utilsElectronStore.get('appConfig.kubeConfig')); dispatch({type: 'main/setAppRehydrating', payload: false}); const missingDependencies = checkMissingDependencies(APP_DEPENDENCIES); diff --git a/src/App.tsx b/src/App.tsx index 7bf5c432d2..ef74d0b68f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,11 +13,11 @@ import semver from 'semver'; import {TelemetryDocumentationUrl} from '@constants/tooltips'; +import {setCreateProject, setDeleteProject, setLoadingProject, setOpenProject} from '@redux/appConfig'; import {toggleForm} from '@redux/forms'; import {setIsGitInstalled} from '@redux/git'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; import {setAlert} from '@redux/reducers/alert'; -import {setCreateProject, setDeleteProject, setLoadingProject, setOpenProject} from '@redux/reducers/appConfig'; import {clearNotifications, closePreviewConfigurationEditor} from '@redux/reducers/main'; import {closeFolderExplorer, closeReleaseNotesDrawer, openWelcomePopup, toggleNotifications} from '@redux/reducers/ui'; import {isInClusterModeSelector} from '@redux/selectors'; diff --git a/src/components/molecules/CommandPreview/CommandLabel.tsx b/src/components/molecules/CommandPreview/CommandLabel.tsx index c6ae1aaf2f..d5b14b9b6c 100644 --- a/src/components/molecules/CommandPreview/CommandLabel.tsx +++ b/src/components/molecules/CommandPreview/CommandLabel.tsx @@ -4,9 +4,9 @@ import {Modal} from 'antd'; import {cloneDeep} from 'lodash'; +import {updateProjectConfig} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; import {setAlert} from '@redux/reducers/alert'; -import {updateProjectConfig} from '@redux/reducers/appConfig'; import {openSaveEditCommandModal} from '@redux/reducers/ui'; import {AlertEnum} from '@shared/models/alert'; diff --git a/src/components/molecules/MonacoPlaceholder/MonacoPlaceholder.tsx b/src/components/molecules/MonacoPlaceholder/MonacoPlaceholder.tsx index 894e30a0db..c20ac8f154 100644 --- a/src/components/molecules/MonacoPlaceholder/MonacoPlaceholder.tsx +++ b/src/components/molecules/MonacoPlaceholder/MonacoPlaceholder.tsx @@ -1,5 +1,5 @@ +import {toggleEditorPlaceholderVisiblity} from '@redux/appConfig'; import {useAppDispatch} from '@redux/hooks'; -import {toggleEditorPlaceholderVisiblity} from '@redux/reducers/appConfig'; import MonacoPlaceholderImage from '@assets/MonacoPlaceholderImage.svg'; diff --git a/src/components/molecules/NotificationMarkdown/TelemetryButtons.tsx b/src/components/molecules/NotificationMarkdown/TelemetryButtons.tsx index 0602fa4a6c..d4685067be 100644 --- a/src/components/molecules/NotificationMarkdown/TelemetryButtons.tsx +++ b/src/components/molecules/NotificationMarkdown/TelemetryButtons.tsx @@ -1,7 +1,7 @@ import {notification} from 'antd'; +import {toggleErrorReporting, toggleEventTracking, updateTelemetry} from '@redux/appConfig'; import {setAlert} from '@redux/reducers/alert'; -import {toggleErrorReporting, toggleEventTracking, updateTelemetry} from '@redux/reducers/appConfig'; import {setActiveSettingsPanel, toggleNotifications} from '@redux/reducers/ui'; import store from '@redux/store'; diff --git a/src/components/molecules_new/ProjectCard/ProjectCard.tsx b/src/components/molecules_new/ProjectCard/ProjectCard.tsx index 81f51325bc..8eef09d9fe 100644 --- a/src/components/molecules_new/ProjectCard/ProjectCard.tsx +++ b/src/components/molecules_new/ProjectCard/ProjectCard.tsx @@ -6,8 +6,8 @@ import {DeleteOutlined, ExclamationCircleOutlined, PushpinFilled, PushpinOutline import {TOOLTIP_DELAY} from '@constants/constants'; +import {setDeleteProject, setOpenProject, toggleProjectPin} from '@redux/appConfig'; import {useAppDispatch} from '@redux/hooks'; -import {setDeleteProject, setOpenProject, toggleProjectPin} from '@redux/reducers/appConfig'; import {toggleStartProjectPane} from '@redux/reducers/ui'; import {getRelativeDate} from '@utils/index'; diff --git a/src/components/molecules_new/ProjectsList/ProjectsList.tsx b/src/components/molecules_new/ProjectsList/ProjectsList.tsx index 8d86e1274f..b1e5157df8 100644 --- a/src/components/molecules_new/ProjectsList/ProjectsList.tsx +++ b/src/components/molecules_new/ProjectsList/ProjectsList.tsx @@ -6,8 +6,8 @@ import {PlusOutlined} from '@ant-design/icons'; import {orderBy, size} from 'lodash'; +import {sortProjects} from '@redux/appConfig'; import {useAppSelector} from '@redux/hooks'; -import {sortProjects} from '@redux/reducers/appConfig'; import {ProjectCard} from '@components/molecules_new'; diff --git a/src/components/organisms/GitCloneModal/GitCloneModal.tsx b/src/components/organisms/GitCloneModal/GitCloneModal.tsx index 61f9fc1766..020983ab14 100644 --- a/src/components/organisms/GitCloneModal/GitCloneModal.tsx +++ b/src/components/organisms/GitCloneModal/GitCloneModal.tsx @@ -8,9 +8,9 @@ import {sep} from 'path'; import {DEFAULT_GIT_REPO_PLACEHOLDER, VALID_URL_REGEX} from '@constants/constants'; +import {setCreateProject} from '@redux/appConfig'; import {closeGitCloneModal} from '@redux/git'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; -import {setCreateProject} from '@redux/reducers/appConfig'; import {FileExplorer} from '@atoms'; diff --git a/src/components/organisms/PageHeader/ClusterSelectionTable.tsx b/src/components/organisms/PageHeader/ClusterSelectionTable.tsx index 22b99760c2..35293df7fc 100644 --- a/src/components/organisms/PageHeader/ClusterSelectionTable.tsx +++ b/src/components/organisms/PageHeader/ClusterSelectionTable.tsx @@ -7,9 +7,9 @@ import {v4 as uuid} from 'uuid'; import {CLUSTER_AVAILABLE_COLORS, TOOLTIP_DELAY} from '@constants/constants'; +import {setCurrentContext, setKubeConfigContextColor, updateClusterNamespaces} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; import {setAlert} from '@redux/reducers/alert'; -import {setCurrentContext, setKubeConfigContextColor, updateClusterNamespaces} from '@redux/reducers/appConfig'; import {kubeConfigContextsSelector} from '@redux/selectors'; import {FilePatternList} from '@atoms'; diff --git a/src/components/organisms/PageHeader/K8sVersionSelection.tsx b/src/components/organisms/PageHeader/K8sVersionSelection.tsx index c861bac380..19f984f000 100644 --- a/src/components/organisms/PageHeader/K8sVersionSelection.tsx +++ b/src/components/organisms/PageHeader/K8sVersionSelection.tsx @@ -1,7 +1,7 @@ import {Dropdown, Typography} from 'antd'; +import {updateK8sVersion, updateProjectK8sVersion} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; -import {updateK8sVersion, updateProjectK8sVersion} from '@redux/reducers/appConfig'; import {currentConfigSelector} from '@redux/selectors'; import {downloadK8sSchema} from '@redux/thunks/downloadK8sSchema'; import {setConfigK8sSchemaVersion} from '@redux/validation/validation.slice'; diff --git a/src/components/organisms/PageHeader/PageHeader.tsx b/src/components/organisms/PageHeader/PageHeader.tsx index 27a8ecf720..b7f8ef0b73 100644 --- a/src/components/organisms/PageHeader/PageHeader.tsx +++ b/src/components/organisms/PageHeader/PageHeader.tsx @@ -12,9 +12,9 @@ import newGithubIssueUrl from 'new-github-issue-url'; import {TOOLTIP_DELAY} from '@constants/constants'; import {InitializeGitTooltip, InstallGitTooltip, NotificationsTooltip} from '@constants/tooltips'; +import {updateProjectsGitRepo} from '@redux/appConfig'; import {setCurrentBranch, setRepo} from '@redux/git'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; -import {updateProjectsGitRepo} from '@redux/reducers/appConfig'; import {setAutosavingError} from '@redux/reducers/main'; import {setIsInQuickClusterMode, setLayoutSize, toggleNotifications, toggleStartProjectPane} from '@redux/reducers/ui'; import {isInClusterModeSelector, isInPreviewModeSelectorNew, kubeConfigContextColorSelector} from '@redux/selectors'; diff --git a/src/components/organisms/PreviewConfigurationEditor/PreviewConfigurationEditor.tsx b/src/components/organisms/PreviewConfigurationEditor/PreviewConfigurationEditor.tsx index 22217e04c6..8332791390 100644 --- a/src/components/organisms/PreviewConfigurationEditor/PreviewConfigurationEditor.tsx +++ b/src/components/organisms/PreviewConfigurationEditor/PreviewConfigurationEditor.tsx @@ -8,8 +8,8 @@ import {v4 as uuidv4} from 'uuid'; import {HELM_INSTALL_OPTIONS_DOCS_URL, HELM_TEMPLATE_OPTIONS_DOCS_URL} from '@constants/constants'; import {helmInstallOptions, helmTemplateOptions} from '@constants/helmOptions'; +import {updateProjectConfig} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; -import {updateProjectConfig} from '@redux/reducers/appConfig'; import {closePreviewConfigurationEditor} from '@redux/reducers/main'; import {startPreview} from '@redux/services/preview'; diff --git a/src/components/organisms/SaveEditCommandModal/SaveEditCommandModal.tsx b/src/components/organisms/SaveEditCommandModal/SaveEditCommandModal.tsx index d5d3bf7c5b..00e3a091b7 100644 --- a/src/components/organisms/SaveEditCommandModal/SaveEditCommandModal.tsx +++ b/src/components/organisms/SaveEditCommandModal/SaveEditCommandModal.tsx @@ -6,9 +6,9 @@ import {useForm} from 'antd/lib/form/Form'; import {cloneDeep} from 'lodash'; import {v4 as uuid} from 'uuid'; +import {updateProjectConfig} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; import {setAlert} from '@redux/reducers/alert'; -import {updateProjectConfig} from '@redux/reducers/appConfig'; import {closeSaveEditCommandModal} from '@redux/reducers/ui'; import {ROOT_FILE_ENTRY} from '@shared/constants/fileEntry'; diff --git a/src/components/organisms/UpdateNotice/UpdateNotice.tsx b/src/components/organisms/UpdateNotice/UpdateNotice.tsx index 3091146006..09267fb816 100644 --- a/src/components/organisms/UpdateNotice/UpdateNotice.tsx +++ b/src/components/organisms/UpdateNotice/UpdateNotice.tsx @@ -6,8 +6,8 @@ import {Button} from 'antd'; import {CloseOutlined} from '@ant-design/icons'; +import {updateNewVersion} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; -import {updateNewVersion} from '@redux/reducers/appConfig'; import NewUpdate from '@assets/NewUpdate.svg'; diff --git a/src/components/organisms_new/CreateProjectModal/CreateProjectModal.tsx b/src/components/organisms_new/CreateProjectModal/CreateProjectModal.tsx index 4a4376ebc2..851f9ef9e6 100644 --- a/src/components/organisms_new/CreateProjectModal/CreateProjectModal.tsx +++ b/src/components/organisms_new/CreateProjectModal/CreateProjectModal.tsx @@ -7,8 +7,8 @@ import {existsSync} from 'fs'; import {includes, isEmpty} from 'lodash'; import path from 'path'; +import {setCreateProject} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; -import {setCreateProject} from '@redux/reducers/appConfig'; import {closeCreateProjectModal, openTemplateExplorer, setTemplateProjectCreate} from '@redux/reducers/ui'; import {FileExplorer} from '@atoms'; diff --git a/src/components/organisms_new/ExplorerPane/FilePane/FileSystemTree/TreeNode/hooks.tsx b/src/components/organisms_new/ExplorerPane/FilePane/FileSystemTree/TreeNode/hooks.tsx index e01590292d..ae3754db50 100644 --- a/src/components/organisms_new/ExplorerPane/FilePane/FileSystemTree/TreeNode/hooks.tsx +++ b/src/components/organisms_new/ExplorerPane/FilePane/FileSystemTree/TreeNode/hooks.tsx @@ -7,9 +7,9 @@ import {ExclamationCircleOutlined} from '@ant-design/icons'; import {basename, dirname, join} from 'path'; +import {updateProjectConfig} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; import {setAlert} from '@redux/reducers/alert'; -import {updateProjectConfig} from '@redux/reducers/appConfig'; import {openCreateFileFolderModal, openNewResourceWizard, openRenameEntityModal} from '@redux/reducers/ui'; import {scanExcludesSelector} from '@redux/selectors'; import {useResourceMetaMapRef} from '@redux/selectors/resourceMapSelectors'; diff --git a/src/components/organisms_new/SettingsPane/CurrentProjectSettings/CurrentProjectSettings.tsx b/src/components/organisms_new/SettingsPane/CurrentProjectSettings/CurrentProjectSettings.tsx index d8e8b29de5..02dcbf529b 100644 --- a/src/components/organisms_new/SettingsPane/CurrentProjectSettings/CurrentProjectSettings.tsx +++ b/src/components/organisms_new/SettingsPane/CurrentProjectSettings/CurrentProjectSettings.tsx @@ -1,5 +1,5 @@ +import {changeCurrentProjectName, updateProjectConfig} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; -import {changeCurrentProjectName, updateProjectConfig} from '@redux/reducers/appConfig'; import {currentConfigSelector} from '@redux/selectors'; import {Project, ProjectConfig} from '@shared/models/config'; diff --git a/src/components/organisms_new/SettingsPane/DefaultProjectSettings/DefaultProjectSettings.tsx b/src/components/organisms_new/SettingsPane/DefaultProjectSettings/DefaultProjectSettings.tsx index 88ad663649..3ad7a2a16a 100644 --- a/src/components/organisms_new/SettingsPane/DefaultProjectSettings/DefaultProjectSettings.tsx +++ b/src/components/organisms_new/SettingsPane/DefaultProjectSettings/DefaultProjectSettings.tsx @@ -1,6 +1,5 @@ import _ from 'lodash'; -import {useAppDispatch, useAppSelector} from '@redux/hooks'; import { setKubeConfig, updateApplicationSettings, @@ -8,7 +7,8 @@ import { updateFolderReadsMaxDepth, updateK8sVersion, updateScanExcludes, -} from '@redux/reducers/appConfig'; +} from '@redux/appConfig'; +import {useAppDispatch, useAppSelector} from '@redux/hooks'; import {PREDEFINED_K8S_VERSION} from '@shared/constants/k8s'; import {ProjectConfig} from '@shared/models/config'; diff --git a/src/components/organisms_new/SettingsPane/GlobalSettings/GlobalSettings.tsx b/src/components/organisms_new/SettingsPane/GlobalSettings/GlobalSettings.tsx index cf4f8af4c1..fe55d3b5de 100644 --- a/src/components/organisms_new/SettingsPane/GlobalSettings/GlobalSettings.tsx +++ b/src/components/organisms_new/SettingsPane/GlobalSettings/GlobalSettings.tsx @@ -9,7 +9,6 @@ import _ from 'lodash'; import {DEFAULT_KUBECONFIG_DEBOUNCE, TOOLTIP_DELAY} from '@constants/constants'; import {AutoLoadLastProjectTooltip, TelemetryDocumentationUrl} from '@constants/tooltips'; -import {useAppDispatch, useAppSelector} from '@redux/hooks'; import { changeProjectsRootPath, toggleErrorReporting, @@ -17,7 +16,8 @@ import { updateClusterSelectorVisibilty, updateFileExplorerSortOrder, updateLoadLastProjectOnStartup, -} from '@redux/reducers/appConfig'; +} from '@redux/appConfig'; +import {useAppDispatch, useAppSelector} from '@redux/hooks'; import {FileExplorer} from '@components/atoms'; diff --git a/src/components/organisms_new/StartPage/StartPageHeader.tsx b/src/components/organisms_new/StartPage/StartPageHeader.tsx index a7b110fbcf..295a08505d 100644 --- a/src/components/organisms_new/StartPage/StartPageHeader.tsx +++ b/src/components/organisms_new/StartPage/StartPageHeader.tsx @@ -9,8 +9,8 @@ import _ from 'lodash'; import {TOOLTIP_DELAY} from '@constants/constants'; import {NotificationsTooltip} from '@constants/tooltips'; +import {setOpenProject} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; -import {setOpenProject} from '@redux/reducers/appConfig'; import {setShowStartPageLearn, toggleNotifications} from '@redux/reducers/ui'; import {WelcomePopupContent} from '@molecules'; diff --git a/src/components/organisms_new/TemplateExplorer/TemplateForm/TemplateForm.tsx b/src/components/organisms_new/TemplateExplorer/TemplateForm/TemplateForm.tsx index 9a53ca1da0..031adc9399 100644 --- a/src/components/organisms_new/TemplateExplorer/TemplateForm/TemplateForm.tsx +++ b/src/components/organisms_new/TemplateExplorer/TemplateForm/TemplateForm.tsx @@ -4,8 +4,8 @@ import {Skeleton} from 'antd'; import {Primitive} from 'type-fest'; +import {setCreateProject} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; -import {setCreateProject} from '@redux/reducers/appConfig'; import {kubeConfigPathSelector} from '@redux/selectors'; import {createTransientResourcesFromVanillaTemplate} from '@redux/services/templates'; import {previewReferencedHelmChart} from '@redux/thunks/previewReferencedHelmChart'; diff --git a/src/hooks/fileTreeHooks/useProcessing.tsx b/src/hooks/fileTreeHooks/useProcessing.tsx index 1f46a79d18..bad12a11cb 100644 --- a/src/hooks/fileTreeHooks/useProcessing.tsx +++ b/src/hooks/fileTreeHooks/useProcessing.tsx @@ -4,8 +4,8 @@ import {Modal} from 'antd'; import {ExclamationCircleOutlined} from '@ant-design/icons'; +import {updateProjectConfig} from '@redux/appConfig'; import {useAppDispatch, useAppSelector} from '@redux/hooks'; -import {updateProjectConfig} from '@redux/reducers/appConfig'; import {scanExcludesSelector} from '@redux/selectors'; import {useSelectorWithRef} from '@utils/hooks'; diff --git a/src/redux/appConfig/appConfig.listeners.ts b/src/redux/appConfig/appConfig.listeners.ts new file mode 100644 index 0000000000..84b1f8f308 --- /dev/null +++ b/src/redux/appConfig/appConfig.listeners.ts @@ -0,0 +1,31 @@ +import * as k8s from '@kubernetes/client-node'; + +import {AppListenerFn} from '@redux/listeners/base'; + +import {KubeConfigContext} from '@shared/models/config'; + +import {setKubeConfig} from './appConfig.slice'; + +const loadKubeConfigListener: AppListenerFn = listen => { + listen({ + actionCreator: setKubeConfig, + async effect(_action, {dispatch, delay, signal, cancelActiveListeners}) { + // Cancel any other listeners that are listening to the same action + cancelActiveListeners(); + const configPath = _action.payload.path; + if (!configPath) { + return; + } + + try { + const kc = new k8s.KubeConfig(); + kc.loadFromFile(configPath); + dispatch(setKubeConfig({isPathValid: true, contexts: kc.contexts as KubeConfigContext[]})); + } catch (error) { + dispatch(setKubeConfig({isPathValid: false, contexts: []})); + } + }, + }); +}; + +export const appConfigListeners = [loadKubeConfigListener]; diff --git a/src/redux/reducers/appConfig.ts b/src/redux/appConfig/appConfig.slice.ts similarity index 99% rename from src/redux/reducers/appConfig.ts rename to src/redux/appConfig/appConfig.slice.ts index e76e546a7f..05a12767da 100644 --- a/src/redux/reducers/appConfig.ts +++ b/src/redux/appConfig/appConfig.slice.ts @@ -52,7 +52,7 @@ import electronStore from '@shared/utils/electronStore'; import {createKubeClient, getKubeAccess} from '@shared/utils/kubeclient'; import initialState from '../initialState'; -import {setLeftBottomMenuSelection, setLeftMenuSelection, toggleStartProjectPane} from './ui'; +import {setLeftBottomMenuSelection, setLeftMenuSelection, toggleStartProjectPane} from '../reducers/ui'; export const setCreateProject = createAsyncThunk('config/setCreateProject', async (project: Project, thunkAPI: any) => { const isGitRepo = await promiseFromIpcRenderer( @@ -234,6 +234,8 @@ export const configSlice = createSlice({ }, setKubeConfig: (state: Draft, action: PayloadAction) => { state.kubeConfig = {...state.kubeConfig, ...action.payload}; + electronStore.set('appConfig.kubeConfig', state.kubeConfig.path); + new KubeConfigManager().initializeKubeConfig(state.kubeConfig.path as string, state.kubeConfig.currentContext); }, createProject: (state: Draft, action: PayloadAction) => { diff --git a/src/redux/appConfig/index.ts b/src/redux/appConfig/index.ts new file mode 100644 index 0000000000..96a973a9cf --- /dev/null +++ b/src/redux/appConfig/index.ts @@ -0,0 +1 @@ +export * from './appConfig.slice'; diff --git a/src/redux/services/gitFolderMonitor.ts b/src/redux/services/gitFolderMonitor.ts index 689568273d..b754529843 100644 --- a/src/redux/services/gitFolderMonitor.ts +++ b/src/redux/services/gitFolderMonitor.ts @@ -1,8 +1,8 @@ import {FSWatcher, watch} from 'chokidar'; import {sep} from 'path'; +import {updateProjectsGitRepo} from '@redux/appConfig'; import {setBranchCommits, setChangedFiles, setCommits, setRepo} from '@redux/git'; -import {updateProjectsGitRepo} from '@redux/reducers/appConfig'; import {promiseFromIpcRenderer} from '@utils/promises'; diff --git a/src/redux/services/monitorKubeConfig.ts b/src/redux/services/monitorKubeConfig.ts index 090787d10a..6b45842b0f 100644 --- a/src/redux/services/monitorKubeConfig.ts +++ b/src/redux/services/monitorKubeConfig.ts @@ -6,13 +6,13 @@ import fs from 'fs'; import log from 'loglevel'; import {AnyAction} from 'redux'; -import {setAlert} from '@redux/reducers/alert'; import { addNamespaceToContext, removeNamespaceFromContext, setAccessLoading, updateProjectKubeConfig, -} from '@redux/reducers/appConfig'; +} from '@redux/appConfig'; +import {setAlert} from '@redux/reducers/alert'; import {AlertEnum} from '@shared/models/alert'; import {KubeConfig, KubeConfigContext} from '@shared/models/config'; diff --git a/src/redux/services/projectConfig.ts b/src/redux/services/projectConfig.ts index ca9f3d0cff..e0e8f3e3b2 100644 --- a/src/redux/services/projectConfig.ts +++ b/src/redux/services/projectConfig.ts @@ -5,7 +5,7 @@ import {sep} from 'path'; import {AnyAction} from 'redux'; import invariant from 'tiny-invariant'; -import {updateProjectConfig} from '@redux/reducers/appConfig'; +import {updateProjectConfig} from '@redux/appConfig'; import {K8S_VERSIONS, PREDEFINED_K8S_VERSION} from '@shared/constants/k8s'; import {AppConfig, ProjectConfig} from '@shared/models/config'; diff --git a/src/redux/store.ts b/src/redux/store.ts index b2d6c74f9b..db6cbbf5c8 100644 --- a/src/redux/store.ts +++ b/src/redux/store.ts @@ -4,6 +4,8 @@ import {createLogger} from 'redux-logger'; import {sectionBlueprintMiddleware} from '@src/navsections/sectionBlueprintMiddleware'; +import {configSlice, crdsPathChangedListener, k8sVersionSchemaListener} from './appConfig'; +import {appConfigListeners} from './appConfig/appConfig.listeners'; import * as compareListeners from './compare/listeners'; import {compareSlice} from './compare/slice'; import {dashboardSlice} from './dashboard'; @@ -11,7 +13,6 @@ import {formSlice} from './forms'; import {gitSlice} from './git'; import {combineListeners, listenerMiddleware} from './listeners/base'; import {alertSlice} from './reducers/alert'; -import {configSlice, crdsPathChangedListener, k8sVersionSchemaListener} from './reducers/appConfig'; import {extensionSlice} from './reducers/extension'; import {mainSlice} from './reducers/main'; import {imageListParserListener} from './reducers/main/mainListeners'; @@ -43,6 +44,7 @@ combineListeners([ k8sVersionSchemaListener, crdsPathChangedListener, ...validationListeners, + ...appConfigListeners, imageListParserListener, ]); diff --git a/src/redux/thunks/cluster/startClusterConnection.ts b/src/redux/thunks/cluster/startClusterConnection.ts index 8d589bcbf0..07763a07a6 100644 --- a/src/redux/thunks/cluster/startClusterConnection.ts +++ b/src/redux/thunks/cluster/startClusterConnection.ts @@ -1,6 +1,6 @@ import {createAsyncThunk} from '@reduxjs/toolkit'; -import {setClusterProxyPort} from '@redux/reducers/appConfig'; +import {setClusterProxyPort} from '@redux/appConfig'; import {disconnectFromCluster} from '@redux/services/clusterResourceWatcher'; import {stopPreview} from '@redux/services/preview'; diff --git a/src/redux/thunks/cluster/stopClusterConnection.ts b/src/redux/thunks/cluster/stopClusterConnection.ts index ec93193136..6ec19264a2 100644 --- a/src/redux/thunks/cluster/stopClusterConnection.ts +++ b/src/redux/thunks/cluster/stopClusterConnection.ts @@ -1,6 +1,6 @@ import {createAsyncThunk} from '@reduxjs/toolkit'; -import {setClusterProxyPort} from '@redux/reducers/appConfig'; +import {setClusterProxyPort} from '@redux/appConfig'; import {disconnectFromCluster} from '@redux/services/clusterResourceWatcher'; import {AppDispatch} from '@shared/models/appDispatch'; diff --git a/src/redux/thunks/previewConfiguration.ts b/src/redux/thunks/previewConfiguration.ts index 93e61f556b..20f5f901d7 100644 --- a/src/redux/thunks/previewConfiguration.ts +++ b/src/redux/thunks/previewConfiguration.ts @@ -2,7 +2,7 @@ import {createAsyncThunk} from '@reduxjs/toolkit'; import {cloneDeep} from 'lodash'; -import {updateProjectConfig} from '@redux/reducers/appConfig'; +import {updateProjectConfig} from '@redux/appConfig'; import {clearSelection, selectFile} from '@redux/reducers/main'; import {AppDispatch} from '@shared/models/appDispatch'; diff --git a/src/redux/validation/validation.listeners.tsx b/src/redux/validation/validation.listeners.tsx index ce4665061a..5def47f493 100644 --- a/src/redux/validation/validation.listeners.tsx +++ b/src/redux/validation/validation.listeners.tsx @@ -6,8 +6,8 @@ import {isAnyOf} from '@reduxjs/toolkit'; import {isEmpty, isEqual} from 'lodash'; +import {updateK8sVersion, updateProjectK8sVersion} from '@redux/appConfig'; import {AppListenerFn} from '@redux/listeners/base'; -import {updateK8sVersion, updateProjectK8sVersion} from '@redux/reducers/appConfig'; import {addMultipleResources, addResource, clearPreview, clearPreviewAndSelectionHistory} from '@redux/reducers/main'; import {setIsInQuickClusterMode} from '@redux/reducers/ui'; import {currentConfigSelector} from '@redux/selectors';