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

Add config as parameter to help validate scaler meta data #5819

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SpiritZhou
Copy link
Contributor

@SpiritZhou SpiritZhou commented May 22, 2024

Add config as parameter in the Validator func so that we can move all validator into this func, such as checking some situation under config.AsMetricSource. #5808 (comment)

Checklist

Relates to # #5037

Signed-off-by: SpiritZhou <iammrzhouzhenghan@gmail.com>
@SpiritZhou SpiritZhou requested a review from a team as a code owner May 22, 2024 02:45
Signed-off-by: SpiritZhou <iammrzhouzhenghan@gmail.com>
Signed-off-by: SpiritZhou <iammrzhouzhenghan@gmail.com>
@@ -46,7 +46,7 @@ type activeMQMetadata struct {
ActivationTargetQueueSize int64 `keda:"name=activationTargetQueueSize, order=triggerMetadata, optional, default=0"`
}

func (a *activeMQMetadata) Validate() error {
func (a *activeMQMetadata) Validate(_ scalersconfig.ScalerConfig) error {
Copy link
Member

@wozniakjan wozniakjan May 23, 2024

Choose a reason for hiding this comment

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

given there are currently two configs that implement Validate() and both would ignore this argument, I would like to wait for a little bit before merging the PR.

I understand it will be useful for #5808 but I think it makes sense for now to first see a few more configs refactored and then make a decision. If a good number of configs find it useful, then I'm happy to add it. But if it's just a handful of configs, then perhaps we can consider a different pattern for those that need it without putting restrictions on scaler configs that don't need it, wdyt?

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. Let's wait for other scalers or find another way to do it.

@wozniakjan wozniakjan mentioned this pull request May 23, 2024
4 tasks
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.

None yet

2 participants