fix: allow coreflow deployment input reads
This commit is contained in:
@@ -246,6 +246,54 @@ tap.test('should push service config updates to connected coreflows', async (too
|
||||
}
|
||||
});
|
||||
|
||||
tap.test('should allow cluster coreflows to read deployment inputs', async () => {
|
||||
const cluster = await testClient.cluster.createCluster('Registry Coreflow Read Test Cluster');
|
||||
const persistedCluster = await testCloudly.clusterManager.getConfigBy_ConfigID(cluster.id);
|
||||
const clusterUser = await testCloudly.authManager.CUser.getInstance({
|
||||
id: persistedCluster.data.userId,
|
||||
});
|
||||
const clusterToken = clusterUser.data.tokens?.[0]?.token;
|
||||
expect(clusterToken).toBeTruthy();
|
||||
|
||||
const image = await testClient.image.createImage({
|
||||
name: 'Registry Coreflow Read Test Image',
|
||||
description: 'Image used by the coreflow read test',
|
||||
});
|
||||
const secretBundle = await testClient.secretbundle.createSecretBundle({
|
||||
name: 'Registry Coreflow Read Test Secret Bundle',
|
||||
description: 'Secret bundle used by the coreflow read test',
|
||||
type: 'service',
|
||||
includedSecretGroupIds: [],
|
||||
includedTags: [],
|
||||
imageClaims: [],
|
||||
authorizations: [
|
||||
{
|
||||
environment: 'production',
|
||||
secretAccessKey: 'registry-coreflow-read-test',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const coreflowClient = new cloudlyApiClient.CloudlyApiClient({
|
||||
registerAs: 'coreflow',
|
||||
cloudlyUrl: `http://${helpers.testCloudlyConfig.publicUrl}:${helpers.testCloudlyConfig.publicPort}`,
|
||||
});
|
||||
|
||||
try {
|
||||
await coreflowClient.start();
|
||||
await coreflowClient.getIdentityByToken(clusterToken!, {
|
||||
statefullIdentity: true,
|
||||
tagConnection: true,
|
||||
});
|
||||
const clusterImage = await coreflowClient.image.getImageById(image.id);
|
||||
const clusterSecretBundle = await coreflowClient.secretbundle.getSecretBundleById(secretBundle.id);
|
||||
expect(clusterImage.id).toEqual(image.id);
|
||||
expect(clusterSecretBundle.id).toEqual(secretBundle.id);
|
||||
} finally {
|
||||
await coreflowClient.stop();
|
||||
}
|
||||
});
|
||||
|
||||
tap.test('should expose platform desired state', async () => {
|
||||
const capabilitiesResponse = await testClient.platform.getPlatformCapabilities();
|
||||
expect(capabilitiesResponse.capabilities.find((capability) => capability.id === 'database')).toBeTruthy();
|
||||
|
||||
Reference in New Issue
Block a user