mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 08:19:48 +02:00
* 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>
331 lines
5.2 KiB
Go
331 lines
5.2 KiB
Go
package app
|
|
|
|
import "go.uber.org/zap"
|
|
|
|
type ConfigProvider interface {
|
|
Args() string
|
|
HelmBinary() string
|
|
KustomizeBinary() string
|
|
EnableLiveOutput() bool
|
|
StripArgsValuesOnExitError() bool
|
|
DisableForceUpdate() bool
|
|
EnforcePluginVerification() bool
|
|
HelmOCIPlainHTTP() bool
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
SequentialHelmfiles() bool
|
|
|
|
FileOrDir() string
|
|
KubeContext() string
|
|
Namespace() string
|
|
Chart() string
|
|
Selectors() []string
|
|
StateValuesSet() map[string]any
|
|
StateValuesFiles() []string
|
|
Kubeconfig() string
|
|
Env() string
|
|
|
|
loggingConfig
|
|
}
|
|
|
|
type DepsConfigProvider interface {
|
|
Args() string
|
|
SkipRepos() bool
|
|
IncludeTransitiveNeeds() bool
|
|
|
|
concurrencyConfig
|
|
}
|
|
|
|
type ReposConfigProvider interface {
|
|
Args() string
|
|
IncludeTransitiveNeeds() bool
|
|
}
|
|
|
|
type ApplyConfigProvider interface {
|
|
Args() string
|
|
PostRenderer() string
|
|
PostRendererArgs() []string
|
|
SkipSchemaValidation() bool
|
|
Cascade() string
|
|
HideNotes() bool
|
|
TakeOwnership() bool
|
|
SuppressOutputLineRegex() []string
|
|
|
|
Values() []string
|
|
Set() []string
|
|
SkipCRDs() bool
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
Wait() bool
|
|
WaitRetries() int
|
|
WaitForJobs() bool
|
|
|
|
IncludeTests() bool
|
|
|
|
Suppress() []string
|
|
SuppressSecrets() bool
|
|
ShowSecrets() bool
|
|
NoHooks() bool
|
|
SuppressDiff() bool
|
|
|
|
DetailedExitcode() bool
|
|
StripTrailingCR() bool
|
|
|
|
Color() bool
|
|
NoColor() bool
|
|
Context() int
|
|
DiffOutput() string
|
|
|
|
Validate() bool
|
|
SkipCleanup() bool
|
|
SkipDiffOnInstall() bool
|
|
|
|
DiffArgs() string
|
|
SyncArgs() string
|
|
|
|
SyncReleaseLabels() bool
|
|
|
|
DAGConfig
|
|
|
|
TrackMode() string
|
|
TrackTimeout() int
|
|
TrackLogs() bool
|
|
|
|
concurrencyConfig
|
|
interactive
|
|
loggingConfig
|
|
valuesControlMode
|
|
}
|
|
|
|
type SyncConfigProvider interface {
|
|
Args() string
|
|
PostRenderer() string
|
|
SkipSchemaValidation() bool
|
|
PostRendererArgs() []string
|
|
HideNotes() bool
|
|
TakeOwnership() bool
|
|
Cascade() string
|
|
|
|
Values() []string
|
|
Set() []string
|
|
SkipCRDs() bool
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
Wait() bool
|
|
WaitRetries() int
|
|
WaitForJobs() bool
|
|
SyncArgs() string
|
|
|
|
Validate() bool
|
|
|
|
SkipNeeds() bool
|
|
IncludeNeeds() bool
|
|
IncludeTransitiveNeeds() bool
|
|
|
|
SyncReleaseLabels() bool
|
|
TrackMode() string
|
|
TrackTimeout() int
|
|
TrackLogs() bool
|
|
|
|
DAGConfig
|
|
|
|
concurrencyConfig
|
|
interactive
|
|
loggingConfig
|
|
valuesControlMode
|
|
}
|
|
|
|
type DiffConfigProvider interface {
|
|
Args() string
|
|
PostRenderer() string
|
|
PostRendererArgs() []string
|
|
SkipSchemaValidation() bool
|
|
SuppressOutputLineRegex() []string
|
|
|
|
Values() []string
|
|
Set() []string
|
|
Validate() bool
|
|
SkipCRDs() bool
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
|
|
IncludeTests() bool
|
|
|
|
Suppress() []string
|
|
SuppressSecrets() bool
|
|
ShowSecrets() bool
|
|
NoHooks() bool
|
|
SuppressDiff() bool
|
|
SkipDiffOnInstall() bool
|
|
DiffArgs() string
|
|
|
|
DAGConfig
|
|
|
|
DetailedExitcode() bool
|
|
StripTrailingCR() bool
|
|
Color() bool
|
|
NoColor() bool
|
|
Context() int
|
|
DiffOutput() string
|
|
TakeOwnership() bool
|
|
|
|
concurrencyConfig
|
|
valuesControlMode
|
|
}
|
|
|
|
type DestroyConfigProvider interface {
|
|
Args() string
|
|
Cascade() string
|
|
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
SkipCharts() bool
|
|
DeleteWait() bool
|
|
DeleteTimeout() int
|
|
|
|
interactive
|
|
loggingConfig
|
|
concurrencyConfig
|
|
}
|
|
|
|
type TestConfigProvider interface {
|
|
Args() string
|
|
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
Timeout() int
|
|
Cleanup() bool
|
|
Logs() bool
|
|
|
|
concurrencyConfig
|
|
}
|
|
|
|
type LintConfigProvider interface {
|
|
Args() string
|
|
|
|
Values() []string
|
|
Set() []string
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
SkipCleanup() bool
|
|
|
|
DAGConfig
|
|
|
|
concurrencyConfig
|
|
}
|
|
|
|
type UnittestConfigProvider interface {
|
|
Args() string
|
|
|
|
Values() []string
|
|
Set() []string
|
|
FailFast() bool
|
|
Color() bool
|
|
DebugPlugin() bool
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
SkipCleanup() bool
|
|
|
|
DAGConfig
|
|
|
|
concurrencyConfig
|
|
}
|
|
|
|
type FetchConfigProvider interface {
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
OutputDir() string
|
|
OutputDirTemplate() string
|
|
|
|
concurrencyConfig
|
|
}
|
|
|
|
type TemplateConfigProvider interface {
|
|
Args() string
|
|
PostRenderer() string
|
|
PostRendererArgs() []string
|
|
SkipSchemaValidation() bool
|
|
|
|
Values() []string
|
|
Set() []string
|
|
OutputDirTemplate() string
|
|
Validate() bool
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
SkipCleanup() bool
|
|
SkipTests() bool
|
|
OutputDir() string
|
|
IncludeCRDs() bool
|
|
NoHooks() bool
|
|
KubeVersion() string
|
|
ShowOnly() []string
|
|
|
|
DAGConfig
|
|
|
|
concurrencyConfig
|
|
}
|
|
|
|
type DAGConfig interface {
|
|
SkipNeeds() bool
|
|
IncludeNeeds() bool
|
|
IncludeTransitiveNeeds() bool
|
|
EnforceNeedsAreInstalled() bool
|
|
}
|
|
|
|
type WriteValuesConfigProvider interface {
|
|
Values() []string
|
|
Set() []string
|
|
OutputFileTemplate() string
|
|
SkipDeps() bool
|
|
SkipRefresh() bool
|
|
SkipCleanup() bool
|
|
IncludeTransitiveNeeds() bool
|
|
|
|
concurrencyConfig
|
|
}
|
|
|
|
type StatusesConfigProvider interface {
|
|
Args() string
|
|
|
|
concurrencyConfig
|
|
}
|
|
|
|
type StateConfigProvider interface {
|
|
EmbedValues() bool
|
|
}
|
|
|
|
type DAGConfigProvider any
|
|
|
|
type concurrencyConfig interface {
|
|
Concurrency() int
|
|
}
|
|
|
|
type loggingConfig interface {
|
|
Logger() *zap.SugaredLogger
|
|
}
|
|
|
|
type interactive interface {
|
|
Interactive() bool
|
|
}
|
|
|
|
type ListConfigProvider interface {
|
|
Output() string
|
|
SkipCharts() bool
|
|
}
|
|
|
|
type CacheConfigProvider any
|
|
|
|
type InitConfigProvider interface {
|
|
Force() bool
|
|
}
|
|
|
|
type PrintEnvConfigProvider interface {
|
|
Output() string
|
|
}
|
|
|
|
// reset/reuse values helm cli flags handling for apply/sync/diff
|
|
type valuesControlMode interface {
|
|
ReuseValues() bool
|
|
ResetValues() bool
|
|
}
|