Skip to content

Commit

Permalink
Initial e2e-test
Browse files Browse the repository at this point in the history
  • Loading branch information
prksu committed Mar 29, 2020
1 parent b3ab40c commit 30e88eb
Show file tree
Hide file tree
Showing 9 changed files with 879 additions and 10 deletions.
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ RBAC_ROOT ?= $(MANIFEST_ROOT)/rbac
# Allow overriding the imagePullPolicy
PULL_POLICY ?= Always

# Always use buildkit
DOCKER_BUILDKIT=1

## --------------------------------------
##@ Help
## --------------------------------------
Expand All @@ -75,7 +78,7 @@ help: ## Display this help

.PHONY: test
test: generate lint ## Run tests
go test -v ./...
go test -v ./api/... ./controllers/... ./pkg/...

.PHONY: test-integration
test-integration: ## Run integration tests
Expand All @@ -84,12 +87,7 @@ test-integration: ## Run integration tests
.PHONY: test-e2e
test-e2e: ## Run e2e tests
PULL_POLICY=IfNotPresent $(MAKE) docker-build
cd $(TEST_E2E_DIR); go test -v -tags=e2e -timeout=3h . -args -ginkgo.v -ginkgo.focus "functional tests" --managerImage $(CONTROLLER_IMG)-$(ARCH):$(TAG)

.PHONY: test-conformance
test-conformance: ## Run conformance test on workload cluster
PULL_POLICY=IfNotPresent $(MAKE) docker-build
cd $(TEST_E2E_DIR); go test -v -tags=e2e -timeout=4h . -args -ginkgo.v -ginkgo.focus "conformance tests" --managerImage $(CONTROLLER_IMG)-$(ARCH):$(TAG)
go test -v -timeout=3h ./$(TEST_E2E_DIR) -args -ginkgo.v --managerImage $(CONTROLLER_IMG)-$(ARCH):$(TAG)

## --------------------------------------
##@ Binaries
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ require (
github.com/go-logr/logr v0.1.0
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
github.com/google/go-cmp v0.3.1 // indirect
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/onsi/ginkgo v1.11.0
github.com/onsi/gomega v1.8.1
github.com/pkg/errors v0.8.1
go.uber.org/atomic v1.4.0 // indirect
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 // indirect
Expand All @@ -26,5 +23,6 @@ require (
k8s.io/klog v1.0.0
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f
sigs.k8s.io/cluster-api v0.2.9
sigs.k8s.io/cluster-api/bootstrap/kubeadm v0.0.0-20191016155141-23a891785b60
sigs.k8s.io/controller-runtime v0.4.0
)
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
Expand Down Expand Up @@ -159,6 +161,7 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 h1:u4bArs140e9+AfE52mFHOXVFnOSBJBRlzTHrOPLOIhE=
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE=
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
Expand Down Expand Up @@ -220,6 +223,8 @@ github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI=
github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ=
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jonboulle/clockwork v0.0.0-20141017032234-72f9bd7c4e0c/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
Expand Down Expand Up @@ -315,6 +320,8 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8=
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
Expand Down Expand Up @@ -389,6 +396,7 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -419,6 +427,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190909003024-a7b16738d86b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
Expand Down Expand Up @@ -448,6 +457,7 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190911201528-7ad0cfa0b7b5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 h1:rOhMmluY6kLMhdnrivzec6lLgaVbMHMn2ISQXJeJ5EM=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -555,6 +565,8 @@ k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90/go.mod h1:J69/JveO6XESwVgG53
k8s.io/client-go v0.0.0-20190918200256-06eb1244587a/go.mod h1:3YAcTbI2ArBRmhHns5vlHRX8YQqvkVYpz+U/N5i1mVU=
k8s.io/client-go v0.17.2 h1:ndIfkfXEGrNhLIgkr0+qhRguSD3u6DCmonepn1O6NYc=
k8s.io/client-go v0.17.2/go.mod h1:QAzRgsa0C2xl4/eVpeVAZMvikCn8Nm81yqVx3Kk9XYI=
k8s.io/cluster-bootstrap v0.0.0-20190516232516-d7d78ab2cfe7 h1:5wvjieVoU4oovHlkeD256q2M2YYi2P01zk6wxSR2zk0=
k8s.io/cluster-bootstrap v0.0.0-20190516232516-d7d78ab2cfe7/go.mod h1:iBSm2nwo3OaiuW8VDvc3ySDXK5SKfUrxwPvBloKG7zg=
k8s.io/code-generator v0.0.0-20190612205613-18da4a14b22b/go.mod h1:G8bQwmHm2eafm5bgtX67XDZQ8CWKSGu9DekI+yN4Y5I=
k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269 h1:d8Fm55A+7HOczX58+x9x+nJnJ1Devt1aCrWVIPaw/Vg=
k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE=
Expand Down Expand Up @@ -591,8 +603,11 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
sigs.k8s.io/cluster-api v0.2.5/go.mod h1:Agc72Ra5LMOkQQ2v/Ywv1KUemaYAwvkQ+G59Ym5H8e4=
sigs.k8s.io/cluster-api v0.2.9 h1:PZSuz8hE1u5Y5lZcxi3pDDOc9xxY68uzxVoNGerEXy8=
sigs.k8s.io/cluster-api v0.2.9/go.mod h1:BCw+Pqy1sc8mQ/3d2NZM/f5BApKFCMPsnGvKolvDcA0=
sigs.k8s.io/cluster-api/bootstrap/kubeadm v0.0.0-20191016155141-23a891785b60 h1:xs/iNeNQwDa6W1RzY/xAxUQkUN6yH+JvENKQiGubfWc=
sigs.k8s.io/cluster-api/bootstrap/kubeadm v0.0.0-20191016155141-23a891785b60/go.mod h1:d4Nz7rDBVC32CbS9xC4RQkTZTtpn5oQHuGWp7Vj/o3k=
sigs.k8s.io/controller-runtime v0.3.0/go.mod h1:Cw6PkEg0Sa7dAYovGT4R0tRkGhHXpYijwNxYhAnAZZk=
sigs.k8s.io/controller-runtime v0.4.0 h1:wATM6/m+3w8lj8FXNaO6Fs/rq/vqoOjO1Q116Z9NPsg=
sigs.k8s.io/controller-runtime v0.4.0/go.mod h1:ApC79lpY3PHW9xj/w9pj+lYkLgwAAUZwfXkME1Lajns=
Expand Down
30 changes: 30 additions & 0 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# E2E Test

This document is to help developers understand how to run e2e test CAPDO.

## Requirements

In order to run the e2e tests the following requirements must be met:

* Ginkgo
* Docker
* Kind v0.6.0+ (*Kind v0.7.0+ not working due upstream dependencies*)

### Environment variables

The first step to running the e2e tests is setting up the required environment variables:

| Environment variable | Description |
| ----------------------------- | ----------------------------------------------------------------------------------------------------- |
| `DIGITALOCEAN_ACCESS_TOKEN` | The DigitalOcean API V2 access token |
| `MACHINE_TYPE` | The DigitalOcean Droplet size |
| `MACHINE_IMAGE` | The DigitalOcean Image id or slug |
| `MACHINE_SSHKEY` | The ssh key id or fingerprint (Should already registered in the DigitalOcean Account) |

### Running e2e test

In the root project directory run:

```
make test-e2e
```
158 changes: 158 additions & 0 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package e2e

import (
"context"
"io/ioutil"
"path"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"sigs.k8s.io/cluster-api/util"
"sigs.k8s.io/cluster-api/util/kubeconfig"
)

var _ = Describe("CAPDO", func() {
Describe("Cluster lifecycle", func() {
var (
clusterName string
clusterNamespace string
clusterGenenerator ClusterGenerator
machineGenerator MachineGenerator
)

BeforeEach(func() {
var err error
clusterName = "capdo-test-" + util.RandomString(6)
clusterNamespace = "default"

testTmpDir, err = ioutil.TempDir(suiteTmpDir, "e2e-test")
Expect(err).NotTo(HaveOccurred())
})

Context("Single control plane with one worker node", func() {
It("It should be creatable and deletable", func() {
cluster, docluster := clusterGenenerator.Generate(clusterNamespace, clusterName)
By("Creating a Cluster")
Expect(kindclient.Create(context.TODO(), cluster)).To(Succeed())

By("Creating a DOCluster")
Expect(kindclient.Create(context.TODO(), docluster)).To(Succeed())

By("Ensuring Cluster Infrastructure is Ready")
WaitForClusterInfrastructureReady(kindclient, cluster.Namespace, cluster.Name)

By("Creating a single controlplane")
controlPlaneMachine, controlPlaneKubeadmconfig, controlPlaneDomachine := machineGenerator.Generate(clusterNamespace, clusterName, true)
By("Creating a Controlplane KubeadmConfig")
Expect(kindclient.Create(context.TODO(), controlPlaneKubeadmconfig)).To(Succeed())

By("Creating a Controlplane DOMachine")
Expect(kindclient.Create(context.TODO(), controlPlaneDomachine)).To(Succeed())

By("Creating a Controlplane Machine")
Expect(kindclient.Create(context.TODO(), controlPlaneMachine)).To(Succeed())

By("Ensuring Controlplane Machine Bootstrap is Ready")
WaitForMachineBootstrapReady(kindclient, controlPlaneMachine.Namespace, controlPlaneMachine.Name)

By("Ensuring Controlplane DOMachine is Running")
WaitForDOMachineRunning(kindclient, controlPlaneDomachine.Namespace, controlPlaneDomachine.Name)

By("Ensuring Controlplane DOMachine is Ready")
WaitForDOMachineReady(kindclient, controlPlaneDomachine.Namespace, controlPlaneDomachine.Name)

By("Ensuring Controlplane MachineNodeRef")
WaitForMachineNodeRef(kindclient, controlPlaneMachine.Namespace, controlPlaneMachine.Name)

By("Ensuring Cluster Controlplane Initialized")
WaitForClusterControlplaneInitialized(kindclient, cluster.Namespace, cluster.Name)

By("Exporting Cluster kubeconfig")
kubeConfigData, err := kubeconfig.FromSecret(kindclient, cluster)
Expect(err).NotTo(HaveOccurred())
kubeConfigPath := path.Join(testTmpDir, clusterName+".kubeconfig")
Expect(ioutil.WriteFile(kubeConfigPath, kubeConfigData, 0640)).To(Succeed())

By("Deploying CNI")
ApplyYaml(kubeConfigPath, "https://docs.projectcalico.org/manifests/calico.yaml")

By("Deploying Cloud Controller Manager")
var ccmManifest string
buildCloudControllerManager(&ccmManifest)
ApplyYaml(kubeConfigPath, ccmManifest)

By("Create one worker")
workerMachine, workerKubeadmconfig, workerDomachine := machineGenerator.Generate(clusterNamespace, clusterName, false)
By("Creating a Worker KubeadmConfig")
Expect(kindclient.Create(context.TODO(), workerKubeadmconfig)).To(Succeed())

By("Creating a Worker DOMachine")
Expect(kindclient.Create(context.TODO(), workerDomachine)).To(Succeed())

By("Creating a Worker Machine")
Expect(kindclient.Create(context.TODO(), workerMachine)).To(Succeed())

By("Ensuring Worker Machine Bootstrap is Ready")
WaitForMachineBootstrapReady(kindclient, workerMachine.Namespace, workerMachine.Name)

By("Ensuring Worker DOMachine is Running")
WaitForDOMachineRunning(kindclient, workerDomachine.Namespace, workerDomachine.Name)

By("Ensuring Worker DOMachine is Ready")
WaitForDOMachineReady(kindclient, workerDomachine.Namespace, workerDomachine.Name)

By("Ensuring Worker MachineNodeRef")
WaitForMachineNodeRef(kindclient, workerMachine.Namespace, workerMachine.Name)

By("Deleting a Worker KubeadmConfig")
Expect(kindclient.Delete(context.TODO(), workerKubeadmconfig)).To(Succeed())
WaitForDeletion(kindclient, workerKubeadmconfig, workerKubeadmconfig.Namespace, workerKubeadmconfig.Name)

By("Deleting a Worker DOMachine")
Expect(kindclient.Delete(context.TODO(), workerDomachine)).To(Succeed())
WaitForDeletion(kindclient, workerDomachine, workerDomachine.Namespace, workerDomachine.Name)

By("Deleting a Worker Machine")
Expect(kindclient.Delete(context.TODO(), workerMachine)).To(Succeed())
WaitForDeletion(kindclient, workerMachine, workerMachine.Namespace, workerMachine.Name)

By("Deleting a Controlplane KubeadmConfig")
Expect(kindclient.Delete(context.TODO(), controlPlaneKubeadmconfig)).To(Succeed())
WaitForDeletion(kindclient, controlPlaneKubeadmconfig, controlPlaneKubeadmconfig.Namespace, controlPlaneKubeadmconfig.Name)

By("Deleting a Controlplane DOMachine")
Expect(kindclient.Delete(context.TODO(), controlPlaneDomachine)).To(Succeed())
WaitForDeletion(kindclient, controlPlaneDomachine, controlPlaneDomachine.Namespace, controlPlaneDomachine.Name)

By("Deleting a Controlplane Machine")
Expect(kindclient.Delete(context.TODO(), controlPlaneMachine)).To(Succeed())
WaitForDeletion(kindclient, controlPlaneMachine, controlPlaneMachine.Namespace, controlPlaneMachine.Name)

By("Deleting a DOCluster")
Expect(kindclient.Delete(context.TODO(), docluster)).To(Succeed())
WaitForDeletion(kindclient, docluster, docluster.Namespace, docluster.Name)

By("Deleting a Cluster")
Expect(kindclient.Delete(context.TODO(), cluster)).To(Succeed())
WaitForDeletion(kindclient, cluster, cluster.Namespace, cluster.Name)
})
})
})
})
Loading

0 comments on commit 30e88eb

Please sign in to comment.