MCPcopy
hub / github.com/redspread/spread / Equal

Method Equal

pkg/deploy/deployment.go:95–115  ·  view source on GitHub ↗

Equal performs a deep equality check between Deployments. Internal ordering is ignored.

(other *Deployment)

Source from the content-addressed store, hash-verified

93
94// Equal performs a deep equality check between Deployments. Internal ordering is ignored.
95func (d *Deployment) Equal(other *Deployment) bool {
96 if other == nil {
97 return false
98 }
99
100 if len(d.objects) != len(other.objects) {
101 return false
102 }
103
104 for k, thisVal := range d.objects {
105 if otherVal, contains := other.objects[k]; contains {
106 // check if object in same key matches
107 if !kube.Semantic.DeepEqual(thisVal, otherVal) {
108 return false
109 }
110 } else {
111 return false
112 }
113 }
114 return true
115}
116
117// Objects returns the contents of a Deployment. No ordering guarantees are given.
118func (d Deployment) Objects() []KubeObject {

Callers 6

TestBaseNewFunction · 0.95
TestDeploymentObjectsFunction · 0.45
TestObjectPathFunction · 0.45

Calls

no outgoing calls

Tested by 6

TestBaseNewFunction · 0.76
TestDeploymentObjectsFunction · 0.36
TestObjectPathFunction · 0.36