From aefde997811c458920953c29d1b28fb3e09f9dbb Mon Sep 17 00:00:00 2001 From: zhaque44 Date: Tue, 27 May 2025 13:55:37 -0500 Subject: [PATCH] add config lint go Signed-off-by: zhaque44 --- pkg/config/apply.go | 7 +++++++ pkg/config/diff.go | 7 +++++++ pkg/config/lint.go | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/pkg/config/apply.go b/pkg/config/apply.go index 81a9a195..011783e6 100644 --- a/pkg/config/apply.go +++ b/pkg/config/apply.go @@ -28,6 +28,8 @@ type ApplyOptions struct { IncludeNeeds bool // IncludeTransitiveNeeds is true if the transitive needs should be included IncludeTransitiveNeeds bool + // EnforceNeedsAreInstalled is true we should error if/when there are unmeetable dependencies + EnforceNeedsAreInstalled bool // SkipDiffOnInstall is true if the diff should be skipped on install SkipDiffOnInstall bool // DiffArgs is the list of arguments to pass to the helm-diff. @@ -139,6 +141,11 @@ func (a *ApplyImpl) IncludeTransitiveNeeds() bool { return a.ApplyOptions.IncludeTransitiveNeeds } +// EnforceNeedsAreInstalled is true we should error if/when there are unmeetable dependencies +func (a *ApplyImpl) EnforceNeedsAreInstalled() bool { + return a.ApplyOptions.EnforceNeedsAreInstalled +} + // ShowSecrets returns the show secrets. func (a *ApplyImpl) ShowSecrets() bool { return a.ApplyOptions.ShowSecrets diff --git a/pkg/config/diff.go b/pkg/config/diff.go index d8830fad..153d87fb 100644 --- a/pkg/config/diff.go +++ b/pkg/config/diff.go @@ -18,6 +18,8 @@ type DiffOptions struct { IncludeNeeds bool // IncludeTransitiveNeeds is the include transitive needs flag IncludeTransitiveNeeds bool + // EnforceNeedsAreInstalled is the enforce needs are installed flag + EnforceNeedsAreInstalled bool // SkipDiffOnInstall is the skip diff on install flag SkipDiffOnInstall bool // ShowSecrets is the show secrets flag @@ -87,6 +89,11 @@ func (t *DiffImpl) IncludeTransitiveNeeds() bool { return t.DiffOptions.IncludeTransitiveNeeds } +// EnforceNeedsAreInstalled errors if the transitive dependencies are not installable +func (t *DiffImpl) EnforceNeedsAreInstalled() bool { + return t.DiffOptions.EnforceNeedsAreInstalled +} + // Set returns the Set func (t *DiffImpl) Set() []string { return t.DiffOptions.Set diff --git a/pkg/config/lint.go b/pkg/config/lint.go index 46cf02f8..be4de771 100644 --- a/pkg/config/lint.go +++ b/pkg/config/lint.go @@ -14,6 +14,8 @@ type LintOptions struct { IncludeNeeds bool // IncludeTransitiveNeeds is the include transitive needs flag IncludeTransitiveNeeds bool + // EnforceNeedsAreInstalled is the enforce needs are installed flag + EnforceNeedsAreInstalled bool // SkipDeps is the skip deps flag } @@ -66,6 +68,11 @@ func (l *LintImpl) IncludeTransitiveNeeds() bool { return l.LintOptions.IncludeTransitiveNeeds } +// EnforceNeedsAreInstalled errors if the transitive dependencies are not installable +func (l *LintImpl) EnforceNeedsAreInstalled() bool { + return l.LintOptions.EnforceNeedsAreInstalled +} + // SkipNeeds returns the skip needs func (l *LintImpl) SkipNeeds() bool { if !l.IncludeNeeds() {