Skip to content

quality: extend test thanos-operator package #53302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 41 additions & 21 deletions thanos-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
package:
name: thanos-operator
version: 0.3.7
epoch: 29
epoch: 30
description: Kubernetes operator for deploying Thanos
copyright:
- license: Apache-2.0

environment:
contents:
packages:
- busybox
- ca-certificates-bundle
- go

pipeline:
- uses: git-checkout
with:
Expand All @@ -30,19 +23,10 @@ pipeline:
golang.org/x/[email protected]
golang.org/x/[email protected]

- runs: |
# Address CVE-2022-21698 GHSA-69ch-w2m2-3vjp GHSA-69cg-p879-7622

# Mitigate CVE-2022-28948
# Mitigate CVE-2023-39325 and CVE-2023-3978

go mod tidy

go build -o bin/manager main.go
mkdir -p ${{targets.destdir}}/usr/bin
install -Dm755 ./bin/manager ${{targets.destdir}}/usr/bin/manager

- uses: strip
- uses: go/build
with:
packages: .
output: manager

subpackages:
- name: "${{package.name}}-compat"
Expand All @@ -53,6 +37,10 @@ subpackages:
mkdir -p "${{targets.subpkgdir}}"
ln -sf /usr/bin/manager ${{targets.subpkgdir}}/manager
- uses: strip
test:
pipeline:
- runs: |
stat /manager

update:
enabled: true
Expand All @@ -62,7 +50,39 @@ update:
identifier: banzaicloud/thanos-operator

test:
environment:
contents:
packages:
- kubectl
- git
- wait-for-it
- curl
pipeline:
# AUTOGENERATED
- runs: |
manager --help
- uses: test/kwok/cluster
- runs: |
git clone --depth=1 --branch=${{package.version}} https://github.com/banzaicloud/thanos-operator.git
kubectl apply --validate=false -f thanos-operator/charts/thanos-operator/crds/
- name: Launch thanos-operator with dummy kubeconfig
uses: test/daemon-check-output
with:
setup: |
export KUBERNETES_SERVICE_HOST="127.0.0.1"
export KUBERNETES_SERVICE_PORT="8080"

# Create required certificates directory
mkdir -p /tmp/certs
kubectl config view --minify --raw > /tmp/kwok-kubeconfig.yaml
start: |
manager -metrics-addr=:8080 -enable-leader-election=false -kubeconfig=/tmp/kwok-kubeconfig.yaml -verbosity=2
timeout: 30
expected_output: |
starting manager
starting metrics server
Starting Controller
post: |
echo "Verifying metrics endpoint"
curl -sf http://127.0.0.1:8080/metrics
echo "Metrics endpoint is serving as expected"
Loading