helmfile/pkg/config
yxxhero 6e21671228
feat: kubedog integration with unified resource handling (#2383)
* feat: add kubedog-based resource tracking integration

Add kubedog tracking as an alternative to Helm's --wait flag with:
- Real-time deployment progress tracking
- Container log streaming
- Fine-grained resource filtering (trackKinds/skipKinds/trackResources)

Features:
- New pkg/resource package for unified manifest parsing and filtering
- New pkg/kubedog package wrapping kubedog library
- CLI flags: --track-mode, --track-timeout, --track-logs
- Helmfile YAML support for trackMode, trackTimeout, trackLogs, trackKinds, skipKinds, trackResources
- Case-insensitive kind matching for filtering
- Multi-context support with proper kubeconfig/kubeContext handling

Tracking supports: Deployment, StatefulSet, DaemonSet, Job

Resource filtering priority (highest to lowest):
1. trackResources - explicit resource whitelist
2. skipKinds - blacklist specific kinds
3. trackKinds - whitelist specific kinds

Integration:
- Disable Helm --wait when using kubedog tracking
- Track after successful Helm sync/apply
- Respect release.Namespace as fallback for resources without namespace
- Use getKubeContext() for correct cluster targeting

Tests:
- Unit tests for resource filtering and kubedog options
- Integration test with httpbin chart
- E2E snapshot tests for YAML serialization
- Documentation in docs/advanced-features.md

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: address PR #2383 review comments (round 4)

1. resource/filter.go: Skip empty whitelist entries in matchWhitelist
   - At least one field (kind/name/namespace) must be specified
   - Prevents matching all resources with empty TrackResources entries

2. config/apply.go: Add ValidateConfig for track-mode validation
   - Validate --track-mode must be 'helm' or 'kubedog'
   - Reject invalid values like --track-mode foo

3. config/sync.go: Add ValidateConfig for track-mode validation
   - Same validation as apply command
   - Ensures consistent behavior across commands

Signed-off-by: yxxhero <aiopsclub@163.com>

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
2026-03-02 17:15:12 +08:00
..
apply.go feat: kubedog integration with unified resource handling (#2383) 2026-03-02 17:15:12 +08:00
build.go fix --debug flag 2022-10-25 08:24:23 +08:00
cache.go fix --debug flag 2022-10-25 08:24:23 +08:00
config.go Use a regex to match --state-values-set-string arguments (#1902) 2025-02-04 07:59:31 +08:00
deps.go fix --debug flag 2022-10-25 08:24:23 +08:00
destroy.go Create DeleteWait and DeleteTimeout parameters for Destroy (#1177) 2023-12-05 08:38:37 +08:00
diff.go Issue-1883 fix (#2058) 2025-11-19 07:45:56 +08:00
fetch.go feat: add/expose cli flags (#771) 2023-04-02 14:53:52 +08:00
global.go Add --sequential-helmfiles flag for optional sequential processing (#2350) 2026-01-08 14:28:25 -05:00
global_test.go add support for HELMFILE_FILE_PATH envvar to set -f (#1255) 2024-01-03 21:37:49 +08:00
init.go Add subcommand init for checks and installs helmfile deps (#389) 2022-11-03 14:51:30 +08:00
lint.go Issue-1883 fix (#2058) 2025-11-19 07:45:56 +08:00
list.go fix --debug flag 2022-10-25 08:24:23 +08:00
print_env.go feat: add print-env command (#2279) 2025-11-28 08:46:37 +08:00
repos.go fix --debug flag 2022-10-25 08:24:23 +08:00
show-dag.go Update DAG with dependencies (#1477) 2024-04-27 07:37:28 +08:00
status.go fix --debug flag 2022-10-25 08:24:23 +08:00
sync.go feat: kubedog integration with unified resource handling (#2383) 2026-03-02 17:15:12 +08:00
template.go Issue-1883 fix (#2058) 2025-11-19 07:45:56 +08:00
test.go feat: add/expose cli flags (#771) 2023-04-02 14:53:52 +08:00
unittest.go feat: add `helmfile unittest` command for helm-unittest integration (#2400) 2026-02-16 09:45:10 +08:00
write-values.go feat: add/expose cli flags (#771) 2023-04-02 14:53:52 +08:00