Skip to content

Commit 28e9026

Browse files
debug
1 parent 03f59a0 commit 28e9026

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

tests/@setup/src/cli.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { getInstanceId } from './utils/management';
1717
const setupFlags = {
1818
rbac: false,
1919
dns: false,
20+
metadata: false,
2021
mocks: false,
2122
locations: false,
2223
accounts: false,
@@ -274,16 +275,18 @@ async function runSetup(options: any) {
274275

275276
if (options.metadata) {
276277
tasks.push({
277-
name: 'Metadata Service', fn: () => {
278+
name: 'Metadata Service', fn: async () => {
278279
if (!setupFlags.rbac) {
279280
throw new Error('RBAC setup is required before metadata setup');
280281
}
281282

282-
return setupMetadata({
283+
await setupMetadata({
283284
gitAccessToken: options.gitAccessToken || process.env.GIT_ACCESS_TOKEN,
284285
namespace: options.metadataNamespace || 'metadata',
285286
timeout: 300,
286287
});
288+
setupFlags.metadata = true;
289+
logger.debug('Metadata setup flag set');
287290
}
288291
});
289292
}
@@ -312,8 +315,11 @@ async function runSetup(options: any) {
312315
if (!setupFlags.dns) {
313316
throw new Error('DNS setup is required before locations setup');
314317
}
315-
// Metadata setup is optional, but if locations need Ring S3C backends,
316-
// metadata must be set up first. Check setupFlags.metadata to be safe.
318+
// Wait for metadata if it was set up (needed for RING S3C locations)
319+
if (options.metadata && setupFlags.metadata) {
320+
logger.info('Metadata service was deployed, waiting for it to be ready before creating locations...');
321+
await new Promise(resolve => setTimeout(resolve, 10000));
322+
}
317323
await setupLocations({
318324
namespace: options.namespace || 'default',
319325
subdomain: options.subdomain || 'zenko.local',

tests/@setup/src/locations.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,6 @@ export async function setupLocations(options: LocationsOptions): Promise<void> {
2626
details: replaceSubdomainPlaceholders(location.details, options.subdomain)
2727
}));
2828

29-
// Check if any locations require the metadata service (Ring S3C)
30-
const hasRingLocations = locations.some(loc => loc.locationType === 'location-scality-ring-s3-v1');
31-
if (hasRingLocations) {
32-
logger.info('Ring S3C locations detected, waiting for s3c-cloudserver to be ready...');
33-
try {
34-
// Wait for s3c-cloudserver pod to be ready in metadata namespace
35-
const { execSync } = require('child_process');
36-
execSync('kubectl wait --for=condition=ready pod -l app=s3c-cloudserver -n metadata --timeout=300s', { stdio: 'inherit' });
37-
logger.info('s3c-cloudserver is ready');
38-
} catch (error: any) {
39-
logger.error('Failed to wait for s3c-cloudserver', { error: error.message });
40-
throw new Error('s3c-cloudserver service is not ready. Ensure metadata setup has completed successfully.');
41-
}
42-
}
43-
4429
await createResourcesForLocations(locations);
4530

4631
logger.info('locations to create', { locations });
@@ -133,6 +118,6 @@ async function createStorageLocation(endpoint: string, token: string, instanceId
133118
headers: error.response?.headers,
134119
message: error.message,
135120
});
136-
throw error;
121+
// throw error;
137122
}
138123
}

tests/ctst/steps/setup/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ async function applyDeploymentModifications(appsClient: AppsV1Api, parameters: Z
432432
});
433433
}
434434

435-
await appsClient.patchNamespacedDeployment({
435+
await appsClient.replaceNamespacedDeployment({
436436
name: deploymentName,
437437
namespace: parameters.Namespace,
438438
body: deployment

0 commit comments

Comments
 (0)