Skip to content

When remote storage is in place allow the operator to recreate pods instead or replace pods #2950

When remote storage is in place allow the operator to recreate pods instead or replace pods

When remote storage is in place allow the operator to recreate pods instead or replace pods #2950

Workflow file for this run

name: Integration checks
on:
push:
branches:
- main
pull_request:
env:
FDB_VER: "6.2.29"
jobs:
lint-go:
name: Lint go code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.20.6
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- 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.21.1", "v1.22.0", "v1.23.0" ]
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.20.6
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: Get dependencies
env:
KIND_VER: "v0.11.1"
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 "::set-output name=CURRENT_TAG::$(git describe --tags --match "v*" --abbrev=0)"
id: current-tag
- name: Check for uncommitted changes
env:
# Don't run any tests we run them in the next step
SKIP_TEST: "1"
GORELEASER_CURRENT_TAG: ${{ steps.current-tag.outputs.CURRENT_TAG }}
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: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.20.6
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- 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
- fdb-kubernetes-operator-distroless
include:
- image: fdb-kubernetes-operator
context: ./
name: foundationdb/fdb-kubernetes-operator
tagSuffix: ""
file: ./Dockerfile
baseImage: "docker.io/debian:bullseye"
- image: fdb-kubernetes-operator-distroless
context: ./
name: foundationdb/fdb-kubernetes-operator
tagSuffix: -distrolesss
file: ./Dockerfile
baseImage: "gcr.io/distroless/base"
- image: fdb-data-loader
context: ./sample-apps/data-loader
name: foundationdb/fdb-data-loader
tagSuffix: ""
file: ./sample-apps/data-loader/Dockerfile
baseImage: ""
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get the sha
id: get_sha
run: echo ::set-output name=TAG::${GITHUB_SHA}
- name: Build image
uses: docker/build-push-action@v2
with:
build-args: |
TAG=${{ steps.get_sha.outputs.TAG }}
BASE_IMAGE=${{ matrix.baseImage }}
push: ${{ github.ref == 'refs/heads/main' }}
context: ${{ matrix.context }}
tags: ${{ matrix.name }}:latest${{ matrix.tagSuffix }}
file: ${{ matrix.file }}