Skip to content

Commit a7f0c5c

Browse files
authored
Merge pull request #1464 from zhanggbj/bump_1.33
Bump e2e to use latest CAPI/CAPV and refine testcases
2 parents cd8d4a0 + 2fbe7df commit a7f0c5c

File tree

9 files changed

+315
-287
lines changed

9 files changed

+315
-287
lines changed

hack/tools/go.mod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module tools
33
go 1.23.0
44

55
require (
6-
github.com/onsi/ginkgo/v2 v2.23.0
6+
github.com/onsi/ginkgo/v2 v2.23.4
77
sigs.k8s.io/kind v0.27.0
88
)
99

@@ -12,16 +12,17 @@ require (
1212
github.com/BurntSushi/toml v1.4.0 // indirect
1313
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
1414
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
15-
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
15+
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
1616
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
1717
github.com/inconshreveable/mousetrap v1.1.0 // indirect
1818
github.com/mattn/go-isatty v0.0.20 // indirect
1919
github.com/pelletier/go-toml v1.9.5 // indirect
2020
github.com/pkg/errors v0.9.1 // indirect
2121
github.com/spf13/cobra v1.8.0 // indirect
2222
github.com/spf13/pflag v1.0.5 // indirect
23-
golang.org/x/sys v0.30.0 // indirect
24-
golang.org/x/tools v0.30.0 // indirect
23+
go.uber.org/automaxprocs v1.6.0 // indirect
24+
golang.org/x/sys v0.32.0 // indirect
25+
golang.org/x/tools v0.31.0 // indirect
2526
gopkg.in/yaml.v3 v3.0.1 // indirect
2627
sigs.k8s.io/yaml v1.4.0 // indirect
2728
)

hack/tools/go.sum

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ4
1212
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
1313
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
1414
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
15-
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
16-
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
17-
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg=
18-
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
15+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
16+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
17+
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8=
18+
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
1919
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 h1:SJ+NtwL6QaZ21U+IrK7d0gGgpjGGvd2kz+FzTHVzdqI=
2020
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2/go.mod h1:Tv1PlzqC9t8wNnpPdctvtSUOPUUg4SHeE6vR1Ir2hmg=
2121
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
@@ -29,35 +29,39 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
2929
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
3030
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
3131
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
32-
github.com/onsi/ginkgo/v2 v2.23.0 h1:FA1xjp8ieYDzlgS5ABTpdUDB7wtngggONc8a7ku2NqQ=
33-
github.com/onsi/ginkgo/v2 v2.23.0/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM=
34-
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
35-
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
32+
github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus=
33+
github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8=
34+
github.com/onsi/gomega v1.36.3 h1:hID7cr8t3Wp26+cYnfcjR6HpJ00fdogN6dqZ1t6IylU=
35+
github.com/onsi/gomega v1.36.3/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0=
3636
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
3737
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
3838
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
3939
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
4040
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
4141
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4242
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
43+
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
44+
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
4345
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
4446
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
4547
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
4648
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
4749
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
4850
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
4951
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
50-
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
51-
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
52+
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
53+
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
54+
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
55+
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
5256
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
53-
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
54-
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
55-
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
56-
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
57-
golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
58-
golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
59-
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
60-
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
57+
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
58+
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
59+
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
60+
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
61+
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
62+
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
63+
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
64+
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
6165
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
6266
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U=
6367
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

test/e2e/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ E2E_CHART ?= ${REPO_ROOT}/charts/vsphere-cpi
4141
E2E_DATA_DIR := ${REPO_ROOT}/test/e2e/data
4242

4343
# E2E_DATA_CAPV_TAG defines the providers from which tag of CAPV to use
44-
E2E_DATA_CAPV_TAG ?= v1.12.0
44+
E2E_DATA_CAPV_TAG ?= v1.13.0-rc.0
4545

4646
# VERSION_DEV is the version of the image used for development
4747
VERSION_DEV ?= $(VERSION)

test/e2e/config/vsphere-ci.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,51 +10,51 @@ providers:
1010
- name: cluster-api
1111
type: CoreProvider
1212
versions:
13-
- name: v1.9.1
13+
- name: v1.10.99
1414
# Use manifest from source files
15-
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.1/core-components.yaml"
15+
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.0-rc.0/core-components.yaml"
1616
type: "url"
1717
contract: v1beta1
1818
files:
19-
- sourcePath: "../data/shared/capi/v1.9/metadata.yaml"
19+
- sourcePath: "../data/shared/capi/v1.10/metadata.yaml"
2020
replacements:
2121
- old: "imagePullPolicy: Always"
2222
new: "imagePullPolicy: IfNotPresent"
2323

2424
- name: kubeadm
2525
type: BootstrapProvider
2626
versions:
27-
- name: v1.9.1
27+
- name: v1.10.99
2828
# Use manifest from source files
29-
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.1/bootstrap-components.yaml"
29+
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.0-rc.0/bootstrap-components.yaml"
3030
type: "url"
3131
contract: v1beta1
3232
files:
33-
- sourcePath: "../data/shared/capi/v1.9/metadata.yaml"
33+
- sourcePath: "../data/shared/capi/v1.10/metadata.yaml"
3434
replacements:
3535
- old: "imagePullPolicy: Always"
3636
new: "imagePullPolicy: IfNotPresent"
3737

3838
- name: kubeadm
3939
type: ControlPlaneProvider
4040
versions:
41-
- name: v1.9.1
41+
- name: v1.10.99
4242
# Use manifest from source files
43-
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.1/control-plane-components.yaml"
43+
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.0-rc.0/control-plane-components.yaml"
4444
type: "url"
4545
contract: v1beta1
4646
files:
47-
- sourcePath: "../data/shared/capi/v1.9/metadata.yaml"
47+
- sourcePath: "../data/shared/capi/v1.10/metadata.yaml"
4848
replacements:
4949
- old: "imagePullPolicy: Always"
5050
new: "imagePullPolicy: IfNotPresent"
5151

5252
- name: vsphere
5353
type: InfrastructureProvider
5454
versions:
55-
- name: v1.12.0
55+
- name: v1.13.99
5656
# Use manifest from source files
57-
value: "https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/v1.12.0/infrastructure-components.yaml"
57+
value: "https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/v1.13.0-rc.0/infrastructure-components.yaml"
5858
type: "url"
5959
contract: v1beta1
6060
files:
@@ -65,15 +65,15 @@ providers:
6565
- sourcePath: "../data/shared/capv/main/metadata.yaml"
6666

6767
variables:
68-
KUBERNETES_VERSION: "v1.32.0"
68+
KUBERNETES_VERSION: "v1.33.0-beta.0"
6969
#! KUBERNETES_VERSION_LATEST_CI can have the following formats:
7070
#! * v1.28.0 => will return the same version for convenience
7171
#! * stable-1.28 => will return the latest patch release for v1.28, e.g. v1.28.5
7272
#! * ci/latest-1.28 => will return the latest built version from the release branch, e.g. v1.28.5-26+72feddd3acde14
73-
KUBERNETES_VERSION_LATEST_CI: "ci/latest-1.32"
74-
KUBERNETES_VERSION_UPGRADE_FROM: "v1.31.0"
75-
KUBERNETES_VERSION_UPGRADE_TO: "v1.32.0"
76-
CPI_IMAGE_K8S_VERSION: "v1.32.0"
73+
KUBERNETES_VERSION_LATEST_CI: "ci/latest-1.33"
74+
KUBERNETES_VERSION_UPGRADE_FROM: "v1.32.0"
75+
KUBERNETES_VERSION_UPGRADE_TO: "v1.33.0-beta.0"
76+
CPI_IMAGE_K8S_VERSION: "v1.33.0-beta.0"
7777
CNI: "./data/cni/calico/calico.yaml"
7878
EXP_CLUSTER_RESOURCE_SET: "true"
7979
EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION: "true"

test/e2e/cpi_vm_test.go

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import (
44
"context"
55
"errors"
66
"fmt"
7-
"strings"
87
"time"
98

109
. "github.com/onsi/ginkgo/v2"
1110
. "github.com/onsi/gomega"
1211
"github.com/vmware/govmomi/object"
1312
"github.com/vmware/govmomi/vim25/types"
1413
corev1 "k8s.io/api/core/v1"
14+
apierrors "k8s.io/apimachinery/pkg/api/errors"
1515
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1616
k8stypes "k8s.io/apimachinery/pkg/types"
1717
"k8s.io/klog/v2"
@@ -20,30 +20,47 @@ import (
2020
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
2121
)
2222

23-
const machineNamespace = "default"
23+
const (
24+
machineNamespace = "default"
25+
ControlPlaneNodeLabel = "node-role.kubernetes.io/control-plane"
26+
)
2427

25-
// getWorkerNode retrieves the worker node object for the E2E testing using workload cluster's clientset
28+
// getWorkerNode retrieves the first worker node object for the E2E testing using workload cluster's clientset
29+
// Only control plane Node has ControlPlaneNodeLabel.
2630
func getWorkerNode() (*corev1.Node, error) {
2731
nodes, err := workloadClientset.CoreV1().Nodes().List(ctx, metav1.ListOptions{})
2832
if err != nil {
2933
return nil, err
3034
}
31-
return getFirstWorkerNodeFromList(nodes)
35+
36+
for _, node := range nodes.Items {
37+
if _, ok := node.GetLabels()[ControlPlaneNodeLabel]; !ok {
38+
// get the first worker node
39+
return &node, nil
40+
}
41+
42+
}
43+
return nil, errors.New("worker node not found")
3244
}
3345

34-
// getWorkerNode retrieves the CAPV machine object with name from the boostrap cluster
46+
// getWorkerMachine retrieves the CAPI machine object with name from the boostrap cluster
3547
func getWorkerMachine(name string) (*v1beta1.Machine, error) {
36-
machine := &v1beta1.Machine{}
37-
if err := proxy.GetClient().Get(ctx, k8stypes.NamespacedName{
38-
Name: name,
39-
Namespace: machineNamespace,
40-
}, machine); err != nil {
41-
return nil, err
48+
machineList := &v1beta1.MachineList{}
49+
err := proxy.GetClient().List(ctx, machineList)
50+
if err != nil {
51+
return nil, errors.New("failed to list Machines")
4252
}
43-
return machine, err
53+
54+
for _, machine := range machineList.Items {
55+
if machine.Status.NodeRef.Name == name {
56+
return &machine, nil
57+
}
58+
}
59+
60+
return nil, errors.New("machine not found")
4461
}
4562

46-
// deleteWorkerMachine deletes the CAPV machine object with name from the boostrap cluster
63+
// deleteWorkerMachine deletes the CAPI machine object with name from the boostrap cluster
4764
func deleteWorkerMachine(name string) error {
4865
machine := &v1beta1.Machine{
4966
ObjectMeta: metav1.ObjectMeta{
@@ -54,17 +71,6 @@ func deleteWorkerMachine(name string) error {
5471
return proxy.GetClient().Delete(ctx, machine)
5572
}
5673

57-
// getFirstWorkerNodeFromList searches the first worker node that forms the cluster.
58-
// We assume all the name of worker node contains substring `-md-`
59-
func getFirstWorkerNodeFromList(nodes *corev1.NodeList) (*corev1.Node, error) {
60-
for _, node := range nodes.Items {
61-
if strings.Contains(node.Name, "-md-") {
62-
return &node, nil
63-
}
64-
}
65-
return nil, errors.New("worker node not found")
66-
}
67-
6874
// getExternalIPFromNode returns the external IP from Node.status.addresses, given a node object
6975
func getExternalIPFromNode(node *corev1.Node) (string, error) {
7076
addresses := node.Status.Addresses
@@ -306,14 +312,14 @@ var _ = Describe("Restarting, recreating and deleting VMs", func() {
306312
providerID := getProviderIDFromNode(workerNode)
307313

308314
By("Delete machine object", func() {
309-
err := deleteWorkerMachine(workerNode.Name)
315+
err := deleteWorkerMachine(workerMachine.Name)
310316
Expect(err).To(BeNil(), "cannot delete machine object")
311317
})
312318

313319
By("Eventually original node will be gone")
314320
Eventually(func() bool {
315-
_, err = getWorkerNode()
316-
return err != nil && err.Error() == "worker node not found"
321+
_, err := workloadClientset.CoreV1().Nodes().Get(ctx, workerNode.Name, metav1.GetOptions{})
322+
return err != nil && apierrors.IsNotFound(err)
317323
}, 5*time.Minute, 5*time.Second).Should(BeTrue())
318324

319325
By("Eventually new node will be created")
@@ -357,7 +363,7 @@ var _ = Describe("Restarting, recreating and deleting VMs", func() {
357363
err = task.Wait(ctx)
358364
Expect(err).ToNot(HaveOccurred(), "cannot wait for vm to power off")
359365

360-
By("Delete VM fron VC")
366+
By("Delete VM from VC")
361367
task, err = workerVM.Destroy(ctx)
362368
Expect(err).ToNot(HaveOccurred(), "cannot destroy vm")
363369

@@ -366,8 +372,8 @@ var _ = Describe("Restarting, recreating and deleting VMs", func() {
366372

367373
By("Eventually original node will be gone")
368374
Eventually(func() bool {
369-
_, err = getWorkerNode()
370-
return err != nil && err.Error() == "worker node not found"
375+
_, err := workloadClientset.CoreV1().Nodes().Get(ctx, workerNode.Name, metav1.GetOptions{})
376+
return err != nil && apierrors.IsNotFound(err)
371377
}, 5*time.Minute, 5*time.Second).Should(BeTrue())
372378
})
373379
})

0 commit comments

Comments
 (0)