Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fafd546
feat: Initial e2e tests and migrate old ones into e2e
TheiLLeniumStudios Jan 8, 2026
46e7d74
Merge master into feat/e2e-test
TheiLLeniumStudios Jan 9, 2026
f0e6d3a
feat: A lot of refactoring and CSI test cases
TheiLLeniumStudios Jan 10, 2026
883ce07
test: remove redundant comments and clean up test code
TheiLLeniumStudios Jan 14, 2026
b35016c
test: A lot more cleanup and formatting for tests
TheiLLeniumStudios Jan 14, 2026
4f25482
feat: Add missing tests for edge cases and all other workload types f…
TheiLLeniumStudios Jan 14, 2026
b28f1ab
fix: Formatting and issue with creating vault secrets
TheiLLeniumStudios Jan 14, 2026
c45b416
feat: Switch to using watches instead of manual sleeps
TheiLLeniumStudios Jan 14, 2026
4872982
refactor: Move handle watch behavior to separate function
TheiLLeniumStudios Jan 14, 2026
ad8ab63
chore: Fix formatting for entry based tests
TheiLLeniumStudios Jan 14, 2026
72a0976
ci: Run e2e tests after unit tests
TheiLLeniumStudios Jan 14, 2026
6ac8f5d
fix: make e2e scripts executable
TheiLLeniumStudios Jan 14, 2026
082b7cc
chore: Cleanup a lot of code
TheiLLeniumStudios Jan 14, 2026
6397ef1
chore: Remove unused function
TheiLLeniumStudios Jan 14, 2026
7374553
fix: empty slices instead of nil return
TheiLLeniumStudios Jan 21, 2026
c83699c
Add claude init
faizanahmad055 May 10, 2026
84f2ca3
Fix conflicts
faizanahmad055 May 11, 2026
e8d79c6
Fix PR issues
faizanahmad055 May 11, 2026
b5c8705
Refactor code
faizanahmad055 May 11, 2026
199587d
Merge branch 'master' of github.com:stakater/Reloader into takeover-e…
faizanahmad055 May 11, 2026
96ac8d1
Refactor code and fix leader election tests
faizanahmad055 May 11, 2026
caebfd9
Add e2e parallel
faizanahmad055 May 11, 2026
2d1c05e
Revert e2e parallel
faizanahmad055 May 11, 2026
90f0768
Fix formatting
faizanahmad055 May 11, 2026
43032d3
Fix typo
faizanahmad055 May 11, 2026
ce60195
Change GINKGO_PROCS to 4
faizanahmad055 May 11, 2026
9b60268
Change GINKGO_PROCS to 1
faizanahmad055 May 12, 2026
d91cb8e
Change GINKGO_PROCS to 4
faizanahmad055 May 12, 2026
81d0fdd
Make multi container tests serial
faizanahmad055 May 12, 2026
68fb1d9
Make GINKGO_PROCS 1
faizanahmad055 May 12, 2026
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
14 changes: 7 additions & 7 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
DOCKER_FILE_PATH: Dockerfile
DOCKER_UBI_FILE_PATH: Dockerfile.ubi
KUBERNETES_VERSION: "1.30.0"
KIND_VERSION: "0.23.0"
KIND_VERSION: "0.31.0"
REGISTRY: ghcr.io
RELOADER_EDITION: oss

Expand Down Expand Up @@ -100,15 +100,15 @@ jobs:
kind version
kind version | grep -q ${KIND_VERSION}

- name: Create Kind Cluster
run: |
kind create cluster
kubectl cluster-info

- name: Create Kind Cluster and Setup E2E Dependencies
run: KIND_CLUSTER=kind make e2e-setup

- name: Test
- name: Run unit tests
run: make test

- name: Run E2E tests
run: KIND_CLUSTER=kind make e2e

- name: Run quick A/B load tests
uses: ./.github/actions/loadtest
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ test/loadtest/results
test/loadtest/loadtest
# Temporary NFS files
.nfs*
*.test
74 changes: 74 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
version: "2"

run:
go: "1.26"
timeout: 5m
allow-parallel-runners: true

linters:
default: none
enable:
# Core linters
- errcheck
- govet
- staticcheck
- ineffassign
- unused

# Code quality
- revive
- misspell
- unconvert
- unparam
- nakedret
- copyloopvar

# Bug prevention
- bodyclose
- durationcheck
- errorlint

# Test framework
- ginkgolinter

settings:
revive:
rules:
- name: comment-spacings
- name: import-shadowing

govet:
enable-all: true
disable:
- shadow
- fieldalignment

errcheck:
check-type-assertions: true
exclude-functions:
- (io.Closer).Close
- (*os.File).Close

nakedret:
max-func-lines: 30

exclusions:
generated: lax
rules:
- linters:
- errcheck
path: _test\.go
paths:
- third_party$
- vendor$

formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/stakater/Reloader
exclusions:
generated: lax
300 changes: 300 additions & 0 deletions CLAUDE.md

Large diffs are not rendered by default.

66 changes: 57 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ DOCKER_IMAGE ?= ghcr.io/stakater/reloader
# Default value "dev"
VERSION ?= 0.0.1

# Full image reference (used for docker-build)
IMG ?= $(DOCKER_IMAGE):v$(VERSION)

REPOSITORY_GENERIC = ${DOCKER_IMAGE}:${VERSION}
REPOSITORY_ARCH = ${DOCKER_IMAGE}:v${VERSION}-${ARCH}
BUILD=
Expand All @@ -34,14 +37,12 @@ KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize-$(KUSTOMIZE_VERSION)
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen-$(CONTROLLER_TOOLS_VERSION)
ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
YQ ?= $(LOCALBIN)/yq

## Tool Versions
KUSTOMIZE_VERSION ?= v5.3.0
CONTROLLER_TOOLS_VERSION ?= v0.14.0
ENVTEST_VERSION ?= release-0.17
GOLANGCI_LINT_VERSION ?= v2.6.1

YQ_VERSION ?= v4.27.5
YQ_DOWNLOAD_URL = "https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_$(OS)_$(ARCH)"
Expand Down Expand Up @@ -72,10 +73,6 @@ envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
$(ENVTEST): $(LOCALBIN)
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))

.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,${GOLANGCI_LINT_VERSION})

# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
# $1 - target path with name of binary (ideally with version)
Expand All @@ -102,8 +99,12 @@ run:
build:
"$(GOCMD)" build ${GOFLAGS} ${LDFLAGS} -o "${BINARY}"

lint: golangci-lint ## Run golangci-lint on the codebase
$(GOLANGCI_LINT) run ./...
lint: ## Run golangci-lint on the codebase
go tool golangci-lint run ./...

fmt: ## Format all Go files
go tool goimports -w -local github.com/stakater/Reloader .
gofmt -w .

build-image:
docker buildx build \
Expand Down Expand Up @@ -140,7 +141,54 @@ manifest:
docker manifest annotate --arch $(ARCH) $(REPOSITORY_GENERIC) $(REPOSITORY_ARCH)

test:
"$(GOCMD)" test -timeout 1800s -v ./...
"$(GOCMD)" test -timeout 1800s -v -count=1 ./internal/... ./pkg/... ./test/e2e/utils/...

##@ E2E Tests

E2E_IMG ?= ghcr.io/stakater/reloader:test
E2E_TIMEOUT ?= 45m
KIND_CLUSTER ?= reloader-e2e
CONTAINER_RUNTIME ?= $(shell command -v docker 2>/dev/null || command -v podman 2>/dev/null)
# Set SKIP_BUILD=true to skip the image build/load steps and use a pre-built image.
SKIP_BUILD ?= false
# Number of parallel Ginkgo workers. Defaults to 1 (sequential). Override with GINKGO_PROCS=N.
GINKGO_PROCS ?= 1

.PHONY: e2e-setup
e2e-setup: ## One-time setup: create Kind cluster and install dependencies (Argo, CSI, Vault)
@if kind get clusters 2>/dev/null | grep -q "^$(KIND_CLUSTER)$$"; then \
echo "Kind cluster $(KIND_CLUSTER) already exists"; \
else \
echo "Creating Kind cluster $(KIND_CLUSTER)..."; \
kind create cluster --name $(KIND_CLUSTER); \
fi
./scripts/e2e-cluster-setup.sh

.PHONY: e2e
e2e: ## Run e2e tests (build/load image unless SKIP_BUILD=true, then run tests in parallel)
ifneq ($(SKIP_BUILD),true)
$(CONTAINER_RUNTIME) build -t $(E2E_IMG) -f Dockerfile .
ifeq ($(notdir $(CONTAINER_RUNTIME)),podman)
$(CONTAINER_RUNTIME) save $(E2E_IMG) -o /tmp/reloader-e2e.tar
kind load image-archive /tmp/reloader-e2e.tar --name $(KIND_CLUSTER)
rm -f /tmp/reloader-e2e.tar
else
kind load docker-image $(E2E_IMG) --name $(KIND_CLUSTER)
endif
endif
RELOADER_IMAGE=$(E2E_IMG) "$(GOCMD)" tool ginkgo --keep-going -v --procs=$(GINKGO_PROCS) --timeout=$(E2E_TIMEOUT) ./test/e2e/...

.PHONY: e2e-cleanup
e2e-cleanup: ## Cleanup: remove test resources and delete Kind cluster
./scripts/e2e-cluster-cleanup.sh
kind delete cluster --name $(KIND_CLUSTER)

.PHONY: e2e-ci
e2e-ci: e2e-setup e2e e2e-cleanup ## CI pipeline: setup, run tests, cleanup

.PHONY: docker-build
docker-build: ## Build Docker image
$(CONTAINER_RUNTIME) build -t $(IMG) -f Dockerfile .

stop:
@docker stop "${BINARY}"
Expand Down
Loading
Loading