diff --git a/packages/common/src/model/kubernetes-contexts-states.ts b/packages/common/src/model/kubernetes-contexts-states.ts deleted file mode 100644 index af81a1ec..00000000 --- a/packages/common/src/model/kubernetes-contexts-states.ts +++ /dev/null @@ -1,59 +0,0 @@ -/********************************************************************** - * Copyright (C) 2024 Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ***********************************************************************/ - -export const NO_CURRENT_CONTEXT_ERROR = 'no current context'; - -// CheckingState indicates the state of the check for a context -export interface CheckingState { - state: 'waiting' | 'checking' | 'gaveup'; -} - -// A selection of resources, to indicate the 'general' status of a context -type selectedResources = ['pods', 'deployments']; - -// resources managed by podman desktop, excepted the primary ones -// This is where to add new resources when adding new informers -export const secondaryResources = [ - 'services', - 'ingresses', - 'routes', - 'configmaps', - 'secrets', - 'nodes', - 'persistentvolumeclaims', - 'events', - 'cronjobs', - 'jobs', -] as const; - -export type SecondaryResourceName = (typeof secondaryResources)[number]; -export type ResourceName = SelectedResourceName | SecondaryResourceName; - -export type SelectedResourceName = selectedResources[number]; - -export type SelectedResourcesCount = { - [resourceName in SelectedResourceName]: number; -}; - -// information sent: status and count of selected resources -export interface ContextGeneralState { - checking?: CheckingState; - error?: string; - reachable: boolean; - resources: SelectedResourcesCount; -} diff --git a/packages/extension/src/manager/contexts-manager.ts b/packages/extension/src/manager/contexts-manager.ts index b21096db..13d15eaa 100644 --- a/packages/extension/src/manager/contexts-manager.ts +++ b/packages/extension/src/manager/contexts-manager.ts @@ -19,7 +19,6 @@ import type { KubeConfig, KubernetesObject, ObjectCache } from '@kubernetes/client-node'; import type { ContextPermission } from '/@common/model/kubernetes-contexts-permissions.js'; -import type { ContextGeneralState, ResourceName } from '/@common/model/kubernetes-contexts-states.js'; import type { ResourceCount } from '/@common/model/kubernetes-resource-count.js'; import type { KubernetesContextResources } from '/@common/model/kubernetes-resources.js'; import type { KubernetesTroubleshootingInformation } from '/@common/model/kubernetes-troubleshooting.js'; @@ -203,28 +202,6 @@ export class ContextsManager { }); } - getContextsGeneralState(): Map { - return new Map(); - } - - getCurrentContextGeneralState(): ContextGeneralState { - return { - reachable: false, - resources: { - pods: 0, - deployments: 0, - }, - }; - } - - registerGetCurrentContextResources(_resourceName: ResourceName): KubernetesObject[] { - return []; - } - - unregisterGetCurrentContextResources(_resourceName: ResourceName): KubernetesObject[] { - return []; - } - /* dispose all disposable resources created by the instance */ dispose(): void { this.disposeAllHealthChecks();