Skip to content

chore: bump go and k8s deps #381

chore: bump go and k8s deps

chore: bump go and k8s deps #381

Workflow file for this run

name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
new:
runs-on: ubuntu-latest
name: Testing New Projects
steps:
- name: Set up Golang
uses: actions/[email protected]
with:
go-version: 1.21
- uses: actions/[email protected]
with:
path: go/src/sigs.k8s.io/apiserver-builder-alpha/
- name: Install
working-directory: ${{ github.workspace }}/go/src/sigs.k8s.io/apiserver-builder-alpha/
env:
GOPATH: ${{ github.workspace }}/go
run: |
make install
- name: Testing on new project
env:
GOBIN: ${{ github.workspace }}/go/bin
working-directory: ${{ github.workspace }}/go/src/sigs.k8s.io/apiserver-builder-alpha/
run: |
export PATH=${PATH}:${GOBIN}
export TESTDIR=$(mktemp -d)
make test -f Makefile.test
diff -rq --exclude=bin ./test/golden $TESTDIR
basic-example-build:
runs-on: ubuntu-latest
name: Testing Basic Example
steps:
- name: Set up Golang
uses: actions/[email protected]
with:
go-version: 1.17
- name: Install controller-tools
env:
GO111MODULE: on
run: |
go mod init sigs.k8s.io/workspace
go get sigs.k8s.io/controller-tools/cmd/[email protected]
go install sigs.k8s.io/controller-tools/cmd/controller-gen
- uses: actions/[email protected]
with:
path: go/src/sigs.k8s.io/apiserver-builder-alpha/
- name: Testing on examples
working-directory: ${{ github.workspace }}/go/src/sigs.k8s.io/apiserver-builder-alpha/example/basic
env:
GOPATH: ${{ github.workspace }}/go
GOBIN: ${{ github.workspace }}/go/bin
run: |
controller-gen +object +paths=./pkg/apis/...
export PATH=${PATH}:${GOBIN}
go test ./pkg/...
basic-example-container:
runs-on: ubuntu-latest
name: Testing Basic Example Container Build
steps:
- name: Set up Golang
uses: actions/[email protected]
with:
go-version: 1.17
- uses: actions/[email protected]
with:
path: go/src/sigs.k8s.io/apiserver-builder-alpha/
- name: Create k8s Kind Cluster
uses: helm/[email protected]
- name: Install apiserver-boot
working-directory: ${{ github.workspace }}/go/src/sigs.k8s.io/apiserver-builder-alpha/
env:
GOPATH: ${{ github.workspace }}/go
run: |
make install
- name: Install controller-tools
env:
GO111MODULE: on
run: |
go mod init sigs.k8s.io/workspace
go get sigs.k8s.io/controller-tools/cmd/[email protected]
go install sigs.k8s.io/controller-tools/cmd/controller-gen
- name: Building and running container images
working-directory: ${{ github.workspace }}/go/src/sigs.k8s.io/apiserver-builder-alpha/example/basic
env:
GOPATH: ${{ github.workspace }}/go
GOBIN: ${{ github.workspace }}/go/bin
run: |
export PATH=${PATH}:${GOBIN}
controller-gen +object +paths=./pkg/apis/...
export IMAGE="example.io/basic"
apiserver-boot build container --image ${IMAGE}
kind load docker-image ${IMAGE} --name chart-testing
kubectl create -f config/
kubectl wait --for=condition=Available --timeout=180s apiservice/v1.kingsport.k8s.io
kubectl create -f sample/festival.yaml
sleep 20 # Hold for a while
kubectl get festival festival-example -o jsonpath="{.spec.invited}" | grep 1 # successfully processed by controller
kubectl create -f sample/university.yaml
kubectl get university university-example -o jsonpath="{.spec.facultySize}" | grep 1
kubectl replace --raw="/apis/miskatonic.k8s.io/v1beta1/namespaces/default/universities/university-example/scale" -f sample/university_scale.json # scale subresource
kubectl get university university-example -o jsonpath="{.spec.facultySize}" | grep 2
apiserver-boot show resource festivals
kine-example-container:
runs-on: ubuntu-latest
name: Testing Kine Example Container Build
steps:
- name: Set up Golang
uses: actions/[email protected]
with:
go-version: 1.17
- uses: actions/[email protected]
with:
path: go/src/sigs.k8s.io/apiserver-builder-alpha/
- name: Create k8s Kind Cluster
uses: helm/[email protected]
- name: Install apiserver-boot
working-directory: ${{ github.workspace }}/go/src/sigs.k8s.io/apiserver-builder-alpha/
env:
GOPATH: ${{ github.workspace }}/go
run: |
mkdir -p bin
make install
- name: Install controller-tools
env:
GO111MODULE: on
run: |
go mod init sigs.k8s.io/workspace
go get sigs.k8s.io/controller-tools/cmd/[email protected]
go install sigs.k8s.io/controller-tools/cmd/controller-gen
- name: Building and running container images
working-directory: ${{ github.workspace }}/go/src/sigs.k8s.io/apiserver-builder-alpha/example/kine
env:
GOPATH: ${{ github.workspace }}/go
GOBIN: ${{ github.workspace }}/go/bin
run: |
export PATH=${PATH}:${GOBIN}
controller-gen +object +paths=./pkg/apis/...
export IMAGE="example.io/kine"
apiserver-boot build container --image ${IMAGE}
kind load docker-image ${IMAGE} --name chart-testing
kubectl create -f config/
kubectl wait --for=condition=Available --timeout=180s apiservice/v1.mysql.example.com
kubectl create -f sample/tiger.yaml
apiserver-boot show resource tigers
sleep 20 # Hold for a while
kubectl get tiger tiger-example -o jsonpath="{.status.hungry}" | grep "true" # successfully processed by controller