diff --git a/lib/autoupdate/rollout/reconciler.go b/lib/autoupdate/rollout/reconciler.go index 03436faf5eed8..1f1d1594722c8 100644 --- a/lib/autoupdate/rollout/reconciler.go +++ b/lib/autoupdate/rollout/reconciler.go @@ -48,7 +48,7 @@ const ( var ( defaultUpdateDays = []string{"Mon", "Tue", "Wed", "Thu"} - defaultGroup = &autoupdate.AgentAutoUpdateGroup{ + defaultGroup = autoupdate.AgentAutoUpdateGroup{ Name: defaultGroupName, Days: defaultUpdateDays, StartHour: defaultStartHour, @@ -370,7 +370,7 @@ func (r *reconciler) defaultConfigGroup(ctx context.Context) (*autoupdate.AgentA if err != nil { if trace.IsNotFound(err) { // There's no CMC, we return the default group. - return defaultGroup, nil + return &defaultGroup, nil } // If we had an error, and it's not trace.ErrNotFound, we stop. @@ -381,7 +381,7 @@ func (r *reconciler) defaultConfigGroup(ctx context.Context) (*autoupdate.AgentA if !ok { // The CMC is here but does not contain upgrade window. - return defaultGroup, nil + return &defaultGroup, nil } weekdays := upgradeWindow.Weekdays diff --git a/lib/autoupdate/rollout/reconciler_test.go b/lib/autoupdate/rollout/reconciler_test.go index 850a9ce5f0f1e..1a6a7d3d00fdc 100644 --- a/lib/autoupdate/rollout/reconciler_test.go +++ b/lib/autoupdate/rollout/reconciler_test.go @@ -890,7 +890,7 @@ func TestDefaultConfigGroup(t *testing.T) { cmcAnswer: callAnswer[*types.ClusterMaintenanceConfigV1]{ nil, trace.NotFound("no cmc"), }, - expectedResult: defaultGroup, + expectedResult: &defaultGroup, expectError: require.NoError, }, { @@ -902,7 +902,7 @@ func TestDefaultConfigGroup(t *testing.T) { }, }, nil, }, - expectedResult: defaultGroup, + expectedResult: &defaultGroup, expectError: require.NoError, }, {