mirror of
https://gitee.com/rancher/rancher.git
synced 2025-12-06 07:49:17 +08:00
fix CI failures (#52693)
This commit is contained in:
@@ -408,6 +408,8 @@ def test_perform_workload_action_read_only(admin_mc, admin_pc, remove_resource,
|
||||
|
||||
workload = client.reload(workload)
|
||||
wait_for_workload(client, workload.id, ns.id)
|
||||
|
||||
workload = client.reload(workload)
|
||||
original_rev_id = workload.revisions().data[0].id
|
||||
|
||||
# Read-only users should receive a 404 error.
|
||||
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
k8swait "k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/client-go/util/retry"
|
||||
"k8s.io/utils/ptr"
|
||||
capi "sigs.k8s.io/cluster-api/api/v1beta1"
|
||||
@@ -77,7 +78,24 @@ func Test_Provisioning_MP_SingleNodeAllRolesWithDelete(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
node, err := clusterClients.Core.Node().Get(machines.Items[0].Status.NodeRef.Name, metav1.GetOptions{})
|
||||
var node *corev1.Node
|
||||
backoff := k8swait.Backoff{
|
||||
Steps: 5,
|
||||
Duration: 2 * time.Second,
|
||||
Factor: 1.0,
|
||||
Jitter: 0.5,
|
||||
}
|
||||
err = retry.OnError(backoff, func(e error) bool {
|
||||
return apierror.IsNotFound(e) || apierror.IsUnauthorized(e)
|
||||
}, func() error {
|
||||
var err error
|
||||
node, err = clusterClients.Core.Node().Get(machines.Items[0].Status.NodeRef.Name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user