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)}, }, }, }, diff --git a/test/e2e/mnist_rayjob_raycluster_test.go b/test/e2e/mnist_rayjob_raycluster_test.go index c66fb28f..bdd21aef 100644 --- a/test/e2e/mnist_rayjob_raycluster_test.go +++ b/test/e2e/mnist_rayjob_raycluster_test.go @@ -18,9 +18,11 @@ package e2e import ( "crypto/tls" + "encoding/json" "fmt" "net/http" "net/url" + "strings" "testing" . "github.com/onsi/gomega" @@ -135,6 +137,11 @@ func runMnistRayJobRayClusterAppWrapper(t *testing.T, accelerator string, number // Create RayCluster, wrap in AppWrapper and assign to localqueue rayCluster := constructRayCluster(test, namespace, mnist, numberOfGpus) + + raw, _ := json.Marshal(rayCluster) + // Workaround to remove creationTimestamp which is brought by json marshaller, this field breaks Kueue reconciliation + patchedRaw := strings.ReplaceAll(string(raw), `"metadata":{"creationTimestamp":null},`, "") + aw := &mcadv1beta2.AppWrapper{ TypeMeta: metav1.TypeMeta{ APIVersion: mcadv1beta2.GroupVersion.String(), @@ -148,7 +155,7 @@ func runMnistRayJobRayClusterAppWrapper(t *testing.T, accelerator string, number Spec: mcadv1beta2.AppWrapperSpec{ Components: []mcadv1beta2.AppWrapperComponent{ { - Template: Raw(test, rayCluster), + Template: runtime.RawExtension{Raw: []byte(patchedRaw)}, }, }, },