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 issue where paused annotation being set to false still leads to scaled objects/jobs being paused #5257

Merged
merged 12 commits into from
Dec 22, 2023

Conversation

nappelson
Copy link
Contributor

@nappelson nappelson commented Dec 6, 2023

This PR adds "bool parsing" logic to the paused annotation. Keda docs suggests pausing scaledjobs/objects by setting the paused annotation to true. When I tried resuming the object by setting the annotation to false, I noticed the object remained paused.

Just for reference (https://go.dev/src/strconv/atob.go)

// ParseBool returns the boolean value represented by the string.
// It accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.

Checklist

Fixes #5215

Copy link

github-actions bot commented Dec 6, 2023

Thank you for your contribution! 🙏 We will review your PR as soon as possible.

While you are waiting, make sure to:

Learn more about:

@nappelson nappelson force-pushed the 5215-fix-paused-annotation branch 6 times, most recently from cf63b33 to 78a7479 Compare December 6, 2023 02:21
…caled objects/jobs being paused

commit 9eafdb6
Merge: 78a7479 bd91050
Author: Nate Appelson <nate.appelson@regrow.ag>
Date:   Tue Dec 5 21:30:08 2023 -0500

    Merge branch 'main' of github.com:nappelson/keda into 5215-fix-paused-annotation

    Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>

commit 78a7479
Author: Nate Appelson <nate.appelson@regrow.ag>
Date:   Tue Dec 5 21:15:52 2023 -0500

    Empty-Commit to trigger CI

commit d4530bd
Author: Nate Appelson <nate.appelson@regrow.ag>
Date:   Tue Dec 5 21:00:11 2023 -0500

    Fix issue where paused annotation being set to false still leads to scaled objects/jobs being paused

    Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>

Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
@nappelson
Copy link
Contributor Author

@zroubalik curious if you have thoughts on why the TestPredictKubeGetMetrics may be failing here... when I check out main directly and run the tests on my dev container i see that test fail as well.

The main-build appears to be passing on CI so I'm not 100% sure what is going on. Let me know if I'm missing something obvious. Happy to talk to someone else too. Otherwise, I'll dig more into what could be happening here.

@zroubalik
Copy link
Member

@zroubalik curious if you have thoughts on why the TestPredictKubeGetMetrics may be failing here... when I check out main directly and run the tests on my dev container i see that test fail as well.

The main-build appears to be passing on CI so I'm not 100% sure what is going on. Let me know if I'm missing something obvious. Happy to talk to someone else too. Otherwise, I'll dig more into what could be happening here.

Most likely a flaky test, pls disregard this one.

Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
@nappelson nappelson marked this pull request as ready for review December 14, 2023 22:57
@nappelson nappelson requested a review from a team as a code owner December 14, 2023 22:57
Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
…a into 5215-fix-paused-annotation

Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
@zroubalik
Copy link
Member

zroubalik commented Dec 15, 2023

/run-e2e internals
Update: You can check the progress here

@nappelson
Copy link
Contributor Author

/run-e2e internals Update: You can check the progress here

@zroubalik thanks for running these - curious why they failed remotely. I also see one of the controller tests is failing. I'll fix that shortly!

@nappelson
Copy link
Contributor Author

/run-e2e internals Update: You can check the progress here

@zroubalik thanks for running these! I also see one of the controller tests is failing. I'll fix that and the e2e test shortly.

@zroubalik
Copy link
Member

The problem seems to be in pause_scaledjob/pause_scaledjob_test.go let me rerun the test.

@zroubalik
Copy link
Member

zroubalik commented Dec 15, 2023

/run-e2e pause_scaledjob
Update: You can check the progress here

@zroubalik
Copy link
Member

zroubalik commented Dec 15, 2023

For unit tests it is as you said:

[FAIL] ScaledObjectController [It] scaledobject paused condition status changes to true on annotation
  /__w/keda/keda/controllers/keda/scaledobject_controller_test.go:935
  [FAIL] ScaledObjectController [It] deletes hpa when scaledobject has pause annotation
  /__w/keda/keda/controllers/keda/scaledobject_controller_test.go:1132

Could you please also rebase your PR? We have merged some annotations based PR: #5282

Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
…annotation

Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
@nappelson
Copy link
Contributor Author

For unit tests it is as you said:

[FAIL] ScaledObjectController [It] scaledobject paused condition status changes to true on annotation
  /__w/keda/keda/controllers/keda/scaledobject_controller_test.go:935
  [FAIL] ScaledObjectController [It] deletes hpa when scaledobject has pause annotation
  /__w/keda/keda/controllers/keda/scaledobject_controller_test.go:1132

Could you please also rebase your PR? We have merged some annotations based PR: #5282

@zroubalik this should be ready again. Appreciate your patience.

@zroubalik
Copy link
Member

zroubalik commented Dec 19, 2023

/run-e2e internals
Update: You can check the progress here

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot for the contribution! Great job.

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

Do you think you can also update docs for 2.13 mentioning that true/false works with the annotation?

CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
@nappelson
Copy link
Contributor Author

Do you think you can also update docs for 2.13 mentioning that true/false works with the annotation?

kedacore/keda-docs#1283 just created this

…annotation

Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
@zroubalik zroubalik merged commit df16ac1 into kedacore:main Dec 22, 2023
18 of 19 checks passed
toniiiik pushed a commit to toniiiik/keda that referenced this pull request Jan 15, 2024
…caled objects/jobs being paused (kedacore#5257)

Signed-off-by: Nate Appelson <nate.appelson@regrow.ag>
Signed-off-by: anton.lysina <alysina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting autoscaling.keda.sh/paused: "false" leads to ScaledObject/Job being paused
2 participants