@@ -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 */
5352export 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