Implement calculate diffs and rendering diffs of k8s#5674
Conversation
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5674 +/- ##
==========================================
+ Coverage 25.60% 25.75% +0.15%
==========================================
Files 478 478
Lines 51307 51400 +93
==========================================
+ Hits 13135 13236 +101
+ Misses 37167 37160 -7
+ Partials 1005 1004 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| return len(r.Adds) + len(r.Deletes) + len(r.Changes) | ||
| } | ||
|
|
||
| func DiffList(liveManifests, desiredManifests []Manifest, logger *zap.Logger, opts ...diff.Option) (*DiffListResult, error) { |
There was a problem hiding this comment.
ref;
pipecd/pkg/app/piped/platformprovider/kubernetes/diff.go
Lines 79 to 103 in 20577c0
| MaxChangedManifests int | ||
| } | ||
|
|
||
| func (r *DiffListResult) Render(opt DiffRenderOptions) string { |
There was a problem hiding this comment.
ref;
pipecd/pkg/app/piped/platformprovider/kubernetes/diff.go
Lines 148 to 212 in 20577c0
I omit the option to use diff command to calculate diff.
| return result, nil | ||
| } | ||
|
|
||
| func groupManifests(olds, news []Manifest) (adds, deletes, newChanges, oldChanges []Manifest) { |
There was a problem hiding this comment.
ref;
pipecd/pkg/app/piped/platformprovider/kubernetes/diff.go
Lines 266 to 305 in 20577c0
I changed it to compare with the namespace because the plugin's implementation sets the namespace when loading and parsing manifests, so I think it's ok.
What this PR does:
as title
Why we need it:
We have to calculate diffs to implement DriftDetection
Which issue(s) this PR fixes:
Part of #5363
Does this PR introduce a user-facing change?: No