Skip to content

Commit

Permalink
Delete VPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
komer3 committed Apr 26, 2024
1 parent 91a0679 commit 02166b5
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 9 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build_test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ jobs:
needs: [go-build-test, docker-build]
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
Expand Down Expand Up @@ -122,27 +125,26 @@ jobs:
if: github.ref == 'refs/heads/main'
run: make e2etest
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
INSTALL_K3S_PROVIDER: true
INSTALL_RKE2_PROVIDER: true
LINODE_REGION: us-sea
LINODE_CONTROL_PLANE_MACHINE_TYPE: g6-standard-2
LINODE_MACHINE_TYPE: g6-standard-2
CLUSTERCTL_CONFIG: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/e2e/clusterctl-config.yaml


- name: Quick E2E Test
run: make e2etest
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
# TODO: Switch selector to quick before the PR can be merged
E2E_FLAGS: '--selector flavors'
# TODO: ALL the var below need to be deleted before the PR can be merged
INSTALL_K3S_PROVIDER: true
INSTALL_RKE2_PROVIDER: true
LINODE_REGION: us-sea
LINODE_CONTROL_PLANE_MACHINE_TYPE: g6-standard-2
LINODE_MACHINE_TYPE: g6-standard-2
CLUSTERCTL_CONFIG: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/e2e/clusterctl-config.yaml
E2E_SELECTOR: '--selector flavors'

- name: Copy logs
if: ${{ always() }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ test: generate fmt vet envtest ## Run tests.

.PHONY: e2etest
e2etest: generate local-release local-deploy chainsaw
GIT_REF=$(GIT_REF) $(CHAINSAW) test ./e2e --assert-timeout 600s $(E2E_SELECTOR)
GIT_REF=$(GIT_REF) $(CHAINSAW) test ./e2e $(E2E_FLAGS)

local-deploy: kind ctlptl tilt kustomize clusterctl
@echo -n "LINODE_TOKEN=$(LINODE_TOKEN)" > config/default/.env.linode
Expand Down
9 changes: 8 additions & 1 deletion e2e/default-CAPL-cluster/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ metadata:
default-cluster:
flavors:
spec:
timeouts:
assert: 1000s
bindings:
# A short identifier for the E2E test run
- name: run
Expand Down Expand Up @@ -77,8 +79,13 @@ spec:
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
name: ($cluster)
- delete:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeVPC
name: ($vpc)
- error:
file: check-child-cluster-deleted.yaml
file: check-child-cluster-and-vpc-deleted.yaml
- name: Check if the linodes are deleted
try:
- script:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ kind: LinodeMachine
metadata:
labels:
cluster.x-k8s.io/cluster-name: ($cluster)
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeVPC
metadata:
name: ($vpc)
9 changes: 8 additions & 1 deletion e2e/k3s-capl-cluster/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ metadata:
k3s:
flavors:
spec:
timeouts:
assert: 300s
bindings:
# A short identifier for the E2E test run
- name: run
Expand Down Expand Up @@ -77,8 +79,13 @@ spec:
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
name: ($cluster)
- delete:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeVPC
name: ($vpc)
- error:
file: check-child-cluster-deleted.yaml
file: check-child-cluster-and-vpc-deleted.yaml
- name: Check if the linodes are deleted
try:
- script:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ kind: LinodeMachine
metadata:
labels:
cluster.x-k8s.io/cluster-name: ($cluster)
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeVPC
metadata:
name: ($vpc)
9 changes: 8 additions & 1 deletion e2e/rke2-capl-cluster/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ metadata:
rke2:
flavors:
spec:
timeouts:
assert: 300s
bindings:
# A short identifier for the E2E test run
- name: run
Expand Down Expand Up @@ -77,8 +79,13 @@ spec:
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
name: ($cluster)
- delete:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeVPC
name: ($vpc)
- error:
file: check-child-cluster-deleted.yaml
file: check-child-cluster-and-vpc-deleted.yaml
- name: Check if the linodes are deleted
try:
- script:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ kind: LinodeMachine
metadata:
labels:
cluster.x-k8s.io/cluster-name: ($cluster)
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeVPC
metadata:
name: ($vpc)

0 comments on commit 02166b5

Please sign in to comment.