@@ -32,31 +32,31 @@ func NewPodDisruptionBudgetMatcher(objectMatcher ObjectMatcher) *podDisruptionBu
32
32
}
33
33
34
34
// Match compares two autoscalev2beta1.HorizontalPodAutoscaler objects
35
- func (m podDisruptionBudgetMatcher ) Match (old , new * policyv1beta1.PodDisruptionBudget ) (bool , error ) {
35
+ func (m podDisruptionBudgetMatcher ) Match (oldOrig , newOrig * policyv1beta1.PodDisruptionBudget ) (bool , error ) {
36
36
type PodDisruptionBudgetMatcher struct {
37
37
ObjectMeta
38
38
Spec policyv1beta1.PodDisruptionBudgetSpec
39
39
}
40
40
41
41
oldData , err := json .Marshal (PodDisruptionBudgetMatcher {
42
- ObjectMeta : m .objectMatcher .GetObjectMeta (old .ObjectMeta ),
43
- Spec : old .Spec ,
42
+ ObjectMeta : m .objectMatcher .GetObjectMeta (oldOrig .ObjectMeta ),
43
+ Spec : oldOrig .Spec ,
44
44
})
45
45
if err != nil {
46
- return false , emperror .WrapWith (err , "could not marshal old object" , "name" , old .Name )
46
+ return false , emperror .WrapWith (err , "could not marshal old object" , "name" , oldOrig .Name )
47
47
}
48
48
newObject := PodDisruptionBudgetMatcher {
49
- ObjectMeta : m .objectMatcher .GetObjectMeta (new .ObjectMeta ),
50
- Spec : new .Spec ,
49
+ ObjectMeta : m .objectMatcher .GetObjectMeta (newOrig .ObjectMeta ),
50
+ Spec : newOrig .Spec ,
51
51
}
52
52
newData , err := json .Marshal (newObject )
53
53
if err != nil {
54
- return false , emperror .WrapWith (err , "could not marshal new object" , "name" , new .Name )
54
+ return false , emperror .WrapWith (err , "could not marshal new object" , "name" , newOrig .Name )
55
55
}
56
56
57
57
matched , err := m .objectMatcher .MatchJSON (oldData , newData , newObject )
58
58
if err != nil {
59
- return false , emperror .WrapWith (err , "could not match objects" , "name" , new .Name )
59
+ return false , emperror .WrapWith (err , "could not match objects" , "name" , newOrig .Name )
60
60
}
61
61
62
62
return matched , nil
0 commit comments