Skip to content

Commit 3b285cc

Browse files
wip
1 parent 388d38f commit 3b285cc

File tree

3 files changed

+11
-25
lines changed

3 files changed

+11
-25
lines changed

.github/workflows/end2end.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,12 @@ jobs:
491491
with:
492492
git_access_token: ${{ steps.app-token.outputs.token }}
493493
zenko_name: ${{ env.ZENKO_NAME }}
494+
- name: Setup test environment
495+
env:
496+
SETUP_IMAGE: ${{ needs.build-setup-image.outputs.image }}
497+
GIT_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
498+
run: ./setup-tests.sh --kubeconfig ~/.kube/config
499+
working-directory: ./tests/@setup
494500
- name: Prepare PRA environment
495501
run: bash prepare-pra.sh
496502
working-directory: ./.github/scripts/end2end
@@ -499,14 +505,6 @@ jobs:
499505
env:
500506
ZENKO_MONGODB_DATABASE: pradb
501507
working-directory: ./.github/scripts/end2end
502-
- name: Setup PRA test environment
503-
env:
504-
ZENKO_NAME: "${{ env.ZENKO_NAME }}-pra"
505-
MANAGEMENT_INSTANCE: "${{ env.ZENKO_NAME }}"
506-
SETUP_IMAGE: ${{ needs.build-setup-image.outputs.image }}
507-
GIT_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
508-
run: ./setup-tests.sh --kubeconfig ~/.kube/config
509-
working-directory: ./tests/@setup
510508
- name: Add Keycloak pra user and assign StorageManager role
511509
shell: bash
512510
run: bash keycloak-helper.sh add-user default ${{ env.ZENKO_NAME }}-pra

tests/@setup/setup-tests.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ spec:
145145
args:
146146
$(for arg in "${setup_args[@]}"; do echo " - \"${arg}\""; done)
147147
env:
148-
- name: MANAGEMENT_INSTANCE
149-
value: "${MANAGEMENT_INSTANCE}"
150148
- name: ENABLE_RING_TESTS
151149
value: "${ENABLE_RING_TESTS}"
152150
- name: KAFKA_IMAGE

tests/@setup/src/utils/management.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,10 @@ export interface AccountResponse {
4646

4747
/**
4848
* Get management endpoint
49-
* For PRA instances, the Management API endpoint is shared (only deployed on primary instance)
5049
* @param subdomain - Subdomain
5150
* @returns Management endpoint
5251
*/
5352
export async function getManagementEndpoint(subdomain: string = 'zenko.local'): Promise<string> {
54-
const managementInstance = process.env.MANAGEMENT_INSTANCE;
55-
if (managementInstance) {
56-
logger.info(`Using Management API from primary instance: ${managementInstance} (target: ${process.env.ZENKO_NAME})`);
57-
}
5853
return `http://management.${subdomain}`;
5954
}
6055

@@ -122,29 +117,24 @@ export async function getManagementToken(subdomain: string = 'zenko.local'): Pro
122117
}
123118

124119
/**
125-
* Get instance ID from the target Zenko CR
126-
* NOTE: This returns the TARGET instance's ID (e.g., PRA), which is used when creating locations
127-
* @param zenkoName - Optional Zenko CR name to override ZENKO_NAME env var
120+
* Get instance ID from the Zenko CR
128121
* @returns Instance ID
129122
*/
130-
export async function getInstanceId(zenkoName?: string): Promise<string | null> {
123+
export async function getInstanceId(): Promise<string | null> {
131124
if (!KubernetesHelper.customObject) {
132125
throw new Error('KubernetesHelper not initialized');
133126
}
134-
const targetZenkoName = zenkoName || process.env.ZENKO_NAME || 'end2end';
135-
logger.debug(`Getting instanceId from Zenko CR: ${targetZenkoName}`);
127+
const zenkoName = process.env.ZENKO_NAME || 'end2end';
136128

137129
const instanceId = await KubernetesHelper.customObject.getNamespacedCustomObject({
138130
group: 'zenko.io',
139131
version: 'v1alpha2',
140132
namespace: process.env.NAMESPACE || 'default',
141133
plural: 'zenkos',
142-
name: targetZenkoName,
134+
name: zenkoName,
143135
});
144136

145-
const id = instanceId.status?.instanceID || process.env.INSTANCE_ID;
146-
logger.info(`Using instanceId: ${id} from Zenko CR: ${targetZenkoName}`);
147-
return id;
137+
return instanceId.status?.instanceID || process.env.INSTANCE_ID;
148138
}
149139

150140
/**

0 commit comments

Comments
 (0)