Skip to content

Commit

Permalink
Merge branch 'master' into updateapidep
Browse files Browse the repository at this point in the history
  • Loading branch information
fbm3307 authored Jan 17, 2025
2 parents f795a6d + 304ca61 commit 8c68331
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions controllers/idler/idler_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ func (r *Reconciler) scaleDeploymentConfigToZero(ctx context.Context, namespace
return "", "", false, err
}
dc.Spec.Replicas = 0
dc.Spec.Paused = false
if err := r.AllNamespacesClient.Update(ctx, dc); err != nil {
return "", "", false, err
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/idler/idler_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ func preparePayloads(t *testing.T, r *Reconciler, namespace, namePrefix string,
// DeploymentConfig
dc := &openshiftappsv1.DeploymentConfig{
ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("%s%s-deploymentconfig", namePrefix, namespace), Namespace: namespace},
Spec: openshiftappsv1.DeploymentConfigSpec{Replicas: replicas},
Spec: openshiftappsv1.DeploymentConfigSpec{Replicas: replicas, Paused: true},
}
err = r.AllNamespacesClient.Create(context.TODO(), dc)
require.NoError(t, err)
Expand Down
1 change: 1 addition & 0 deletions test/idler_assertion.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func (a *IdleablePayloadAssertion) DeploymentConfigScaledDown(deployment *opensh
err := a.client.Get(context.TODO(), types.NamespacedName{Name: deployment.Name, Namespace: deployment.Namespace}, d)
require.NoError(a.t, err)
assert.Equal(a.t, int32(0), d.Spec.Replicas)
assert.False(a.t, d.Spec.Paused) // DeploymentConfig should be unpaused when scaling down so that the replicas update can be rolled out
return a
}

Expand Down

0 comments on commit 8c68331

Please sign in to comment.