Skip to content

Commit

Permalink
Update actions, update operator-sdk + go + Kube (k8ssandra#452)
Browse files Browse the repository at this point in the history
* Update actions and set-output to remove deprecated versions

* Update to operator-sdk 1.25.1, update to go1.19, remove amd64 restriction for building

Update kind to 0.17.0, force Helm version to 3.10.2, update kind Kube to 1.25.2

Update kube from 1.25.0 -> 1.25.3

* Update Red Hat certification pipeline for releases

Use ENVTEST 1.25.x

Upgrade test has to upgrade from 1.12, nothing older will work in Kube 1.25

* Use go version from go.mod

* Fix kustomize download script to detect aarch64 correctly

* Remove unnecessary cache actions, docker-push-action already handles cache
burmanm authored and emerkle826 committed Dec 1, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 8ea80df commit 63d8096
Showing 26 changed files with 271 additions and 541 deletions.
33 changes: 12 additions & 21 deletions .github/actions/run-integ-test/action.yml
Original file line number Diff line number Diff line change
@@ -21,40 +21,31 @@ runs:
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
- name: Set up Go 1.18
uses: actions/setup-go@v1
sudo rm -rf /opt/ghc
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-integ-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-integ-
go-version-file: 'go.mod'
cache: true
- name: Create Kind Cluster
uses: helm/kind-action@v1.3.0
uses: helm/kind-action@v1.4.0
with:
version: v0.14.0
node_image: kindest/node:v1.24.3
version: v0.17.0
node_image: kindest/node:v1.25.3
cluster_name: kind
config: tests/testdata/kind/kind_config_6_workers.yaml
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 3.10.2
id: install_helm
- name: Download cass-operator image
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: cass-operator
path: /tmp
- name: Download system-logger image
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: system-logger
path: /tmp
37 changes: 14 additions & 23 deletions .github/workflows/kindIntegTest.yml
Original file line number Diff line number Diff line change
@@ -12,19 +12,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-integ-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-integ-
uses: docker/setup-buildx-action@v2
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: Dockerfile
context: .
@@ -35,7 +28,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: logger.Dockerfile
push: false
@@ -45,12 +38,12 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Upload cass-operator image
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: cass-operator
path: /tmp/k8ssandra-cass-operator.tar
- name: Upload system-logger image
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: system-logger
path: /tmp/k8ssandra-system-logger.tar
@@ -111,18 +104,18 @@ jobs:
CGO_ENABLED: 0
M_INTEG_DIR: ${{ matrix.integration_test }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name != 'pull_request'
- uses: ./.github/actions/run-integ-test
with:
integration_test: ${{ matrix.integration_test }}
- name: Archive k8s logs
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: k8s-logs-${{ matrix.integration_test }}
path: ./build/kubectl_dump
@@ -131,10 +124,8 @@ jobs:
strategy:
matrix:
version:
- "3.11.7"
- "3.11.11"
- "4.0.0"
- "4.0.3"
- "3.11.14"
- "4.0.7"
include:
- version: 3.11.7
serverImage: k8ssandra/cass-management-api:3.11.7-v0.1.24 # k8ssandra 1.1
@@ -148,18 +139,18 @@ jobs:
M_SERVER_VERSION: ${{ matrix.version }}
M_SERVER_IMAGE: ${{ matrix.serverImage }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name != 'pull_request'
- uses: ./.github/actions/run-integ-test
with:
integration_test: smoke_test_oss
- name: Archive k8s logs
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: k8s-logs-smoke_test_oss-${{ matrix.version }}-${{ matrix.serverImage }}
path: ./build/kubectl_dump
2 changes: 1 addition & 1 deletion .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install Fossa CLI
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash -s -- -b .
51 changes: 16 additions & 35 deletions .github/workflows/operatorBuildAndDeploy.yml
Original file line number Diff line number Diff line change
@@ -13,31 +13,19 @@ jobs:
env:
CGO_ENABLED: 0
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name != 'pull_request'
- name: Set up Go 1.18
uses: actions/setup-go@v1
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version-file: 'go.mod'
cache: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
uses: docker/setup-buildx-action@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
@@ -58,30 +46,23 @@ jobs:
if: github.ref == 'refs/heads/master'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Set git parsed values
id: vars
run: |
echo ::set-output name=sha_short::$(git rev-parse --short=8 ${{ github.sha }})
echo ::set-output name=tag_name::${GITHUB_REF#refs/tags/}
echo ::set-output name=version::$(make version)
echo "sha_short=$(git rev-parse --short=8 ${{ github.sha }})" >> $GITHUB_OUTPUT
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "version=$(make version)" >> $GITHUB_OUTPUT
- name: Build and push
id: docker_build_cass_operator
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: Dockerfile
context: .
@@ -92,7 +73,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and push
id: docker_build_system_logger
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: logger.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
@@ -105,7 +86,7 @@ jobs:
make IMG=k8ssandra/cass-operator:${{ steps.vars.outputs.version }} VERSION=${{ steps.vars.outputs.version }} CHANNEL=dev bundle
- name: Build and push cass-operator-bundle
id: docker_build_cass-operator_bundle
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: bundle.Dockerfile
build-args: |
45 changes: 20 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -14,20 +14,13 @@ jobs:
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go 1.18
uses: actions/setup-go@v1
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version-file: 'go.mod'
cache: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
if: ${{ !env.ACT }}
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ !env.ACT }}
uses: docker/login-action@v2
@@ -45,8 +38,8 @@ jobs:
id: vars
shell: bash
run: |
echo ::set-output name=sha_short::$(git rev-parse --short=8 ${{ github.sha }})
echo ::set-output name=tag_name::${GITHUB_REF#refs/tags/}
echo "sha_short=$(git rev-parse --short=8 ${{ github.sha }})" >> $GITHUB_OUTPUT
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "TARGET_VERSION=$(echo ${GITHUB_REF#refs/tags/} | awk '{print substr($0,2)}')" >> $GITHUB_ENV
- name: Build system-logger
id: docker_build_system-logger
@@ -103,14 +96,15 @@ jobs:
- name: Tag and push images for Red Hat certification
shell: bash
if: ${{ !env.ACT }}
# The double docker login is a workaround for RH's odd login issues
run: |
docker tag k8ssandra/cass-operator:${{ steps.vars.outputs.tag_name}} scan.connect.redhat.com/ospid-18783bca-8f79-459c-aa0b-bda4e71c6ec3/cass-operator:${{ steps.vars.outputs.tag_name}}
docker tag k8ssandra/system-logger:${{ steps.vars.outputs.tag_name}} scan.connect.redhat.com/ospid-6138f998fb33d420b79f0af9/system-logger:${{ steps.vars.outputs.tag_name}}
docker login -u unused scan.connect.redhat.com -p ${{ secrets.CASS_OPERATOR_CONNECT_SECRET }}
docker push scan.connect.redhat.com/ospid-18783bca-8f79-459c-aa0b-bda4e71c6ec3/cass-operator:${{ steps.vars.outputs.tag_name}}
docker login -u unused scan.connect.redhat.com -p ${{ secrets.SYSTEM_LOGGER_CONNECT_SECRET }}
docker push scan.connect.redhat.com/ospid-6138f998fb33d420b79f0af9/system-logger:${{ steps.vars.outputs.tag_name}}
docker tag k8ssandra/cass-operator:${{ steps.vars.outputs.tag_name}} quay.io/redhat-isv-containers/5ebee0e40e3deaf258b160d1:${{ steps.vars.outputs.tag_name}}
docker tag k8ssandra/system-logger:${{ steps.vars.outputs.tag_name}} quay.io/redhat-isv-containers/6138f998fb33d420b79f0af9:${{ steps.vars.outputs.tag_name}}
docker login -u redhat-isv-containers+5ebee0e40e3deaf258b160d1-robot quay.io -p ${{ secrets.CASS_OPERATOR_CONNECT_SECRET }}
docker push quay.io/redhat-isv-containers/5ebee0e40e3deaf258b160d1:${{ steps.vars.outputs.tag_name}}
docker login -u redhat-isv-containers+6138f998fb33d420b79f0af9-robot quay.io -p ${{ secrets.SYSTEM_LOGGER_CONNECT_SECRET }}
docker push quay.io/redhat-isv-containers/6138f998fb33d420b79f0af9:${{ steps.vars.outputs.tag_name}}
- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:
@@ -125,10 +119,11 @@ jobs:
- name: Run preflight checks and submit results
shell: bash
run: |
docker login -u unused scan.connect.redhat.com -p ${{ secrets.CASS_OPERATOR_CONNECT_SECRET }}
preflight check container scan.connect.redhat.com/ospid-18783bca-8f79-459c-aa0b-bda4e71c6ec3/cass-operator:${{ steps.vars.outputs.tag_name}} --certification-project-id=5ebee0e40e3deaf258b160d1 --pyxis-api-token=${{ secrets.PREFLIGHT_KEY }} --submit --docker-config=$HOME/.docker/config.json
docker login -u unused scan.connect.redhat.com -p ${{ secrets.SYSTEM_LOGGER_CONNECT_SECRET }}
preflight check container scan.connect.redhat.com/ospid-6138f998fb33d420b79f0af9/system-logger:${{ steps.vars.outputs.tag_name}} --certification-project-id=6138f998fb33d420b79f0af9 --pyxis-api-token=${{ secrets.PREFLIGHT_KEY }} --submit --docker-config=$HOME/.docker/config.json
docker login -u redhat-isv-containers+5ebee0e40e3deaf258b160d1-robot quay.io -p ${{ secrets.CASS_OPERATOR_CONNECT_SECRET }}
preflight check container quay.io/redhat-isv-containers/5ebee0e40e3deaf258b160d1:${{ steps.vars.outputs.tag_name}} --certification-project-id=5ebee0e40e3deaf258b160d1 --pyxis-api-token=${{ secrets.PREFLIGHT_KEY }} --submit --docker-config=$HOME/.docker/config.json
docker login -u redhat-isv-containers+6138f998fb33d420b79f0af9-robot quay.io -p ${{ secrets.SYSTEM_LOGGER_CONNECT_SECRET }}
preflight check container quay.io/redhat-isv-containers/6138f998fb33d420b79f0af9:${{ steps.vars.outputs.tag_name}} --certification-project-id=6138f998fb33d420b79f0af9 --pyxis-api-token=${{ secrets.PREFLIGHT_KEY }} --submit --docker-config=$HOME/.docker/config.json
- name: Create bundle
shell: bash
if: ${{ !env.ACT }} # Act does not have yq
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@ Changelog for Cass Operator, new PRs should update the `main / unreleased` secti

## unreleased

* [CHANGE] [#447](https://github.com/k8ssandra/cass-operator/issues/447) Update Github actions to remove all deprecated features (set-outputs, node v12 actions)
* [CHANGE] [#448](https://github.com/k8ssandra/cass-operator/issues/448) Update to operator-sdk 1.25.1, update to go 1.19, update to Kubernetes 1.25, remove amd64 restriction on local builds (cass-operator and system-logger will be built for aarch64 also)
* [FEATURE] [#441](https://github.com/k8ssandra/cass-operator/issues/441) Implement a CassandraTask for moving single-token nodes

## v1.13.1
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.18 as builder
FROM golang:1.19 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
@@ -17,7 +17,7 @@ COPY pkg/ pkg/


# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux go build -a -o manager main.go

# Build the UBI image
FROM redhat/ubi8-micro:latest
Loading

0 comments on commit 63d8096

Please sign in to comment.