kubernetes-sigs / structured-merge-diff

Test cases and implementation for "server-side apply"
Apache License 2.0
97 stars 58 forks source link

Support semantic equality on List fields #263

Open nan-yu opened 2 months ago

nan-yu commented 2 months ago

When comparing list fields within two objects, a simple equality check isn't enough. We need to implement a semantic check on the individual list items to ensure accurate comparisons.

kind: Role
metadata:
  name: test-role
  namespace: test-ns
rules:
- apiGroups:
  - batch/v1
  resources:
  - jobs
  verbs:
  - '*'
- apiGroups:
  - apps/v1
  resources:
  - deployments
  verbs:
  - '*'

and

kind: Role
metadata:
  name: test-role
  namespace: test-ns
rules:
- apiGroups:
  - apps/v1
  resources:
  - deployments
  verbs:
  - '*'
- apiGroups:
  - batch/v1
  resources:
  - jobs
  verbs:
  - '*'