mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Fix failing test
This commit is contained in:
parent
3279c73945
commit
2e669a7f22
@ -180,7 +180,7 @@ func TestNoOpUpdateSameResourceVersion(t *testing.T) {
|
||||
}
|
||||
}`)
|
||||
|
||||
_, err := client.CoreV1().RESTClient().Patch(types.ApplyPatchType).
|
||||
o, err := client.CoreV1().RESTClient().Patch(types.ApplyPatchType).
|
||||
Namespace("default").
|
||||
Param("fieldManager", "apply_test").
|
||||
Resource(podResource).
|
||||
@ -192,6 +192,23 @@ func TestNoOpUpdateSameResourceVersion(t *testing.T) {
|
||||
t.Fatalf("Failed to create object: %v", err)
|
||||
}
|
||||
|
||||
// Need to update once for some reason
|
||||
// TODO: Remove this once possible
|
||||
b, err := json.MarshalIndent(o, "\t", "\t")
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to marshal created object: %v", err)
|
||||
}
|
||||
_, err = client.CoreV1().RESTClient().Put().
|
||||
Namespace("default").
|
||||
Resource(podResource).
|
||||
Name(podName).
|
||||
Body(b).
|
||||
Do().
|
||||
Get()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to apply first no-op update: %v", err)
|
||||
}
|
||||
|
||||
// Sleep for one second to make sure that the times of each update operation is different.
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user