Moving KubernetesObjectsProvider interface to kubernetes-node to avoid a cyclic dependency

Signed-off-by: Andres Mauricio Gomez P <andmagom@outlook.com>
This commit is contained in:
Andres Mauricio Gomez P
2023-09-25 12:07:19 -05:00
committed by blam
parent 99c1ef9c26
commit 6b044e8840
14 changed files with 138 additions and 78 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { createExtensionPoint } from '@backstage/backend-plugin-api';
import { KubernetesObjectsProvider } from '@backstage/plugin-kubernetes-backend';
import { KubernetesObjectsProvider } from '@backstage/plugin-kubernetes-node';
/**
* The interface for {@link kubernetesObjectsProviderExtensionPoint}.
+2
View File
@@ -33,3 +33,5 @@ export {
kubernetesObjectsProviderExtensionPoint,
type KubernetesObjectsProviderExtensionPoint,
} from './extensions';
export * from './types';
@@ -0,0 +1,17 @@
/*
* Copyright 2023 The Backstage Authors
*
* 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.
*/
export * from './types';
@@ -0,0 +1,53 @@
/*
* Copyright 2023 The Backstage Authors
*
* 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.
*/
import { Entity } from '@backstage/catalog-model';
import {
CustomResourceMatcher,
KubernetesRequestAuth,
ObjectsByEntityResponse,
} from '@backstage/plugin-kubernetes-common';
/**
*
* @public
*/
export interface KubernetesObjectsProvider {
getKubernetesObjectsByEntity(
kubernetesObjectsByEntity: KubernetesObjectsByEntity,
): Promise<ObjectsByEntityResponse>;
getCustomResourcesByEntity(
customResourcesByEntity: CustomResourcesByEntity,
): Promise<ObjectsByEntityResponse>;
}
/**
*
* @public
*/
export interface KubernetesObjectsByEntity {
entity: Entity;
auth: KubernetesRequestAuth;
}
/**
*
* @public
*/
export interface CustomResourcesByEntity extends KubernetesObjectsByEntity {
customResources: CustomResourceMatcher[];
}