Skip to content

Merge pull request #95 from gubernator-io/thrawn/dependabot #1

Merge pull request #95 from gubernator-io/thrawn/dependabot

Merge pull request #95 from gubernator-io/thrawn/dependabot #1

Workflow file for this run

name: E2E
on:
pull_request:
branches: [ master ]
push:
branches:
- master
jobs:
e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create k8s Kind Cluster
id: kind
uses: helm/kind-action@v1.14.0
with:
version: 'v0.27.0'
registry: true
registry_name: gubernator-io
registry_port: 5001
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
cache-dependency-path: './go.sum'
check-latest: true
- name: Build and push
env:
LOCAL_REGISTRY: ${{ steps.kind.outputs.LOCAL_REGISTRY }}
run: |
# Extract host:port from LOCAL_REGISTRY (remove http:// or https:// if present)
REGISTRY_HOST_PORT=$(echo $LOCAL_REGISTRY | sed 's|^http://||' | sed 's|^https://||')
# Configure Docker daemon to allow insecure registries
echo "{\"insecure-registries\": [\"$REGISTRY_HOST_PORT\"]}" | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker || true
# Wait for docker to be ready
timeout 30 bash -c 'until docker info; do sleep 1; done'
# Build and push the image to the local registry
docker build . -t $LOCAL_REGISTRY/gubernator
docker push $LOCAL_REGISTRY/gubernator
- name: Deploy
run: |
helm install gubernator \
--set gubernator.image.repository=${{ steps.kind.outputs.LOCAL_REGISTRY }}/gubernator \
--set gubernator.serviceAccount.create=true \
--set gubernator.debug=true \
./contrib/charts/gubernator
kubectl wait --timeout=60s --for=condition=available deployment/gubernator
- name: Test
run: |
kubectl port-forward deployment/gubernator 1050 1051 &
GUBER_HTTP_RETRY_COUNT=30 go run ./cmd/healthcheck
- name: k8s contents
if: always()
run: |
echo "===="
kubectl get deployments
echo "===="
kubectl describe deployments
echo "===="
kubectl get pods
echo "===="
kubectl describe pods
- name: k8s logs
if: always()
run: |
kubectl logs deployment/gubernator