-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: respect all required demands in azure pipeline scaler #4405
fix: respect all required demands in azure pipeline scaler #4405
Conversation
Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>
Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>
@zroubalik may I ask you to review this PR? |
@Eldarrin, could you take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you replace the function with this and resubmit, may fix the issue.
`
func stripAgentVFromArray(array []string) []string {
var result []string
for _, item := range array {
if !strings.HasPrefix(item, "Agent.Version") {
result = append(result, item)
}
}
return result
}
func getCanAgentDemandFulfilJob(jr JobRequest, metadata *azurePipelinesMetadata) bool {
countDemands := 0
demandsInJob := stripAgentVFromArray(jr.Demands)
demandsInScaler := stripAgentVFromArray(strings.Split(metadata.demands, ","))
for _, demandInJob := range demandsInJob {
for _, demandInScaler := range demandsInScaler {
if demandInJob == demandInScaler {
countDemands++
}
}
}
if metadata.requireAllDemands {
return countDemands == len(demandsInJob) && countDemands == len(demandsInScaler)
} else {
return countDemands == len(demandsInJob)
}
}`
Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>
@Eldarrin thanks for your help. I updated PR |
Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>
@Eldarrin could you please help with it? |
HI @EugeneLugovtsov I can't see anything wrong with it, @JorTurFer is there some sort of idiomatic thing I'm missing or is it possible to //nolint this? |
What is potentially suspicious is, that we are comparing the same property |
Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>
@zroubalik yep, we want to be sure, that |
Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>
/run-e2e azure* |
@zroubalik can you do the e2e with pipelines, not the whole of azure? looks like those are failing. Cheers :) |
/run-e2e pipeline* |
Yeah, Azure test are failing because this commit is required |
@JorTurFer @Eldarrin do I need to do something? do I need to add this commit ? |
Think you just need to complete the task list by checking the boxes at the top. |
@JorTurFer @Eldarrin could you help with the next steps? what do we need to do? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved from my end, all looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the fix! ❤️
/run-e2e pipeline* |
/run-e2e pipeline |
The e2e tests are failing due to expired PAT, I'll fix it asap |
/run-e2e pipeline |
…4405) Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
…<Jorge_turrado@hotmail.es> Co-authored-by: Andy Ward <mortx@toothless.eldarrin.io> Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com> Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com> Co-authored-by: Eldarrin <32762846+Eldarrin@users.noreply.github.com> Co-authored-by: Eugene Lugovtsov <34510252+EugeneLugovtsov@users.noreply.github.com> fix(aws-sqs): Respect `scaleOnInFlight` value (#4358) fix odd number of arguments passed as key-value pairs for logging (#4369) fix: Azure Pipelines Scaler uses correct endpoint when demands are set (#4387) (#4401) fix: respect all required demands in azure pipeline scaler (#4405) fix: Allow to remove the finalizer even if the ScaledObject isn't valid (#4397) * Drop a transitive dependency on bou.ke/monkey (#4366) Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com> Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl> * fix(aws-sqs): Respect `scaleOnInFlight` value (#4358) Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es> Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl> * chore: update supported versions in the welcome message (#4360) Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl> * fix odd number of arguments passed as key-value pairs for logging (#4369) Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com> Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl> * fix: Azure Pipelines Scaler uses correct endpoint when demands are set (#4387) (#4401) Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Co-authored-by: Andy Ward <mortx@toothless.eldarrin.io> Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl> * fix: respect all required demands in azure pipeline scaler (#4405) Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl> * fix: Allow to remove the finalizer even if the ScaledObject isn't valid (#4397) Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com> Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl> * update changelog Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl> --------- Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com> Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl> Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es> Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com> Co-authored-by: Eldarrin <32762846+Eldarrin@users.noreply.github.com> Co-authored-by: Andy Ward <mortx@toothless.eldarrin.io> Co-authored-by: Eugene Lugovtsov <34510252+EugeneLugovtsov@users.noreply.github.com> Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Fix issue with Azure Pipelines Scaler. When Azure DevOps does not provide
Agent.Version
keda may scale a wrong agent.Checklist
Fixes #
#4404
Relates to #