Commit Graph
261 Commits
Author SHA1 Message Date
Muhammad Safwan KarimandGitHub b6a6d8c6e2 Merge pull request #1193 from nikolauspschuetz/fix/reload-annotation-invalid-regex-panic
fix: prevent panic on invalid regex in reload annotation
2026-08-10 08:14:52 +05:00
Nikolaus Schuetz 4471a45591 Surface invalid-regex errors to the call site with workload context
Per review: instead of logging the skipped pattern inside ShouldReload
(which lacks workload identity), collect the compile errors on
ReloadCheckResult.Errors and log them at the upgrade call site, where the
resource name, type, and namespace are known. Add a test for the
multi-value case where one comma-separated pattern is malformed and a
valid one still matches.
2026-08-01 21:21:02 -07:00
Muhammad Safwan KarimandGitHub 0d180429d8 Merge pull request #1162 from michal-marszalek-h2oai/951-namespace-scope-rbac
feat: scoped multi-namespace RBAC mode (Role per namespace, no ClusterRole)
2026-07-10 10:44:45 +05:00
Nikolaus Schuetz 20220ed7ef Log errors returned when sending webhook alerts
The alert send functions (Slack/Teams/GChat/raw) return `[]error`, but
`SendWebhookAlert` discarded them, so a failing webhook — e.g. a Teams
alert returning a non-2xx status — produced no output at all, even at
trace level (#949).

Capture the returned errors and log each with `logrus.Errorf`, as
suggested by the maintainer on the issue. Adds a regression test that
drives a failing (500) webhook and asserts the error is logged.

Closes #949

Assisted-by: Claude Code (Anthropic, Opus 4.x)
2026-07-07 20:21:00 -07:00
Michał Marszałek 53ae379242 Merge remote-tracking branch 'upstream/master' into 951-namespace-scope-rbac
# Conflicts:
#	internal/pkg/cmd/reloader.go
#	internal/pkg/cmd/reloader_test.go
2026-07-02 11:07:13 +02:00
Nikolaus Schuetz f8c41e4bc8 fix: reflect --namespaces-to-ignore in startup namespace-scope log
When KUBERNETES_NAMESPACE is unset, startReloader logged
"will detect changes in all namespaces." unconditionally, even when
--namespaces-to-ignore was set, which is misleading.

Extract the scope message into namespaceWatchScopeMessage(), move the log
after ignoredNamespacesList is resolved, and include the excluded
namespaces in the message when filtering is active.

Closes #1131

Assisted-by: Claude Code (Anthropic, Opus 4.x)
2026-06-29 12:19:03 -07:00
Michał MarszałekandClaude Opus 4.8 50153d05ea feat: scoped multi-namespace mode (Role per namespace, no ClusterRole)
Add a third RBAC posture between watch-globally (ClusterRole) and single
namespace: give Reloader an explicit list of namespaces to watch. The chart
creates a namespace-scoped Role + RoleBinding in each listed namespace (no
ClusterRole), and one install covers them all.

Go:
- new --namespaces flag / options.Namespaces
- resolveWatchNamespaces() picks list -> KUBERNETES_NAMESPACE -> all
- controller creation loops over the watched namespaces
- namespaces-to-ignore is now only honored in global mode (watchGlobally=true);
  in single-namespace and scoped modes the watched set is already explicit

Helm:
- new reloader.namespaces value (active when watchGlobally=false); accepts either
  a YAML list or a comma-separated string for consistency with the sibling
  namespace options
- reloader-watchNamespaces helper (release ns always auto-included, deduped)
- shared reloader-namespaced-rules template reused per namespace
- role.yaml/rolebinding.yaml range over the list; deployment passes --namespaces
- --namespaces-to-ignore only rendered when watchGlobally=true
- fail guard for watchGlobally=true + namespaces set

Tests: unit test for resolveWatchNamespaces; scoped-namespaces e2e case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 15:48:38 +02:00
Muhammad Safwan KarimandGitHub 2cbb7715de Merge pull request #1141 from stakater/takeover-e2e-tests
Takeover e2e tests
2026-06-15 12:02:55 +05:00
yvjessestephensandGitHub f12425e96f Merge branch 'stakater:master' into fix/configmaps-resources-to-ignore-mismatch 2026-06-12 08:30:59 -05:00
Jesse StephensandClaude Opus 4.8 8f94e3051e refactor: case-insensitive normalization for resources-to-ignore
Use strings.ToLower so any casing (configMaps, ConfigMaps, sEcrets)
normalizes to the canonical lowercase ResourceMap key, and simplify the
flag help text. Addresses PR review feedback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 08:29:56 -05:00
faizanahmad055 6556d4dac5 Remove unused methods
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-06-12 12:43:43 +02:00
Smyslov MaximandCursor b2b40da4cf feat: add --ignore-annotation flag to override reloader.stakater.com/ignore
Allow users to customise the annotation key used to mark ConfigMaps and
Secrets as ignored by Reloader, consistent with how every other annotation
key is already overridable via a dedicated CLI flag.

Changes:
- internal/pkg/util/util.go: register --ignore-annotation persistent flag
  backed by options.IgnoreResourceAnnotation
- deployments/kubernetes/chart/reloader/templates/deployment.yaml: pass
  --ignore-annotation when custom_annotations.ignore is set in Helm values
- deployments/kubernetes/chart/reloader/values.yaml: document the new
  custom_annotations.ignore key in the example comment
- README.md: add --ignore-annotation to the Annotation Key Overrides table
  and mention the flag alongside the Resource-Level Ignore Annotation section

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 11:13:31 +03:00
Jesse Stephens d527ae8d5a fix: align resources-to-ignore=configMaps with renamed ResourceMap key
PR #1061 renamed the configmap key in kube.ResourceMap from "configMaps"
(camelCase) to "configmaps" (lowercase) to fix controllers not being
able to mark themselves as initialized. However, two callers were not
updated to match the new canonical key:

1. The Helm chart's deployment template still emits
   `--resources-to-ignore=configMaps` (camelCase) when
   `reloader.ignoreConfigMaps: true` is set.
2. The validation in `GetIgnoredResourcesList` only accepts the legacy
   camelCase spelling.

Because `ignoredResourcesList.Contains(k)` uses case-sensitive string
equality, the lookup against the new lowercase ResourceMap key never
matches. The configmaps controller is created and starts watching
ConfigMaps cluster-wide, even though the chart's ClusterRole template
(also gated on `ignoreConfigMaps`) does not grant permission for it.

The resulting pod logs are full of:

  configmaps is forbidden: User "system:serviceaccount:reloader:reloader-reloader"
  cannot list resource "configmaps" in API group "" at the cluster scope

This change:

- Updates the chart deployment template to emit the canonical lowercase
  `configmaps` value.
- Normalizes the input in `GetIgnoredResourcesList`, accepting both
  `configMaps` (legacy, for backward compatibility with users who pass
  the flag directly) and `configmaps` (canonical), and emitting the
  canonical form to the caller.
- Updates the flag help text and adds tests covering both spellings.
2026-05-20 14:19:13 -05:00
faizanahmad055 68fb1d9211 Make GINKGO_PROCS 1
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-05-12 13:17:56 +02:00
faizanahmad055 90f0768f56 Fix formatting
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-05-11 22:36:46 +02:00
faizanahmad055 caebfd98f9 Add e2e parallel
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-05-11 21:59:32 +02:00
faizanahmad055 96ac8d1daf Refactor code and fix leader election tests
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-05-11 20:48:54 +02:00
faizanahmad055 b5c8705395 Refactor code
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-05-11 16:18:53 +02:00
faizanahmad055 e8d79c61c8 Fix PR issues
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-05-11 11:29:09 +02:00
faizanahmad055 84f2ca3248 Fix conflicts
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-05-11 10:55:54 +02:00
Safwan f776e2dfd0 fixed errors 2026-02-13 17:05:29 +05:00
TheiLLeniumStudios 737455303c fix: empty slices instead of nil return 2026-01-21 15:44:59 +01:00
TheiLLeniumStudios 883ce07c70 test: remove redundant comments and clean up test code 2026-01-14 12:35:48 +01:00
TheiLLeniumStudios f0e6d3af58 feat: A lot of refactoring and CSI test cases 2026-01-10 13:42:10 +01:00
TheiLLeniumStudios 46e7d74bd1 Merge master into feat/e2e-test 2026-01-09 16:33:50 +01:00
TheiLLeniumStudios 16ff7f6ac9 fix: Default reconcile metric result to error for panic safety 2026-01-09 15:27:19 +01:00
TheiLLeniumStudios 1be910749b chore: A lot of cleanup 2026-01-09 01:34:16 +01:00
TheiLLeniumStudios 1945a740d0 chore: Format files# 2026-01-09 01:22:24 +01:00
TheiLLeniumStudios b945e5e828 chore: Merge from master 2026-01-08 22:12:19 +01:00
TheiLLeniumStudios eb3bc2447e refactor(upgrade.go): simplify retryOnConflict to return matched status and error 2026-01-08 11:12:10 +01:00
TheiLLeniumStudios fafd5460a2 feat: Initial e2e tests and migrate old ones into e2e 2026-01-08 11:06:45 +01:00
faizanahmad055 157cf0f2e4 Remove SHA1 changes
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-01-07 12:13:04 +01:00
faizanahmad055 8b64c9b9cd Fix failing SHA test
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-01-06 22:53:24 +01:00
faizanahmad055 e1db875efe Fix failing tests
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-01-06 22:20:20 +01:00
TheiLLeniumStudios 9a3edf13d2 feat: Load tests 2026-01-06 11:03:26 +01:00
faizanahmad055 4b90335362 Readme update and fix tests
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-01-04 21:52:07 +01:00
faizanahmad055 7e9d571e1e Readme update and change SHA1 to SHA512
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-01-04 20:10:52 +01:00
faizanahmad055 0f1d02e975 Readme update and code refactor
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-01-04 02:40:42 +01:00
faizanahmad055 c9cab4f6e0 Update chart for CSI driver
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-01-03 19:32:43 +01:00
Safwan 1725f17b0b fixed namespace behavior issue 2025-11-25 02:05:41 +05:00
Safwan 4f8b22e954 resolved comments 2025-11-25 01:48:54 +05:00
Safwan cdaed4a8af Merge branch 'master' into add-csi-support 2025-11-25 01:27:08 +05:00
Safwan 174b57cdad Fixed linting 2025-11-04 17:39:24 +05:00
Pradeep Lakshmi Narasimha a77c10a2c6 fix: Prevent permission errors for ignored workload types #996
Signed-off-by: Pradeep Lakshmi Narasimha <pradeep.vaishnav4@gmail.com>
2025-09-30 22:43:56 +05:30
Pradeep Lakshmi NarasimhaandFelix dd0807e951 fix: Controller not respecting ignore* flags 2025-08-29 12:24:02 +02:00
Felix Tonnvik aa481d9568 fixed broken test 2025-08-19 11:06:08 +02:00
Muhammad Safwan KarimandGitHub 177d2756a8 Moved some functions to common package (#988)
* separate methods

* basic refactoring

* moved common code to util package to use it in gateway

* common check for argo rollouts

* made code compilable with latest changes on master

* Moved options to separate package and created CommandLineOptions instance that will be in sync with options values.

* reverted extra changes

* initialize CommandLineOptions with default options in module init

* wait for paused at annotation before checking deployment paused

* moved things around to fix things

* reverted unnecessary changes

* reverted rolling_upgrade changes

* reverted extra change

* additional checks in reloader

* refactor: ShouldReloadInternal method. It will be called by Reloader
ShouldReload has some additional resource/namespace filter checks which are not needed for Reloader

* added test cases

* moved config to sharable packae

* moved resource selector and label selctor methods

* fixed pipeline

* removed map.yaml

* removed vague comment
2025-08-15 15:51:47 +05:00
Pradeep Lakshmi Narasimha 1e6a6ec2d9 fix: handle operator crash when using workloadRef 2025-08-14 07:55:56 +05:30
Muhammad Safwan KarimandGitHub 1e46d44c7c Added pprof flag (#980)
* added pprof flag

* updated chart

* fixed linting and spelling
2025-07-29 15:49:30 +05:00
Muhammad Safwan KarimandGitHub 49409dce54 Extracted some functions to public package to reuse them in gateway (#966)
* separate methods

* basic refactoring

* moved common code to util package to use it in gateway

* common check for argo rollouts

* made code compilable with latest changes on master

* Moved options to separate package and created CommandLineOptions instance that will be in sync with options values.

* reverted extra changes

* initialize CommandLineOptions with default options in module init

* wait for paused at annotation before checking deployment paused

* moved things around to fix things

* reverted unnecessary changes

* reverted rolling_upgrade changes

* reverted extra change
2025-07-29 11:50:02 +05:00