Skip to content

Commit

Permalink
AppWrapper e2e: Remove creationTimestamp from marshalled template
Browse files Browse the repository at this point in the history
  • Loading branch information
sutaakar committed Nov 19, 2024
1 parent 97a2239 commit 7437b9b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/e2e/mnist_pytorch_appwrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package e2e

import (
"encoding/json"
"strings"
"testing"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -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{
Expand All @@ -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)},
},
},
},
Expand Down

0 comments on commit 7437b9b

Please sign in to comment.