Skip to content

feat: CRD updates

feat: CRD updates #72

Workflow file for this run

name: Operator CI
on:
pull_request:
paths:
- 'kubernetes/operator/**'
- 'kubernetes/helm/operator/**'
- '.github/workflows/operator-ci.yml'
push:
branches:
- main
paths:
- 'kubernetes/operator/**'
- 'kubernetes/helm/operator/**'
jobs:
ci:
name: fmt / vet / lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: kubernetes/operator
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: kubernetes/operator/go.mod
cache-dependency-path: kubernetes/operator/go.sum
- name: go fmt
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "The following files are not formatted:"
echo "$unformatted"
exit 1
fi
- name: go vet
run: go vet ./...
- name: Install controller-gen
run: GOBIN=$(pwd)/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.4
- name: Check generated manifests are up to date
run: |
./bin/controller-gen rbac:roleName=manager-role crd paths="./..." \
output:crd:artifacts:config=config/crd/bases \
output:rbac:artifacts:config=config/rbac
git diff --exit-code config/
- name: Check generated deepcopy is up to date
run: |
./bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
git diff --exit-code api/
- name: go test
run: go test ./... -race -coverprofile=cover.out
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.11.4
working-directory: kubernetes/operator
helm:
name: Helm lint and verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: 'v3.14.0'
- name: Lint Helm chart
run: helm lint kubernetes/helm/operator
- name: Template Helm chart
run: |
helm template openrag-operator kubernetes/helm/operator \
--namespace openrag-control \
--debug
- name: Verify CRD symlink
run: |
if [ ! -L kubernetes/helm/operator/crds/openr.ag_openrags.yaml ]; then
echo "Error: CRD file is not a symlink"
exit 1
fi
echo "CRD symlink verified"
docker:
name: Docker build check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Build image (no push)
uses: docker/build-push-action@v6
with:
context: kubernetes/operator
file: kubernetes/operator/Dockerfile
platforms: linux/amd64
push: false
cache-from: type=gha,scope=operator-amd64
cache-to: type=gha,mode=max,scope=operator-amd64