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!: fix CheckFallbackValid logic #6538

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

y-rabie
Copy link
Contributor

@y-rabie y-rabie commented Feb 10, 2025

This fixes the CheckFallbackValid logic used in the admission webhook. The way it should go is:

  • If we are using ScalingModifiers and ScaledObject.Spec.Advanced.ScalingModifiers.MetricType is not AverageValue, then this is invalid. So, this becomes inline with the change in fix: fix isFallbackEnabled when using scaling modifiers #6521

  • If we are not using ScalingModifiers

    1. If only cpu and memory are used, then fallback is invalid.
    2. If some other triggers are used (solely or in addition to cpu/memory), and not one of them has AverageValue type, then fallback is invalid.
    3. If some other triggers are used (solely or in addition to cpu/memory), and at least one of them has AverageValue type, then fallback is valid. This is actually inline with the code logic with the function doFallback, where it is called for every metricSpec that has the type AverageValue.

The PR #6407 seems related to this. I am not sure what it is trying to do per se with regards to the cpu and memory. Because it seems to be logging instead of returning the error when encountering cpu/memory, then falling to the next if condition which will return the error either way

Checklist

@y-rabie y-rabie requested a review from a team as a code owner February 10, 2025 18:26
@y-rabie y-rabie force-pushed the fix-CheckFallbackValid branch 3 times, most recently from b65860d to 613c653 Compare February 10, 2025 18:44
@y-rabie
Copy link
Contributor Author

y-rabie commented Feb 10, 2025

@zroubalik @JorTurFer If any of you guys has time to look into this 😅 , I think this needs to be released in v2.17.0 along with the rest of changes.

@JorTurFer
Copy link
Member

The PR #6407 seems related to this. I am not sure what it is trying to do per se with regards to the cpu and memory. Because it seems to be logging instead of returning the error when encountering cpu/memory, then falling to the next if condition which will return the error either way

Actually, CPU and memory support AverageValue but it's true that this doesn't make sense, the check should be:

  • If CPU/Memory scaler, just continue with the iteration without failing
  • At the end of the iterations, if there are only CPU/Memory scalers and fallback enabled, raise an error (because fallback with only CPU/Memory is a failure)

@JorTurFer
Copy link
Member

lol, my point was literally your message 🤦
I must read more slowly

@zroubalik
Copy link
Member

zroubalik commented Feb 11, 2025

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

@y-rabie y-rabie force-pushed the fix-CheckFallbackValid branch from 8af61c3 to e931267 Compare February 13, 2025 15:30
@heshamelsherif97
Copy link

I feel like this needs to get merged before the 2.17 release @JorTurFer

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.

4 participants