Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DeploymentConfig idling #614

Conversation

rajivnathan
Copy link
Contributor

@rajivnathan rajivnathan commented Jan 16, 2025

Copy link
Contributor

@alexeykazakov alexeykazakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing it!

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we set it to true and then check it was reset to false? Otherwise the test would pass even if we don't reset it, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, added 9563449

@@ -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
Copy link
Contributor

@xcoulon xcoulon Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be set d.Spec.Paused to true in the tests, before running the idler?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, added 9563449

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.59%. Comparing base (0a3edd0) to head (9563449).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #614   +/-   ##
=======================================
  Coverage   81.59%   81.59%           
=======================================
  Files          29       29           
  Lines        3292     3293    +1     
=======================================
+ Hits         2686     2687    +1     
  Misses        457      457           
  Partials      149      149           
Files with missing lines Coverage Δ
controllers/idler/idler_controller.go 93.33% <100.00%> (+0.01%) ⬆️

Copy link
Contributor

@alexeykazakov alexeykazakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link

openshift-ci bot commented Jan 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, rajivnathan, xcoulon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [alexeykazakov,rajivnathan,xcoulon]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@alexeykazakov alexeykazakov merged commit 304ca61 into codeready-toolchain:master Jan 16, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants