Skip to content

Shorten UpdateNodeLabelsAndRecordEvents function in nmc_reconciler.go #2155

Shorten UpdateNodeLabelsAndRecordEvents function in nmc_reconciler.go

Shorten UpdateNodeLabelsAndRecordEvents function in nmc_reconciler.go #2155

Workflow file for this run

name: e2e
on: [pull_request]
env:
GO_VERSION: '1.22'
jobs:
build-operator-image:
runs-on: ubuntu-20.04
name: Build the KMMO container image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make docker-build IMG=kmm:local
- name: Export the image
run: docker save -o kmm_local.tar kmm:local
- name: Upload the image
uses: actions/upload-artifact@v4
with:
name: ci-image-kmm
if-no-files-found: error
path: kmm_local.tar
retention-days: 1
build-operator-hub-image:
runs-on: ubuntu-20.04
name: Build the KMMO-hub container image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make docker-build-hub HUB_IMG=kmm-hub:local
- name: Export the image
run: docker save -o kmm-hub_local.tar kmm-hub:local
- name: Upload the image
uses: actions/upload-artifact@v4
with:
name: ci-image-kmm-hub
if-no-files-found: error
path: kmm-hub_local.tar
retention-days: 1
build-signing-image:
runs-on: ubuntu-20.04
name: Build the signing image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make signimage-build SIGNER_IMG=kmm-signimage:local
- name: Export the image
run: docker save -o kmm-signimage_local.tar kmm-signimage:local
- name: Upload the image
uses: actions/upload-artifact@v4
with:
name: ci-image-signer
if-no-files-found: error
path: kmm-signimage_local.tar
retention-days: 1
build-worker-image:
runs-on: ubuntu-20.04
name: Build the worker image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make workerimage-build WORKER_IMG=kmm-worker:local
- name: Export the image
run: docker save -o kmm-worker_local.tar kmm-worker:local
- name: Upload the image
uses: actions/upload-artifact@v4
with:
name: ci-image-worker
if-no-files-found: error
path: kmm-worker_local.tar
retention-days: 1
build-webhook-image:
runs-on: ubuntu-20.04
name: Build the webhook server image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make webhookimage-build WEBHOOK_IMG=kmm-webhook-server:local
- name: Export the image
run: docker save -o kmm-webhook-server_local.tar kmm-webhook-server:local
- name: Upload the image
uses: actions/upload-artifact@v4
with:
name: ci-image-webhook-server
if-no-files-found: error
path: kmm-webhook-server_local.tar
retention-days: 1
e2e:
strategy:
matrix:
include:
- name: e2e
env:
KUSTOMIZE_CONFIG_DEFAULT: ci/install-ci
script: ./ci/prow/e2e-incluster-build
- name: e2e-hub
env:
KUSTOMIZE_CONFIG_HUB_DEFAULT: ci/install-ci-hub
KUSTOMIZE_CONFIG_DEFAULT: ci/install-ci-spoke
import_hub_image: true
script: ./ci/prow/e2e-hub-spoke-incluster-build
runs-on: ubuntu-20.04
name: ${{ matrix.name }}
needs: [build-operator-image, build-operator-hub-image, build-signing-image, build-webhook-image, build-worker-image]
services:
registry:
image: registry:2
ports: ['5000:5000/tcp']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create the minikube cluster
uses: ./.github/actions/create-minikube-cluster
- name: Download container images
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Import the KMM operator, webhook server and worker images into minikube
run: |
minikube image load artifacts/ci-image-kmm/kmm_local.tar
minikube image load artifacts/ci-image-webhook-server/kmm-webhook-server_local.tar
minikube image load artifacts/ci-image-worker/kmm-worker_local.tar
- name: Import the KMM-hub operator image into minikube
run: minikube image load artifacts/ci-image-kmm-hub/kmm-hub_local.tar
if: ${{ matrix.import_hub_image }}
# This image is pulled by the signing pod, so it needs to be stored externally - not in the minikube container runtime.
- name: Copy the signing image into the registry
run: |
docker load -i artifacts/ci-image-signer/kmm-signimage_local.tar
docker tag kmm-signimage:local localhost:5000/kmm/signimage:local
docker push localhost:5000/kmm/signimage:local
- name: Set some Ubuntu environment variables
run: |
grep 'ID=' /etc/os-release >> "$GITHUB_ENV"
grep 'VERSION_ID=' /etc/os-release >> "$GITHUB_ENV"
- name: Cache binaries needed by Makefile
uses: actions/cache@v4
with:
path: ./bin
key: ${{ runner.os }}-${{ env.ID }}-${{ env.VERSION_ID }}-bin-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Run test
run: ${{ matrix.script }}
env:
${{ matrix.env }}
- name: Collect troubleshooting data
uses: ./.github/actions/collect-troubleshooting
if: ${{ always() }}
with:
artifact-name: ${{ matrix.name }}
operator-upgrade:
runs-on: ubuntu-20.04
name: operator-upgrade
needs: [build-operator-image, build-signing-image, build-webhook-image, build-worker-image]
services:
registry:
image: registry:2
ports: ['5000:5000/tcp']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create the minikube cluster
uses: ./.github/actions/create-minikube-cluster
with:
start-args: --insecure-registry=host.minikube.internal:5000
- name: Download container images
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Copy kmm, signing and worker images to the registry
run: |
# KMM is pulled by operator-sdk in the cluster and not by minikube
docker load -i artifacts/ci-image-kmm/kmm_local.tar
docker load -i artifacts/ci-image-signer/kmm-signimage_local.tar
docker load -i artifacts/ci-image-webhook-server/kmm-webhook-server_local.tar
docker load -i artifacts/ci-image-worker/kmm-worker_local.tar
docker tag kmm:local localhost:5000/kmm/kmm:local
docker tag kmm-signimage:local localhost:5000/kmm/signimage:local
docker tag kmm-webhook-server:local localhost:5000/kmm/webhook-server:local
docker tag kmm-worker:local localhost:5000/kmm/worker:local
docker push localhost:5000/kmm/kmm:local
docker push localhost:5000/kmm/signimage:local
docker push localhost:5000/kmm/webhook-server:local
docker push localhost:5000/kmm/worker:local
- name: Set some Ubuntu environment variables
run: |
grep 'ID=' /etc/os-release >> "$GITHUB_ENV"
grep 'VERSION_ID=' /etc/os-release >> "$GITHUB_ENV"
- name: Cache binaries needed by Makefile
uses: actions/cache@v4
with:
path: ./bin
key: ${{ runner.os }}-${{ env.ID }}-${{ env.VERSION_ID }}-bin-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install grpcurl
run: |
curl -LO https://github.com/fullstorydev/grpcurl/releases/download/v1.8.9/grpcurl_1.8.9_linux_x86_64.tar.gz
tar -xvzf grpcurl_1.8.9_linux_x86_64.tar.gz -C /tmp/
chmod +x /tmp/grpcurl
mv /tmp/grpcurl /usr/local/bin/
rm grpcurl_1.8.9_linux_x86_64.tar.gz
- name: Run test
run: ./ci/prow/operator-upgrade
- name: Collect troubleshooting data
uses: ./.github/actions/collect-troubleshooting
if: ${{ always() }}
with:
artifact-name: ${{ github.job }}