Skip to content

Commit 32ead67

Browse files
committed
diff: ignore kind and apiVersion when diffing
1 parent 3280848 commit 32ead67

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/util/diff.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ func (d *differ) Diff(a, b client.Object) (DiffResult, error) {
197197
func NewDefaultDiffer(opts ...diffopts) *differ {
198198
return newDiffer(append(opts,
199199
// Options for handling of metadata fields.
200+
WithIgnoreField("kind"),
201+
WithIgnoreField("apiVersion"),
200202

201203
// Special handling for Cluster API's conversion-data label.
202204
WithIgnoreField("metadata", "annotations", "cluster.x-k8s.io/conversion-data"),

0 commit comments

Comments
 (0)