Skip to content

Make use of hex string instead of FDB printable to remove test failures because of special characters #4853

Make use of hex string instead of FDB printable to remove test failures because of special characters

Make use of hex string instead of FDB printable to remove test failures because of special characters #4853

Workflow file for this run

name: Integration checks
on:
push:
branches:
- main
pull_request:
env:
FDB_VER: "7.1.67"
jobs:
lint-go:
name: Lint go code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.24.9
- name: Get dependencies
run: curl -L --fail "https://github.com/apple/foundationdb/releases/download/${FDB_VER}/foundationdb-clients_${FDB_VER}-1_amd64.deb" -o fdb.deb
- name: Install dependencies
run: sudo dpkg -i fdb.deb
- name: Run golangci-lint
run: make fmt lint
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# With a new supported Kubernetes version we should adjust the version
# See https://kubernetes.io/releases for the current releases
kubever: [ "v1.30.0", "v1.31.0", "v1.32.0", "v1.33.0" ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.24.9
- name: Fetch all tags
run: git fetch --force --tags
- name: Free disk space
run: bash ${GITHUB_WORKSPACE}/scripts/free_disk_space.sh
- name: Get dependencies
env:
KIND_VER: "v0.29.0"
run: |
# Only download all dependencies
curl -L --fail "https://github.com/apple/foundationdb/releases/download/${FDB_VER}/foundationdb-clients_${FDB_VER}-1_amd64.deb" -o fdb.deb
curl -Lo kind https://kind.sigs.k8s.io/dl/${KIND_VER}/kind-linux-amd64
- name: Install dependencies
env:
KUBE_VERSION: ${{ matrix.kubever }}
run: |
# Install dependencies either from cache or freshly downloaded
sudo dpkg -i fdb.deb
# Install Kind and start a local Kind cluster.
chmod +x kind
sudo mv kind /usr/local/bin/kind
./e2e/scripts/start_kind_cluster.sh
# https://github.com/goreleaser/goreleaser/issues/1311
- name: Get current semver tag
run: echo "GORELEASER_CURRENT_TAG=$(git describe --tags --match "v*" --abbrev=0)" >> $GITHUB_ENV
- name: Check for uncommitted changes
env:
# Don't run any tests we run them in the next step
SKIP_TEST: "1"
run: |
make clean all
git diff --exit-code
- name: Ensure CRD can be upgrade from main
run: |
# Install the current manifests to ensure we can apply the manifests without any issue
kubectl apply -f https://raw.githubusercontent.com/FoundationDB/fdb-kubernetes-operator/main/config/crd/bases/apps.foundationdb.org_foundationdbbackups.yaml
kubectl apply -f https://raw.githubusercontent.com/FoundationDB/fdb-kubernetes-operator/main/config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml
kubectl apply -f https://raw.githubusercontent.com/FoundationDB/fdb-kubernetes-operator/main/config/crd/bases/apps.foundationdb.org_foundationdbrestores.yaml
# Ensure that the CRDs are established
kubectl wait --for condition="established" crd --all
# Ensure we can upgrade the CRD with the current changes
make install
kubectl wait --for condition="established" crd --all
# Add additional buffer time because we do not have a strong signal on
# when the CRD updates are complete.
# TODO: Find a way to get a stronger signal on this.
sleep 60
- name: Ensure samples are in a valid format
run: |
kubectl apply -f ./config/samples --dry-run=server
testing:
name: Testing
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.24.9
- name: Fetch all tags
run: git fetch --force --tags
- name: Get dependencies
run: |
# Only download all dependencies
curl -L --fail "https://github.com/apple/foundationdb/releases/download/${FDB_VER}/foundationdb-clients_${FDB_VER}-1_amd64.deb" -o fdb.deb
- name: Install dependencies
run: |
# Install dependencies either from cache or freshly downloaded
sudo dpkg -i fdb.deb
- name: Run tests
env:
TEST_RACE_CONDITIONS: "1"
run: |
make test
build_images:
name: Build Docker images
runs-on: ubuntu-latest
strategy:
matrix:
image:
- fdb-kubernetes-operator
- fdb-data-loader
include:
- image: fdb-kubernetes-operator
context: ./
name: foundationdb/fdb-kubernetes-operator
file: ./Dockerfile
- image: fdb-data-loader
context: ./sample-apps/data-loader
name: foundationdb/fdb-data-loader
file: ./sample-apps/data-loader/Dockerfile
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v5
with:
build-args: |
TAG=${{ github.sha }}
push: ${{ github.ref == 'refs/heads/main' }}
context: ${{ matrix.context }}
tags: ${{ matrix.name }}:latest
file: ${{ matrix.file }}
platforms: linux/amd64,linux/arm64
# Disable trivy for now as it reports already fixed vulnerabilites
# - name: Run Trivy vulnerability scanner
# if: ${{ matrix.name == 'foundationdb/fdb-kubernetes-operator' }}
# uses: aquasecurity/trivy-action@master
# with:
# image-ref: "docker.io/${{ matrix.name }}:latest"
# format: 'table'
# exit-code: '1'
# ignore-unfixed: true
# vuln-type: 'os,library'
# severity: 'CRITICAL,HIGH'