@@ -32,7 +32,7 @@ type Updater struct {
32
32
Converter Converter
33
33
}
34
34
35
- func (s * Updater ) update (oldObject , newObject typed.TypedValue , managers fieldpath.ManagedFields , workflow string , force bool ) (fieldpath.ManagedFields , error ) {
35
+ func (s * Updater ) update (oldObject , newObject typed.TypedValue , version fieldpath. APIVersion , managers fieldpath.ManagedFields , workflow string , force bool ) (fieldpath.ManagedFields , error ) {
36
36
if managers == nil {
37
37
managers = fieldpath.ManagedFields {}
38
38
}
@@ -41,7 +41,12 @@ func (s *Updater) update(oldObject, newObject typed.TypedValue, managers fieldpa
41
41
oldObject typed.TypedValue
42
42
newObject typed.TypedValue
43
43
}
44
- versions := map [fieldpath.APIVersion ]Versioned {}
44
+ versions := map [fieldpath.APIVersion ]Versioned {
45
+ version : Versioned {
46
+ oldObject : oldObject ,
47
+ newObject : newObject ,
48
+ },
49
+ }
45
50
46
51
for manager , managerSet := range managers {
47
52
if manager == workflow {
@@ -92,7 +97,7 @@ func (s *Updater) update(oldObject, newObject typed.TypedValue, managers fieldpa
92
97
// this is a CREATE call).
93
98
func (s * Updater ) Update (liveObject , newObject typed.TypedValue , version fieldpath.APIVersion , managers fieldpath.ManagedFields , manager string ) (fieldpath.ManagedFields , error ) {
94
99
var err error
95
- managers , err = s .update (liveObject , newObject , managers , manager , true )
100
+ managers , err = s .update (liveObject , newObject , version , managers , manager , true )
96
101
if err != nil {
97
102
return fieldpath.ManagedFields {}, err
98
103
}
@@ -118,7 +123,7 @@ func (s *Updater) Apply(liveObject, configObject typed.TypedValue, version field
118
123
if err != nil {
119
124
return typed.TypedValue {}, fieldpath.ManagedFields {}, fmt .Errorf ("failed to merge config: %v" , err )
120
125
}
121
- managers , err = s .update (liveObject , newObject , managers , manager , force )
126
+ managers , err = s .update (liveObject , newObject , version , managers , manager , force )
122
127
if err != nil {
123
128
return typed.TypedValue {}, fieldpath.ManagedFields {}, err
124
129
}
0 commit comments