Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .github/workflows/build-controller-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
name: Build Image for controller-manager
steps:
- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: 1.17.x
go-version: 1.25

- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-monitoring-agent-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
name: Build Image for monitoring-agent-proxy
steps:
- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: 1.17.x
go-version: 1.25

- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-monitoring-block-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ jobs:
name: Build Image for monitoring-block-manager
steps:
- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: 1.17.x
go-version: 1.25

- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-monitoring-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
name: Build Image for monitoring-gateway
steps:
- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: 1.17.x
go-version: 1.25

- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-release-multiarch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
GO111MODULE: on
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: '1.21'
go-version: '1.25'

- name: Test
run: make test
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand All @@ -22,12 +22,12 @@ jobs:
with:
version: v3.9.2

- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.13'

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.7.0
uses: helm/chart-testing-action@v2.8.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -47,7 +47,7 @@ jobs:
run: ct lint --config .github/linters/ct.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.12.0
uses: helm/kind-action@v1.13.0
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*.dylib
bin
testbin/*
.cache/*
.gocache/*

# Test binary, build with `go test -c`
*.test
Expand Down
40 changes: 40 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Repository Guidelines

## Project Structure & Modules
- `cmd/`: entrypoints for controller manager, monitoring gateway, agent proxy, and block manager; binaries land in `bin/` after builds.
- `pkg/`: core controllers, API types, and library code; prefer adding shared helpers here before reusing in `cmd/`.
- `config/`: Kubernetes manifests, CRDs (`config/crd`), kustomize overlays, and bundle output; charts live under `charts/`.
- `docs/` and `tools/docs/`: user/developer docs and CRD doc generator templates; update when behavior or APIs change.
- `test/`: Go unit/integration tests plus `test/e2e` for Ginkgo-based suites.
- `hack/`, `build/`, `config/manager`: scripts, Dockerfiles, and kustomize bases used by CI and releases.

## Build, Test, and Development Commands
- `make help`: list available targets.
- `make build`: generate code, format, vet, and build Go binaries into `bin/`.
- `make test`: run unit/integration tests (excluding e2e) with envtest; produces `cover.out`.
- `make test-e2e`: run end-to-end suite in `test/e2e` (requires a Kind-accessible cluster).
- `make lint` / `make lint-fix`: run or auto-fix `golangci-lint`.
- `make docker-build`: build container images for the four components using Docker or `CONTAINER_CLI`.
- Deployment helpers: `make install|uninstall` for CRDs, `make deploy|undeploy` for controller-manager to the current kubeconfig.

## Coding Style & Naming
- Go 1.25 module; rely on `gofmt` via `make fmt` and static checks via `make vet`/`make lint`.
- Package paths are lowercase; exported types/functions should include the domain concept (e.g., `TenantReconciler`, `GatewayOptions`).
- Tests live next to code with `_test.go` suffix; prefer table-driven cases and minimal global state.
- YAML manifests and Helm values use lowercase hyphenated keys; keep CRD fields consistent with existing API naming.

## Testing Guidelines
- Unit/integration: `make test` (runs with controller-runtime envtest assets). Aim to keep `cover.out` committed only when needed for reporting.
- End-to-end: `make test-e2e -ginkgo.focus=<regex>` when scoping; expect a running cluster and necessary CRDs installed.
- Add fixtures under `test/` and avoid hard-coded cluster credentials in tests; use env vars for endpoints/secrets.

## Commit & Pull Request Expectations
- Commits in this repo are short, imperative messages (e.g., `fix port shadowing`, `upgrade dependencies`); keep them scoped and consistent.
- Before opening a PR: run `make lint` and `make test`; include relevant logs or screenshots for UI/chart changes.
- PR descriptions should summarize behavior changes, list test commands executed, and link related issues. Update docs (`docs/` or chart README) and CRD manifests when APIs or defaults shift.
- For Kubernetes-facing changes, describe rollout/rollback considerations and any required configuration migrations.

## Security & Configuration Tips
- Do not commit kubeconfig, secrets, or cloud credentials; prefer env vars and sample manifests under `config/samples`.
- When modifying CRDs, regenerate manifests with `make manifests` and keep stripped-down CRDs in `charts/whizard-crds/` aligned via `make stripped-down-crds`.
- Container builds default to `docker`; set `CONTAINER_CLI=podman` or platform flags via `CONTAINER_BUILD_EXTRA_ARGS` if needed.
2 changes: 1 addition & 1 deletion build/controller-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.24 as builder
FROM golang:1.25 as builder
ARG GOPROXY

WORKDIR /workspace
Expand Down
2 changes: 1 addition & 1 deletion build/monitoring-agent-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.24 as builder
FROM golang:1.25 as builder
ARG GOPROXY

WORKDIR /workspace
Expand Down
4 changes: 2 additions & 2 deletions build/monitoring-block-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.24 as builder
FROM golang:1.25 as builder
ARG GOPROXY

WORKDIR /workspace
Expand All @@ -19,7 +19,7 @@ RUN CGO_ENABLED=0 go build -a -o block-manager cmd/monitoring-block-manager/bloc

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM thanosio/thanos:v0.37.2
FROM thanosio/thanos:v0.40.1
WORKDIR /
COPY --from=builder /workspace/block-manager .
USER 65532:65532
Expand Down
2 changes: 1 addition & 1 deletion build/monitoring-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.24 as builder
FROM golang:1.25 as builder
ARG GOPROXY

WORKDIR /workspace
Expand Down
2 changes: 1 addition & 1 deletion cmd/monitoring-gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"runtime/debug"
"syscall"

"github.com/alecthomas/kingpin/v2"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/oklog/run"
Expand All @@ -30,7 +31,6 @@ import (
versioncollector "github.com/prometheus/client_golang/prometheus/collectors/version"
"github.com/prometheus/common/version"
"go.uber.org/automaxprocs/maxprocs"
"gopkg.in/alecthomas/kingpin.v2"

"github.com/thanos-io/thanos/pkg/extkingpin"
"github.com/thanos-io/thanos/pkg/logging"
Expand Down
16 changes: 6 additions & 10 deletions config/crd/bases/monitoring.whizard.io_compactors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@ spec:
most preferred is the one with the greatest sum of weights, i.e.
for each node that meets all of the scheduling requirements (resource
request, requiredDuringScheduling anti-affinity expressions, etc.),
compute a sum by iterating through the elements of this field and adding
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
compute a sum by iterating through the elements of this field and subtracting
"weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the
node(s) with the highest sum are the most preferred.
items:
description: The weights of all of the matched WeightedPodAffinityTerm
Expand Down Expand Up @@ -1210,15 +1210,13 @@ spec:
volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
If specified, the CSI driver will create or update the volume with the attributes defined
in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass
will be applied to the claim but it's not allowed to reset this field to empty string once it is set.
If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass
will be set by the persistentvolume controller if it exists.
it can be changed after the claim is created. An empty string or nil value indicates that no
VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state,
this field can be reset to its previous value (including nil) to cancel the modification.
If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
(Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
Expand Down Expand Up @@ -1383,13 +1381,11 @@ spec:
description: |-
currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using.
When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim
This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
type: string
modifyVolumeStatus:
description: |-
ModifyVolumeStatus represents the status object of ControllerModifyVolume operation.
When this is unset, there is no ModifyVolume operation being attempted.
This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
properties:
status:
description: "status is the status of the ControllerModifyVolume
Expand Down Expand Up @@ -1553,7 +1549,7 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.

This is an alpha field and requires enabling the
This field depends on the
DynamicResourceAllocation feature gate.

This field is immutable. It can only be set for containers.
Expand Down
6 changes: 3 additions & 3 deletions config/crd/bases/monitoring.whizard.io_gateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ spec:
most preferred is the one with the greatest sum of weights, i.e.
for each node that meets all of the scheduling requirements (resource
request, requiredDuringScheduling anti-affinity expressions, etc.),
compute a sum by iterating through the elements of this field and adding
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
compute a sum by iterating through the elements of this field and subtracting
"weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the
node(s) with the highest sum are the most preferred.
items:
description: The weights of all of the matched WeightedPodAffinityTerm
Expand Down Expand Up @@ -1102,7 +1102,7 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.

This is an alpha field and requires enabling the
This field depends on the
DynamicResourceAllocation feature gate.

This field is immutable. It can only be set for containers.
Expand Down
18 changes: 7 additions & 11 deletions config/crd/bases/monitoring.whizard.io_ingesters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ spec:
most preferred is the one with the greatest sum of weights, i.e.
for each node that meets all of the scheduling requirements (resource
request, requiredDuringScheduling anti-affinity expressions, etc.),
compute a sum by iterating through the elements of this field and adding
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
compute a sum by iterating through the elements of this field and subtracting
"weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the
node(s) with the highest sum are the most preferred.
items:
description: The weights of all of the matched WeightedPodAffinityTerm
Expand Down Expand Up @@ -1214,15 +1214,13 @@ spec:
volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
If specified, the CSI driver will create or update the volume with the attributes defined
in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass
will be applied to the claim but it's not allowed to reset this field to empty string once it is set.
If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass
will be set by the persistentvolume controller if it exists.
it can be changed after the claim is created. An empty string or nil value indicates that no
VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state,
this field can be reset to its previous value (including nil) to cancel the modification.
If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
(Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
Expand Down Expand Up @@ -1387,13 +1385,11 @@ spec:
description: |-
currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using.
When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim
This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
type: string
modifyVolumeStatus:
description: |-
ModifyVolumeStatus represents the status object of ControllerModifyVolume operation.
When this is unset, there is no ModifyVolume operation being attempted.
This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
properties:
status:
description: "status is the status of the ControllerModifyVolume
Expand Down Expand Up @@ -1499,7 +1495,7 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.

This is an alpha field and requires enabling the
This field depends on the
DynamicResourceAllocation feature gate.

This field is immutable. It can only be set for containers.
Expand Down Expand Up @@ -1632,7 +1628,7 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.

This is an alpha field and requires enabling the
This field depends on the
DynamicResourceAllocation feature gate.

This field is immutable. It can only be set for containers.
Expand Down
Loading
Loading