@@ -23,7 +23,7 @@ import (
23
23
// Converter is an interface to the conversion logic. The converter
24
24
// needs to be able to convert objects from one version to another.
25
25
type Converter interface {
26
- Convert (object typed.TypedValue , version fieldpath.APIVersion ) (typed.TypedValue , error )
26
+ Convert (object * typed.TypedValue , version fieldpath.APIVersion ) (* typed.TypedValue , error )
27
27
IsMissingVersionError (error ) bool
28
28
}
29
29
@@ -33,12 +33,12 @@ type Updater struct {
33
33
Converter Converter
34
34
}
35
35
36
- func (s * Updater ) update (oldObject , newObject typed.TypedValue , version fieldpath.APIVersion , managers fieldpath.ManagedFields , workflow string , force bool ) (fieldpath.ManagedFields , error ) {
36
+ func (s * Updater ) update (oldObject , newObject * typed.TypedValue , version fieldpath.APIVersion , managers fieldpath.ManagedFields , workflow string , force bool ) (fieldpath.ManagedFields , error ) {
37
37
conflicts := fieldpath.ManagedFields {}
38
38
removed := fieldpath.ManagedFields {}
39
39
type Versioned struct {
40
- oldObject typed.TypedValue
41
- newObject typed.TypedValue
40
+ oldObject * typed.TypedValue
41
+ newObject * typed.TypedValue
42
42
}
43
43
versions := map [fieldpath.APIVersion ]Versioned {
44
44
version : Versioned {
@@ -119,7 +119,7 @@ func (s *Updater) update(oldObject, newObject typed.TypedValue, version fieldpat
119
119
// that you intend to persist (after applying the patch if this is for a
120
120
// PATCH call), and liveObject must be the original object (empty if
121
121
// this is a CREATE call).
122
- func (s * Updater ) Update (liveObject , newObject typed.TypedValue , version fieldpath.APIVersion , managers fieldpath.ManagedFields , manager string ) (fieldpath.ManagedFields , error ) {
122
+ func (s * Updater ) Update (liveObject , newObject * typed.TypedValue , version fieldpath.APIVersion , managers fieldpath.ManagedFields , manager string ) (fieldpath.ManagedFields , error ) {
123
123
var err error
124
124
managers = shallowCopyManagers (managers )
125
125
managers , err = s .update (liveObject , newObject , version , managers , manager , true )
@@ -146,7 +146,7 @@ func (s *Updater) Update(liveObject, newObject typed.TypedValue, version fieldpa
146
146
// Apply should be called when Apply is run, given the current object as
147
147
// well as the configuration that is applied. This will merge the object
148
148
// and return it.
149
- func (s * Updater ) Apply (liveObject , configObject typed.TypedValue , version fieldpath.APIVersion , managers fieldpath.ManagedFields , manager string , force bool ) (typed.TypedValue , fieldpath.ManagedFields , error ) {
149
+ func (s * Updater ) Apply (liveObject , configObject * typed.TypedValue , version fieldpath.APIVersion , managers fieldpath.ManagedFields , manager string , force bool ) (* typed.TypedValue , fieldpath.ManagedFields , error ) {
150
150
managers = shallowCopyManagers (managers )
151
151
newObject , err := liveObject .Merge (configObject )
152
152
if err != nil {
@@ -185,7 +185,7 @@ func shallowCopyManagers(managers fieldpath.ManagedFields) fieldpath.ManagedFiel
185
185
// * applyingManager applied it last time
186
186
// * applyingManager didn't apply it this time
187
187
// * no other applier claims to manage it
188
- func (s * Updater ) prune (merged typed.TypedValue , managers fieldpath.ManagedFields , applyingManager string , lastSet * fieldpath.VersionedSet ) (typed.TypedValue , error ) {
188
+ func (s * Updater ) prune (merged * typed.TypedValue , managers fieldpath.ManagedFields , applyingManager string , lastSet * fieldpath.VersionedSet ) (* typed.TypedValue , error ) {
189
189
if lastSet == nil || lastSet .Set .Empty () {
190
190
return merged , nil
191
191
}
@@ -210,7 +210,7 @@ func (s *Updater) prune(merged typed.TypedValue, managers fieldpath.ManagedField
210
210
211
211
// addBackOwnedItems adds back any list and map items that were removed by prune,
212
212
// but other appliers (or the current applier's new config) claim to own.
213
- func (s * Updater ) addBackOwnedItems (merged , pruned typed.TypedValue , managedFields fieldpath.ManagedFields , applyingManager string ) (typed.TypedValue , error ) {
213
+ func (s * Updater ) addBackOwnedItems (merged , pruned * typed.TypedValue , managedFields fieldpath.ManagedFields , applyingManager string ) (* typed.TypedValue , error ) {
214
214
var err error
215
215
managedAtVersion := map [fieldpath.APIVersion ]* fieldpath.Set {}
216
216
for _ , managerSet := range managedFields {
@@ -253,7 +253,7 @@ func (s *Updater) addBackOwnedItems(merged, pruned typed.TypedValue, managedFiel
253
253
// addBackDanglingItems makes sure that the only items removed by prune are items that were
254
254
// previously owned by the currently applying manager. This will add back unowned items and items
255
255
// which are owned by Updaters that shouldn't be removed.
256
- func (s * Updater ) addBackDanglingItems (merged , pruned typed.TypedValue , lastSet * fieldpath.VersionedSet ) (typed.TypedValue , error ) {
256
+ func (s * Updater ) addBackDanglingItems (merged , pruned * typed.TypedValue , lastSet * fieldpath.VersionedSet ) (* typed.TypedValue , error ) {
257
257
convertedPruned , err := s .Converter .Convert (pruned , lastSet .APIVersion )
258
258
if err != nil {
259
259
if s .Converter .IsMissingVersionError (err ) {
0 commit comments