fix cve 2024-34156 #348
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2024 StreamNative | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: Operator E2e tests | |
on: | |
pull_request: | |
branches: | |
- '*' | |
paths: | |
- '**.go' | |
- '.github/workflows/e2e_test.yml' | |
jobs: | |
e2e-test: | |
name: E2e tests for Operators | |
strategy: | |
matrix: | |
alwaysUpdatePulsar: [ "true", "false" ] | |
runs-on: ubuntu-latest | |
env: | |
ALWAYS_UPDATE_PULSAR_RESOURCE: ${{ matrix.alwaysUpdatePulsar }} | |
GOPRIVATE: github.com/streamnative | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
IMAGE: streamnative/sn-platform:2.10.4.3 | |
WATCH_CERT_MANAGER_CRDS: "false" | |
steps: | |
- name: clean disk | |
run: | | |
df -h | |
sudo swapoff -a | |
sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
sudo apt clean | |
docker rmi $(docker images -q) -f | |
df -h | |
- name: Set up Go 1.22.7 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.22.7' | |
id: go | |
- name: Set up Git token | |
run: | | |
git config --global url."https://${ACCESS_TOKEN}:@github.com/".insteadOf "https://github.com/" | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
registry: docker.io | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up Ginkgo | |
run: | | |
go install github.com/onsi/ginkgo/ginkgo@latest | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# TODO the k8s version should be configurable | |
- name: Setup K8s cluster | |
run: | | |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64 | |
chmod +x ./kind | |
export PATH="$PWD:$PATH" | |
kind version | |
./hack/kind-cluster-build.sh --nodeNum 1 --k8sVersion v1.22.17 | |
- name: Initialize K8s cluster | |
run: | | |
docker pull "$IMAGE" | |
kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$IMAGE" | |
docker pull docker.cloudsmith.io/streamnative/operators/kubebuilder/kube-rbac-proxy:v0.8.0 | |
kind load docker-image --name pulsar-dev docker.cloudsmith.io/streamnative/operators/kubebuilder/kube-rbac-proxy:v0.8.0 | |
df -h | |
- name: Install Pulsar Operators and sn-platform | |
run: | | |
helm repo add streamnative https://charts.streamnative.io | |
helm repo add jetstack https://charts.jetstack.io | |
helm repo update | |
helm install cert-manager jetstack/cert-manager --set installCRDs=true --version v1.8.2 | |
rm -rf pulsar-charts/ | |
git clone --branch pulsar-operator-0.17.10 https://github.com/streamnative/charts.git pulsar-charts | |
cd pulsar-charts/ | |
./scripts/pulsar/prepare_helm_release.sh -n default -k test -c | |
helm repo add grafana https://grafana.github.io/helm-charts | |
helm repo update | |
helm dependency update charts/pulsar | |
helm install test --set initialize=true --values ../.ci/clusters/values.yaml charts/pulsar | |
df -h | |
- name: Build and Setup Pulsar Resources Operator | |
run: | | |
make docker-build | |
kind load docker-image --name pulsar-dev controller:latest | |
make deploy | |
kubectl get crds | |
kubectl wait --for condition=available --timeout=360s deployment/pulsar-resources-operator-controller-manager -npulsar-resources-operator-system | |
df -h | |
- name: Run Operator Test | |
run: | | |
cd tests | |
go mod tidy | |
~/go/bin/ginkgo --trace --progress ./operator | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 15 | |
if: failure() |