Skip to content

Introduce health sidecar to better integrate with PDB #711

Introduce health sidecar to better integrate with PDB

Introduce health sidecar to better integrate with PDB #711

name: Functional tests
on: [pull_request]
jobs:
operator:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.work'
cache: false
- uses: nolar/setup-k3d-k3s@v1
with:
version: v1
k3d-name: opensearch-operator-tests
k3d-args: --agents 2 -p 30000-30005:30000-30005@agent:0
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
set -e
export CLUSTER_NAME=opensearch-operator-tests
## Check disk to avoid failed shard assignments due to watermarking
df -h
## Build sidecar docker image and import into k3d
cd operator-sidecar
IMG=operator-sidecar:test make docker-build
k3d image import -c $CLUSTER_NAME operator-sidecar:test
cd ../opensearch-operator
## Prepare kubeconfig
k3d kubeconfig get $CLUSTER_NAME > functionaltests/kubeconfig
export KUBECONFIG=$(pwd)/functionaltests/kubeconfig
## Build controller docker image
make docker-build
## Import controller docker image
k3d image import -c $CLUSTER_NAME controller:latest
## Install helm chart
helm install opensearch-operator ../charts/opensearch-operator \
--set manager.image.repository=controller \
--set manager.image.tag=latest \
--set manager.image.pullPolicy=IfNotPresent \
--set operatorSidecar.image=operator-sidecar:test \
--namespace default --wait
cd functionaltests
## Run tests
go test ./operatortests -timeout 30m
cluster-helm-chart:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- 2.13.0
- 1.3.16
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.work'
cache: false
- uses: nolar/setup-k3d-k3s@v1
with:
version: v1
k3d-name: opensearch-operator-tests
k3d-args: --agents 2 -p 30000-30005:30000-30005@agent:0
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
set -e
export CLUSTER_NAME=opensearch-operator-tests
## Check disk to avoid failed shard assignments due to watermarking
df -h
## Build sidecar docker image and import into k3d
cd operator-sidecar
IMG=operator-sidecar:test make docker-build
k3d image import -c $CLUSTER_NAME operator-sidecar:test
cd ../opensearch-operator
## Prepare kubeconfig
k3d kubeconfig get $CLUSTER_NAME > functionaltests/kubeconfig
export KUBECONFIG=$(pwd)/functionaltests/kubeconfig
## Build controller docker image
make docker-build
## Import controller docker image
k3d image import -c $CLUSTER_NAME controller:latest
## Install helm charts
helm install opensearch-operator ../charts/opensearch-operator \
--set manager.image.repository=controller \
--set manager.image.tag=latest \
--set manager.image.pullPolicy=IfNotPresent \
--set operatorSidecar.image=operator-sidecar:test \
--namespace default --wait
kubectl apply -f functionaltests/rbac.yaml
helm install opensearch-cluster ../charts/opensearch-cluster \
--set opensearchCluster.general.version=${{ matrix.version }} \
--set opensearchCluster.dashboards.version=${{ matrix.version }} \
-f functionaltests/helm-cluster-values.yaml \
--wait
cd functionaltests
## Run tests
go test ./helmtests -timeout 15m