@@ -34,8 +34,6 @@ type UpdaterBuilder struct {
34
34
Converter Converter
35
35
IgnoredFields map [fieldpath.APIVersion ]* fieldpath.Set
36
36
37
- EnableUnions bool
38
-
39
37
// Stop comparing the new object with old object after applying.
40
38
// This was initially used to avoid spurious etcd update, but
41
39
// since that's vastly inefficient, we've come-up with a better
@@ -49,7 +47,6 @@ func (u *UpdaterBuilder) BuildUpdater() *Updater {
49
47
return & Updater {
50
48
Converter : u .Converter ,
51
49
IgnoredFields : u .IgnoredFields ,
52
- enableUnions : u .EnableUnions ,
53
50
returnInputOnNoop : u .ReturnInputOnNoop ,
54
51
}
55
52
}
@@ -63,19 +60,9 @@ type Updater struct {
63
60
// Deprecated: This will eventually become private.
64
61
IgnoredFields map [fieldpath.APIVersion ]* fieldpath.Set
65
62
66
- enableUnions bool
67
-
68
63
returnInputOnNoop bool
69
64
}
70
65
71
- // EnableUnionFeature turns on union handling. It is disabled by default until the
72
- // feature is complete.
73
- //
74
- // Deprecated: Use the builder instead.
75
- func (s * Updater ) EnableUnionFeature () {
76
- s .enableUnions = true
77
- }
78
-
79
66
func (s * Updater ) update (oldObject , newObject * typed.TypedValue , version fieldpath.APIVersion , managers fieldpath.ManagedFields , workflow string , force bool ) (fieldpath.ManagedFields , * typed.Comparison , error ) {
80
67
conflicts := fieldpath.ManagedFields {}
81
68
removed := fieldpath.ManagedFields {}
@@ -160,12 +147,6 @@ func (s *Updater) Update(liveObject, newObject *typed.TypedValue, version fieldp
160
147
if err != nil {
161
148
return nil , fieldpath.ManagedFields {}, err
162
149
}
163
- if s .enableUnions {
164
- newObject , err = liveObject .NormalizeUnions (newObject )
165
- if err != nil {
166
- return nil , fieldpath.ManagedFields {}, err
167
- }
168
- }
169
150
managers , compare , err := s .update (liveObject , newObject , version , managers , manager , true )
170
151
if err != nil {
171
152
return nil , fieldpath.ManagedFields {}, err
@@ -198,22 +179,10 @@ func (s *Updater) Apply(liveObject, configObject *typed.TypedValue, version fiel
198
179
if err != nil {
199
180
return nil , fieldpath.ManagedFields {}, err
200
181
}
201
- if s .enableUnions {
202
- configObject , err = configObject .NormalizeUnionsApply (configObject )
203
- if err != nil {
204
- return nil , fieldpath.ManagedFields {}, err
205
- }
206
- }
207
182
newObject , err := liveObject .Merge (configObject )
208
183
if err != nil {
209
184
return nil , fieldpath.ManagedFields {}, fmt .Errorf ("failed to merge config: %v" , err )
210
185
}
211
- if s .enableUnions {
212
- newObject , err = configObject .NormalizeUnionsApply (newObject )
213
- if err != nil {
214
- return nil , fieldpath.ManagedFields {}, err
215
- }
216
- }
217
186
lastSet := managers [manager ]
218
187
set , err := configObject .ToFieldSet ()
219
188
if err != nil {
0 commit comments