Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 78 additions & 10 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E
name: Tests

on:
workflow_dispatch:
Expand All @@ -17,6 +17,11 @@ concurrency:
group: e2e-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

env:
KUBERNETES_VERSION: 1.26.1
VCLUSTER_NAME: vcluster
VCLUSTER_NAMESPACE: vcluster

jobs:
unit-test:
runs-on: ubuntu-latest
Expand All @@ -33,18 +38,81 @@ jobs:
- name: Run Unit Tests
run: go test ./...

e2e-test-empty:
e2e:
runs-on: ubuntu-latest
name: E2E Empty Test

name: E2E Test
steps:
- name: Echo hello
run: |
echo "hello"

- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Install Prerequisites
run: |

# Install clusterctl
# latest = v1.6.2
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.1/clusterctl-linux-amd64 -o clusterctl
chmod +x clusterctl
sudo mv clusterctl /usr/local/bin/

#Install Kind
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

# Install envsubst
GOBIN="$(pwd)/bin" go install -tags tools github.com/drone/envsubst/v2/cmd/[email protected]

# Install kubectl
# latest = v1.29.2
curl -LO "https://dl.k8s.io/release/v${{ env.KUBERNETES_VERSION }}/bin/linux/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl

# Install DevSpace
curl -fsSL -o /tmp/devspace https://github.com/devspace-cloud/devspace/releases/latest/download/devspace-linux-amd64
chmod +x /tmp/devspace
sudo mv /tmp/devspace /usr/local/bin/devspace

- name: Create and Start Kind Cluster
run: |
kind create cluster
echo "=== cluster-info ==="
kubectl cluster-info --context kind-kind

- name: Init
run: |
clusterctl init
echo "=== config get-contexts ==="
kubectl config get-contexts

- name: DevSpace Deploy
run: |
devspace deploy -p deploy

- name: Display Kubernetes Env
run: |
echo "=== Kubectl version ==="
kubectl version
echo "=== Kubectl config ==="
kubectl config view
echo "=== Kubectl get pods ==="
kubectl get pods -A
echo "=== Kubectl get namespaces ==="
kubectl get namespaces
echo "=== Test get crd ==="
kubectl get crd

- name: Create Vcluster Custom Resource
run: |
export CLUSTER_NAME=${{ env.VCLUSTER_NAME }}
export CLUSTER_NAMESPACE=${{ env.VCLUSTER_NAMESPACE }}
export KUBERNETES_VERSION=${{ env.KUBERNETES_VERSION }}
export HELM_VALUES=""
kubectl create namespace ${CLUSTER_NAMESPACE}
cat templates/cluster-template.yaml | ./bin/envsubst | kubectl apply -n ${CLUSTER_NAMESPACE} -f -

- name: Validate Resource Ready
run: |
kubectl wait --for=condition=ready vcluster -n ${{ env.VCLUSTER_NAMESPACE }} ${{ env.VCLUSTER_NAME }} --timeout=100s
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
id-token: write
contents: write
steps:
- name: Set up Go 1.18
uses: actions/setup-go@v2
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.22
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- id: get_version
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.18 as builder
FROM golang:1.22 as builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ In the example commands below, the HELM_VALUES variable will be populated with t
```shell
export CLUSTER_NAME=vcluster
export CLUSTER_NAMESPACE=vcluster
export KUBERNETES_VERSION=1.23.0
export KUBERNETES_VERSION=1.26.1
export HELM_VALUES=""
# Uncomment if you want to use vcluster values
# export HELM_VALUES=$(cat devvalues.yaml | sed -z 's/\n/\\n/g')
Expand Down Expand Up @@ -170,7 +170,7 @@ In the example commands below, the HELM_VALUES variable will be populated with t
```shell
export CLUSTER_NAME=test
export CLUSTER_NAMESPACE=test
export KUBERNETES_VERSION=1.24.0
export KUBERNETES_VERSION=1.26.1
export HELM_VALUES=$(cat devvalues.yaml | sed -z 's/\n/\\n/g')
kubectl create namespace ${CLUSTER_NAMESPACE}
cat templates/cluster-template.yaml | ./bin/envsubst | kubectl apply -n ${CLUSTER_NAMESPACE} -f -
Expand Down
3 changes: 2 additions & 1 deletion devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ dev:
- '!/go.mod'
- '!/go.sum'
- '!/devspace_start.sh'
- 'Makefile'
- '!/Makefile'
- '!/Dockerfile'

commands:
dev: |-
Expand Down