From 29414dbe81253964c0edfb01fb01839b04900091 Mon Sep 17 00:00:00 2001 From: David Morrison Date: Sat, 28 Oct 2023 15:57:05 -0700 Subject: [PATCH] create pod template metadata if it doesn't exist --- Makefile | 2 +- driver/runner.rs | 1 + k8s/sk_tracer.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4b876b23..7ffb93a2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ GO_ARTIFACTS=sk-cloudprov sk-vnode RUST_ARTIFACTS=sk-ctrl sk-driver sk-tracer -ARTIFACTS ?= $(GO_ARTIFACTS) $(RUST_ARTIFACTS) skctl +ARTIFACTS ?= $(GO_ARTIFACTS) $(RUST_ARTIFACTS) COVERAGE_DIR=$(BUILD_DIR)/coverage GO_COVER_FILE=$(COVERAGE_DIR)/go-coverage.txt diff --git a/driver/runner.rs b/driver/runner.rs index 4cecd852..a1db1706 100644 --- a/driver/runner.rs +++ b/driver/runner.rs @@ -48,6 +48,7 @@ fn build_virtual_obj( vobj.metadata.namespace = Some(virtual_ns.into()); klabel_insert!(vobj, VIRTUAL_LABEL_KEY => "true"); + jsonutils::patch_ext::add(pod_spec_template_path, "metadata", &json!({}), &mut vobj.data, false)?; jsonutils::patch_ext::add( &format!("{}/metadata", pod_spec_template_path), "annotations", diff --git a/k8s/sk_tracer.py b/k8s/sk_tracer.py index 866fbd45..8a4126aa 100644 --- a/k8s/sk_tracer.py +++ b/k8s/sk_tracer.py @@ -13,6 +13,7 @@ podSpecTemplatePath: /spec/template batch.volcano.sh/v1alpha1.Job: podSpecTemplatePath: /spec/tasks/*/template + trackLifecycle: true """ CONFIGMAP_NAME = "tracer-config"