Skip to content

Commit a9987c6

Browse files
committed
fix MAPI MachineSet providerSpec diff
1 parent e0114e3 commit a9987c6

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pkg/controllers/machinesetsync/machineset_sync_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ func compareCAPIMachineSets(capiMachineSet1, capiMachineSet2 *clusterv1.MachineS
13821382
// compareMAPIMachineSets compares MAPI machineSets a and b, and returns a list of differences, or none if there are none.
13831383
func compareMAPIMachineSets(platform configv1.PlatformType, a, b *mapiv1beta1.MachineSet) (util.DiffResult, error) {
13841384
diff, err := util.NewDefaultDiffer(
1385-
util.WithProviderSpec(platform, []string{"spec", "template", "providerSpec", "value"}, mapi2capi.ProviderSpecFromRawExtension),
1385+
util.WithProviderSpec(platform, []string{"spec", "template", "spec", "providerSpec", "value"}, mapi2capi.ProviderSpecFromRawExtension),
13861386

13871387
// Other status fields to ignore
13881388
util.WithIgnoreField("status", "replicas"),

pkg/util/diff.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,7 @@ func WithProviderSpec(platform configv1.PlatformType, path []string, marshalProv
294294
// unset the nested field
295295
unstructured.RemoveNestedField(obj, path...)
296296
// add it as top-level field
297-
if err := unstructured.SetNestedField(obj, providerSpec, d.providerSpecPath); err != nil {
298-
return fmt.Errorf("failed to set nested field %s: %w", d.providerSpecPath, err)
299-
}
297+
obj[d.providerSpecPath] = providerSpec
300298

301299
return nil
302300
}

0 commit comments

Comments
 (0)