Skip to content

Commit

Permalink
remove unnecessary code used to get podIP from allocateSlicer()
Browse files Browse the repository at this point in the history
  • Loading branch information
busma13 committed Dec 10, 2024
1 parent 40a4e01 commit 2fa008e
Showing 1 changed file with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,32 +138,6 @@ export class KubernetesClusterBackendV2 {

this.logger.debug(jobResult, 'k8s slicer job submitted');

if (!jobResult.spec.selector?.matchLabels) {
throw new Error('Required field matchLabels missing from jobResult.spec.selector');
}

let controllerLabel: string;
if (jobResult.spec.selector.matchLabels['controller-uid'] !== undefined) {
/// If running on kubernetes < v1.27.0
controllerLabel = 'controller-uid';
} else {
/// If running on kubernetes v1.27.0 or later
controllerLabel = 'batch.kubernetes.io/controller-uid';
}

const controllerUid = jobResult.spec.selector.matchLabels[controllerLabel];

const pod = await this.k8s.waitForSelectedPod(
`${controllerLabel}=${controllerUid}`,
'pod-status',
undefined,
this.context.sysconfig.teraslice.slicer_timeout
);

if (!pod.status?.podIP) {
const error = new Error('pod.status.podIP must be defined');
return Promise.reject(error);
}
const exServiceName = serviceResult.metadata.name;
const exServiceHostName = `${exServiceName}.${this.k8s.defaultNamespace}`;
this.logger.debug(`Slicer is using host name: ${exServiceHostName}`);
Expand Down

0 comments on commit 2fa008e

Please sign in to comment.