Skip to content

Commit c6d4645

Browse files
committed
fix: rebase conflicts
1 parent e7afd2e commit c6d4645

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

packages/k8s/src/hooks/prepare-job.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ export async function prepareJob(
4949

5050
let container: k8s.V1Container | undefined = undefined
5151
if (args.container?.image) {
52-
<<<<<<< HEAD
53-
=======
5452
core.info(`Using image '${args.container.image}' for job image`)
55-
>>>>>>> a3d6427 (feat: label job pods with context info)
5653
container = createContainerSpec(
5754
args.container,
5855
JOB_CONTAINER_NAME,

packages/k8s/src/k8s/index.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ function getArcContextLabels(): { [key: string]: string } {
109109
)
110110
}
111111

112-
export async function createPod(
112+
export async function createJobPod(
113+
name: string,
113114
jobContainer?: k8s.V1Container,
114115
services?: k8s.V1Container[],
115116
registry?: Registry,
@@ -248,20 +249,11 @@ export async function createContainerStepPod(
248249

249250
const instanceLabel = new RunnerInstanceLabel()
250251
const arcLabels = getArcContextLabels()
251-
appPod.metadata.labels = arcLabels
252-
job.spec.template.spec = new k8s.V1PodSpec()
253-
job.spec.template.metadata = new k8s.V1ObjectMeta()
254-
job.spec.template.metadata.labels = arcLabels
255-
job.spec.template.metadata.annotations = {}
256-
job.spec.template.spec.containers = [container]
257-
job.spec.template.spec.restartPolicy = 'Never'
258-
259-
const nodeName = await getCurrentNodeName()
260-
if (useKubeScheduler()) {
261-
job.spec.template.spec.affinity = await getPodAffinity(nodeName)
262-
} else {
263-
job.spec.template.spec.nodeName = nodeName
252+
appPod.metadata.labels = {
253+
[instanceLabel.key]: instanceLabel.value,
254+
...arcLabels
264255
}
256+
265257
appPod.metadata.annotations = {}
266258

267259
appPod.spec = new k8s.V1PodSpec()

0 commit comments

Comments
 (0)