Skip to content

Commit

Permalink
Merge branch 'main' into add-test-cloud-service-loadbalancer
Browse files Browse the repository at this point in the history
  • Loading branch information
komer3 authored Mar 19, 2024
2 parents 1b77998 + db4b61c commit f871f93
Show file tree
Hide file tree
Showing 30 changed files with 170 additions and 122 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CONTROLLER_IMAGE ?= $(REGISTRY)/$(IMAGE_NAME)
TAG ?= dev
ENVTEST_K8S_VERSION := 1.28.0
VERSION ?= $(shell git describe --always --tag --dirty=-dev)
GIT_REF ?= $(shell git rev-parse --short HEAD)
BUILD_ARGS := --build-arg VERSION=$(VERSION)
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec
Expand Down Expand Up @@ -146,7 +147,7 @@ test: generate fmt vet envtest ## Run tests.

.PHONY: e2etest
e2etest: generate local-deploy chainsaw
$(CHAINSAW) test ./e2e
echo "git_ref: $(GIT_REF)" | $(CHAINSAW) test ./e2e --values -

local-deploy: kind ctlptl tilt kustomize clusterctl
@echo -n "LINODE_TOKEN=$(LINODE_TOKEN)" > config/default/.env.linode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: cluster-test
name: ($cluster)
spec:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeCluster
name: linodecluster-test
name: ($cluster)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeCluster
metadata:
name: linodecluster-test
name: ($cluster)
finalizers:
- infrastructure.cluster.x-k8s.io/v1alpha1
spec:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeCluster
metadata:
name: linodecluster-test
name: ($cluster)
spec:
region: us-sea
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeCluster
metadata:
name: linodecluster-test
name: ($cluster)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: cluster-test
name: ($cluster)
spec:
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ metadata:
creationTimestamp: null
name: minimal-linodecluster
spec:
bindings:
# A short identifier for the E2E test run
- name: run
value: (join('-', ['e2e', 'min-cluster', ($values.git_ref)]))
- name: cluster
# Format the cluster name into a valid Linode label
# TODO: This is over-truncated to account for the Linode NodeBalancer label
value: (trim((truncate(($run), `21`)), '-'))
- name: nodebalancer
value: (join('-', [($cluster), 'api-server']))
template: true
steps:
- name: step-00
try:
Expand All @@ -31,7 +42,7 @@ spec:
- name: URI
value: nodebalancers
- name: FILTER
value: '{"label":"linodecluster-test-api-server"}'
value: (to_string({"label":($nodebalancer)}))
content: |
set -e
curl -s \
Expand All @@ -49,7 +60,7 @@ spec:
ref:
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
name: cluster-test
name: ($cluster)
- error:
file: 04-error.yaml
- name: step-05
Expand All @@ -63,7 +74,7 @@ spec:
- name: URI
value: nodebalancers
- name: FILTER
value: '{"label":"linodecluster-test-api-server"}'
value: (to_string({"label":($nodebalancer)}))
content: |
set -e
curl -s \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: linodemachine-cluster-test
name: ($cluster)
spec:
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
name: linodecluster-test-control-plane
name: ($cluster)
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeCluster
name: linodemachine-test
name: ($cluster)
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeCluster
metadata:
name: linodemachine-test
name: ($cluster)
spec:
region: us-sea
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachine
metadata:
labels:
cluster.x-k8s.io/cluster-name: linodemachine-cluster-test
cluster.x-k8s.io/cluster-name: ($cluster)
spec:
region: us-sea
type: g5-nanode-1
Expand All @@ -15,9 +15,9 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: Machine
metadata:
labels:
cluster.x-k8s.io/cluster-name: linodemachine-cluster-test
cluster.x-k8s.io/cluster-name: ($cluster)
spec:
clusterName: linodemachine-cluster-test
clusterName: ($cluster)
status:
bootstrapReady: true
infrastructureReady: true
infrastructureReady: true
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
metadata:
name: linodecluster-test-control-plane
name: ($cluster)
spec:
kubeadmConfigSpec:
clusterConfiguration:
Expand All @@ -16,14 +16,14 @@ spec:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachineTemplate
name: linodemachine-test
name: ($cluster)
replicas: 1
version: 1.29.1
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachineTemplate
metadata:
name: linodemachine-test
name: ($cluster)
spec:
template:
spec:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachine
metadata:
name: linodemachine-test
labels:
cluster.x-k8s.io/cluster-name: ($cluster)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: cluster-test
name: ($cluster)
spec:
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ metadata:
creationTimestamp: null
name: minimal-linodemachine
spec:
bindings:
# A short identifier for the E2E test run
- name: run
value: (join('-', ['e2e', 'min-lm', ($values.git_ref)]))
- name: cluster
# Format the cluster name into a valid Linode label
# TODO: This is over-truncated to account for the Linode NodeBalancer label
value: (trim((truncate(($run), `21`)), '-'))
template: true
steps:
- name: step-00
try:
Expand All @@ -31,7 +40,7 @@ spec:
- name: URI
value: linode/instances
- name: FILTER
value: '{"tags":"linodemachine-test"}'
value: (to_string({"tags":($cluster)}))
content: |
set -e
curl -s \
Expand All @@ -49,7 +58,7 @@ spec:
ref:
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
name: linodemachine-cluster-test
name: ($cluster)
- error:
file: 04-error.yaml
- name: step-05
Expand All @@ -63,7 +72,7 @@ spec:
- name: URI
value: linode/instances
- name: FILTER
value: '{"tags":"linodemachine-test"}'
value: (to_string({"tags":($cluster)}))
content: |
set -e
curl -s \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeVPC
metadata:
name: machine-test-vpc
name: ($vpc)
spec:
region: us-sea
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: vpc-cluster-test
name: ($cluster)
spec:
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
name: linodecluster-test-control-plane
name: ($cluster)
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeCluster
name: vpc-machine-test
name: ($cluster)
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeCluster
metadata:
name: vpc-machine-test
name: ($cluster)
spec:
region: us-sea
vpcRef:
kind: LinodeVPC
name: machine-test-vpc
name: ($vpc)
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeVPC
metadata:
name: machine-test-vpc
name: ($vpc)
spec:
region: us-sea
subnets:
Expand Down
8 changes: 4 additions & 4 deletions e2e/linodemachine-controller/vpc-integration/02-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachine
metadata:
labels:
cluster.x-k8s.io/cluster-name: vpc-cluster-test
cluster.x-k8s.io/cluster-name: ($cluster)
spec:
region: us-sea
type: g5-nanode-1
Expand All @@ -15,9 +15,9 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: Machine
metadata:
labels:
cluster.x-k8s.io/cluster-name: vpc-cluster-test
cluster.x-k8s.io/cluster-name: ($cluster)
spec:
clusterName: vpc-cluster-test
clusterName: ($cluster)
status:
bootstrapReady: true
infrastructureReady: true
infrastructureReady: true
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
metadata:
name: linodecluster-test-control-plane
name: ($cluster)
spec:
kubeadmConfigSpec:
clusterConfiguration:
Expand All @@ -16,17 +16,16 @@ spec:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachineTemplate
name: linodemachine-test
name: ($cluster)
replicas: 1
version: 1.29.1
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachineTemplate
metadata:
name: linodemachine-test
name: ($cluster)
spec:
template:
spec:
region: us-sea
type: g5-nanode-1

4 changes: 2 additions & 2 deletions e2e/linodemachine-controller/vpc-integration/04-error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachine
metadata:
name: linodemachine-test
name: ($cluster)
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeVPC
metadata:
name: machine-test-vpc
name: ($vpc)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: cluster-test
name: ($cluster)
spec:
Loading

0 comments on commit f871f93

Please sign in to comment.