Skip to content

Commit ca40556

Browse files
authored
Merge pull request #4358 from jnummelin/fix/removed-apis-test-timign-issue
Fix timing issue in ap-removedapis inttest
2 parents d0d9d62 + 9a471d8 commit ca40556

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

inttest/ap-removedapis/removedapis_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package removedapis
1616

1717
import (
18+
"context"
1819
"fmt"
1920
"testing"
2021
"time"
@@ -50,6 +51,19 @@ func (s *plansRemovedAPIsSuite) SetupTest() {
5051
s.Require().NoError(aptest.WaitForCRDByName(ctx, client, "removedcrds"))
5152

5253
s.PutFile(s.ControllerNode(0), "/var/lib/k0s/manifests/removedapis-test/resource.yaml", removedResource)
54+
// Wait to see the CR created on API
55+
kc, err := s.KubeClient(s.ControllerNode(0))
56+
s.Require().NoError(err)
57+
apiPath := "/apis/autopilot.k0sproject.io/v1beta1/namespaces/default/removedcrds/removed-resource"
58+
s.T().Log("Waiting for the removed resource CR to be created on the API...")
59+
err = common.Poll(ctx, func(ctx context.Context) (done bool, err error) {
60+
result := kc.RESTClient().Get().AbsPath(apiPath).Do(ctx)
61+
if result.Error() != nil {
62+
return false, nil
63+
}
64+
return true, nil
65+
})
66+
s.Require().NoError(err)
5367

5468
s.Require().NoError(aptest.WaitForCRDByName(ctx, client, "plans"))
5569
s.Require().NoError(aptest.WaitForCRDByName(ctx, client, "controlnodes"))
@@ -103,6 +117,8 @@ spec:
103117
platforms:
104118
linux-amd64:
105119
url: http://localhost/dist/k0s
120+
linux-arm64:
121+
url: http://localhost/dist/k0s
106122
targets:
107123
controllers:
108124
discovery:

0 commit comments

Comments
 (0)