Skip to content

Commit 9f1bbea

Browse files
committed
test(e2e): patch installplans w/ server-side apply
Use server-side apply to patch InstallPlans under test in order to prevent update conflict flakes.
1 parent afd2348 commit 9f1bbea

File tree

2 files changed

+97
-90
lines changed

2 files changed

+97
-90
lines changed

pkg/lib/testobj/runtime.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package testobj
22

33
import (
4+
"encoding/json"
45
"fmt"
56

67
"k8s.io/apimachinery/pkg/api/meta"
@@ -102,3 +103,13 @@ func WithItems(list runtime.Object, items ...runtime.Object) runtime.Object {
102103

103104
return out
104105
}
106+
107+
// MarshalJSON marshals an object to JSON and panics if it can't.
108+
func MarshalJSON(obj runtime.Object) (marshaled []byte) {
109+
var err error
110+
if marshaled, err = json.Marshal(obj); err != nil {
111+
panic(fmt.Sprintf("failed to marshal obj to json: %s", err))
112+
}
113+
114+
return
115+
}

0 commit comments

Comments
 (0)