From 7437b9bcbfb738b8d8f61625ed38c45610f3c6f0 Mon Sep 17 00:00:00 2001 From: Karel Suta Date: Tue, 19 Nov 2024 09:40:48 +0100 Subject: [PATCH] AppWrapper e2e: Remove creationTimestamp from marshalled template --- test/e2e/mnist_pytorch_appwrapper_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/e2e/mnist_pytorch_appwrapper_test.go b/test/e2e/mnist_pytorch_appwrapper_test.go index 1919c616..99c0e1ae 100644 --- a/test/e2e/mnist_pytorch_appwrapper_test.go +++ b/test/e2e/mnist_pytorch_appwrapper_test.go @@ -17,6 +17,8 @@ limitations under the License. package e2e import ( + "encoding/json" + "strings" "testing" . "github.com/onsi/gomega" @@ -145,6 +147,10 @@ func runMnistPyTorchAppWrapper(t *testing.T, accelerator string, numberOfGpus in }, } + raw, _ := json.Marshal(job) + // Workaround to remove creationTimestamp which is brought by json marshaller, this field breaks Kueue reconciliation + patchedRaw := strings.ReplaceAll(string(raw), `"metadata":{"creationTimestamp":null},`, "") + // Create an AppWrapper resource aw := &mcadv1beta2.AppWrapper{ TypeMeta: metav1.TypeMeta{ @@ -159,7 +165,7 @@ func runMnistPyTorchAppWrapper(t *testing.T, accelerator string, numberOfGpus in Spec: mcadv1beta2.AppWrapperSpec{ Components: []mcadv1beta2.AppWrapperComponent{ { - Template: Raw(test, job), + Template: runtime.RawExtension{Raw: []byte(patchedRaw)}, }, }, },