Merge pull request #16257 from backstage/freben/locationspec

🧹  do not import deprecated symbols
This commit is contained in:
Fredrik Adelöw
2023-02-10 14:28:13 +01:00
committed by GitHub
7 changed files with 16 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-aws': patch
---
Update to import `LocationSpec` from the correct package.
@@ -11,7 +11,7 @@ import { Config } from '@backstage/config';
import { Credentials } from 'aws-sdk';
import { EntityProvider } from '@backstage/plugin-catalog-backend';
import { EntityProviderConnection } from '@backstage/plugin-catalog-backend';
import { LocationSpec } from '@backstage/plugin-catalog-backend';
import { LocationSpec } from '@backstage/plugin-catalog-common';
import { Logger } from 'winston';
import { PluginTaskScheduler } from '@backstage/backend-tasks';
import { TaskRunner } from '@backstage/backend-tasks';
@@ -20,10 +20,12 @@ import aws from 'aws-sdk';
describe('AwsEKSClusterProcessor', () => {
AWSMock.setSDKInstance(aws);
describe('readLocation', () => {
const processor = new (AwsEKSClusterProcessor as any)({});
const location = { type: 'aws-eks', target: '957140518395/us-west-2' };
const emit = jest.fn();
it('generates cluster correctly', async () => {
const clusters: aws.EKS.Types.ListClustersResponse = {
clusters: ['backstage-test'],
@@ -40,11 +42,12 @@ describe('AwsEKSClusterProcessor', () => {
},
},
};
AWSMock.mock('EKS', 'listClusters', clusters);
AWSMock.mock('EKS', 'listClusters', clusters);
AWSMock.mock('EKS', 'describeCluster', cluster);
await processor.readLocation(location, false, emit);
expect(emit).toHaveBeenCalledWith({
type: 'entity',
location,
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
CatalogProcessor,
CatalogProcessorEmit,
LocationSpec,
} from '@backstage/plugin-catalog-backend';
import { LocationSpec } from '@backstage/plugin-catalog-common';
import {
ANNOTATION_KUBERNETES_API_SERVER,
ANNOTATION_KUBERNETES_API_SERVER_CA,
ANNOTATION_KUBERNETES_AUTH_PROVIDER,
} from '@backstage/catalog-model';
} from '@backstage/plugin-kubernetes-common';
import { Credentials, EKS } from 'aws-sdk';
import { AWSCredentialFactory } from '../types';
@@ -19,9 +19,9 @@ import { Config } from '@backstage/config';
import {
CatalogProcessor,
CatalogProcessorEmit,
LocationSpec,
processingResult,
} from '@backstage/plugin-catalog-backend';
import { LocationSpec } from '@backstage/plugin-catalog-common';
import AWS, { Credentials, Organizations } from 'aws-sdk';
import { Account, ListAccountsResponse } from 'aws-sdk/clients/organizations';
import { Logger } from 'winston';
@@ -20,9 +20,9 @@ import {
CatalogProcessor,
CatalogProcessorEmit,
CatalogProcessorParser,
LocationSpec,
processingResult,
} from '@backstage/plugin-catalog-backend';
import { LocationSpec } from '@backstage/plugin-catalog-common';
import limiterFactory from 'p-limit';
/**
@@ -20,9 +20,9 @@ import { AwsS3Integration, ScmIntegrations } from '@backstage/integration';
import {
EntityProvider,
EntityProviderConnection,
LocationSpec,
locationSpecToLocationEntity,
} from '@backstage/plugin-catalog-backend';
import { LocationSpec } from '@backstage/plugin-catalog-common';
import { AwsCredentials } from '../credentials/AwsCredentials';
import { readAwsS3Configs } from './config';
import { AwsS3Config } from './types';