Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into build/test
Browse files Browse the repository at this point in the history
  • Loading branch information
devcatalin committed Oct 30, 2023
2 parents 1afe686 + 122e2b3 commit a511c3c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "monokle",
"version": "2.4.2",
"author": "Kubeshop",
"description": "UI for managing k8s manifests",
"description": "Desktop IDE for working with Kubernetes Clusters and YAML configurations",
"homepage": "./",
"main": "build/electron/main.js",
"contributors": [
Expand Down Expand Up @@ -283,8 +283,7 @@
"maintainer": "Kubeshop",
"vendor": "Kubeshop",
"executableName": "Monokle",
"synopsis": "Your kubernetes best friend!",
"description": "A free, open-source tool, to help you navigate kubernetes development. By Kubeshop."
"synopsis": "Desktop IDE for Kubernetes"
},
"appImage": {
"artifactName": "${productName}-${os}-${version}-${arch}.${ext}"
Expand Down
3 changes: 1 addition & 2 deletions src/components/organisms/Dashboard/TableView/TableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ const TableView = ({
columns={columns}
rowKey="id"
scroll={{
y: tableScrollHeight || height - 212 - (bottomSelection === 'terminal' ? terminalHeight : 0),
y: tableScrollHeight || height - 270 - (bottomSelection === 'terminal' ? terminalHeight : 0),
}}
rowClassName={(record: ResourceMeta | any) => (record.id === selectedResourceId ? 'selected' : '')}
pagination={false}
sticky
onRow={(record: ResourceMeta | any) => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ export const GlobalSettings = () => {
[_setShouldAppendServerPath]
);

const [disableClusterValidation, _setDisableClusterValidation] = useState<boolean>(
electronStore.get('appConfig.settings.disableClusterValidation') ?? false
);

const setDisableClusterValidation = useCallback(
(value: boolean) => {
_setDisableClusterValidation(value);
electronStore.set('appConfig.settings.disableClusterValidation', value);
},
[_setDisableClusterValidation]
);

const [isOverridingBinaryPaths, _setIsOverridingBinaryPaths] = useState<boolean>(
Boolean(electronStore.get('appConfig.binaryPaths')) ?? false
);
Expand Down Expand Up @@ -192,6 +204,9 @@ export const GlobalSettings = () => {
<Checkbox checked={shouldAppendServerPath} onChange={e => setShouldAppendServerPath(e.target.checked)}>
Append Server Path to Kubectl Proxy
</Checkbox>
<Checkbox checked={disableClusterValidation} onChange={e => setDisableClusterValidation(e.target.checked)}>
Disable validation of cluster resources
</Checkbox>
</S.Div>

<S.Div>
Expand Down
19 changes: 19 additions & 0 deletions src/redux/validation/validation.listeners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {startExecutionTimer} from '@utils/executionTime';
import {doesSchemaExist} from '@utils/index';

import {ResourceIdentifier, ResourceStorage} from '@shared/models/k8sResource';
import {electronStore} from '@shared/utils';
import {isDefined} from '@shared/utils/filter';
import {isEqual} from '@shared/utils/isEqual';
import {trackEvent} from '@shared/utils/telemetry';
Expand Down Expand Up @@ -88,6 +89,10 @@ const loadListener: AppListenerFn = listen => {
async effect(_action, {dispatch, delay, signal, cancelActiveListeners}) {
trackEvent('validation/load_config', {actionType: _action.type});
if (isAnyOf(setIsInQuickClusterMode)(_action)) {
const disableClusterValidation = electronStore.get('appConfig.settings.disableClusterValidation') ?? false;
if (disableClusterValidation) {
return;
}
if (!_action.payload) {
return;
}
Expand Down Expand Up @@ -127,6 +132,20 @@ const validateListener: AppListenerFn = listen => {
restartPreview.rejected
),
async effect(_action, {dispatch, getState, cancelActiveListeners, signal, delay}) {
const disableClusterValidation = electronStore.get('appConfig.settings.disableClusterValidation') ?? false;

if (disableClusterValidation) {
if (
isAnyOf(
loadClusterResources.fulfilled,
reloadClusterResources.fulfilled,
deleteMultipleClusterResources
)(_action)
) {
return;
}
}

const stopExecutionTimer = startExecutionTimer();
cancelActiveListeners();

Expand Down
4 changes: 4 additions & 0 deletions src/shared/constants/electronStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export const electronStoreSchema = {
allowEditInClusterMode: {
type: 'boolean',
},
disableClusterValidation: {
type: 'boolean',
},
},
},
recentFolders: {
Expand Down Expand Up @@ -325,6 +328,7 @@ export const electronStoreDefaults = {
createDefaultObjects: false,
setDefaultPrimitiveValues: true,
allowEditInClusterMode: true,
disableClusterValidation: false,
enableHelmWithKustomize: true,
},
recentFolders: [],
Expand Down

0 comments on commit a511c3c

Please sign in to comment.