Commit 74e34436
74e3443609afMerged
Dmitriy Zhilyaev <[email protected]> ยท 2 years ago ยท 1 file ยท ~1 modified
Description
feat: debug log suppress
Details
- Commit
- 74e3443609af
- Parent
- 8fb00ed32794
pkg/plan/diff.gomodifiedView file
@@ -9,7 +9,6 @@
99
"github.com/databus23/helm-diff/v3/diff"1010
"github.com/databus23/helm-diff/v3/manifest"1111
"github.com/helmwave/helmwave/pkg/helper"12-
logSetup "github.com/helmwave/helmwave/pkg/log"1312
"github.com/helmwave/helmwave/pkg/parallel"1413
"github.com/helmwave/helmwave/pkg/release"1514
"github.com/helmwave/helmwave/pkg/release/uniqname"@@ -31,15 +30,12 @@
3130
}3231
3332
// DiffPlan show diff between 2 plans.34-
func (p *Plan) DiffPlan(b *Plan, showSecret bool, diffWide int) {33+
func (p *Plan) DiffPlan(b *Plan, opts *diff.Options) {3534
visited := make(map[uniqname.UniqName]bool)3635
k := 037-
opts := &diff.Options{38-
ShowSecrets: showSecret,39-
OutputContext: diffWide,40-
OutputFormat: logSetup.Default.Format(),41-
}4236
37+
log.WithField("suppress", opts.SuppressedKinds).Debug("suppress kinds for diffing")38+
4339
for _, rel := range append(p.body.Releases, b.body.Releases...) {4440
if visited[rel.Uniq()] {4541
continue@@ -66,7 +62,7 @@
6662
}6763
6864
// DiffLive show diff with production releases in k8s-cluster.69-
func (p *Plan) DiffLive(ctx context.Context, showSecret bool, diffWide int, threeWayMerge bool) {65+
func (p *Plan) DiffLive(ctx context.Context, opts *diff.Options, threeWayMerge bool) {7066
alive, _, err := p.GetLive(ctx)7167
if err != nil {7268
log.Fatalf("Something went wrong with getting releases in the kubernetes cluster: %v", err)@@ -74,10 +70,6 @@
7470
7571
visited := make([]uniqname.UniqName, 0, len(p.body.Releases))7672
k := 077-
opts := &diff.Options{78-
ShowSecrets: showSecret,79-
OutputContext: diffWide,80-
}8173
8274
for _, rel := range p.body.Releases {8375
visited = append(visited, rel.Uniq())@@ -87,7 +79,7 @@
8779
if threeWayMerge {8880
oldManifest = get3WayMergeManifests(rel, active.Manifest)8981
}90-
// I dont use manifest.ParseRelease82+
// I don't use manifest.ParseRelease9183
// Because Structs are different.9284
oldSpecs := parseManifests(oldManifest, rel.Namespace())9385
newSpecs := parseManifests(newManifest, rel.Namespace())