-
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 <[email protected]>
Signed-off-by: Eugene Lugovtsov <[email protected]>
@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 <[email protected]>
@Eldarrin thanks for your help. I updated PR |
Signed-off-by: Eugene Lugovtsov <[email protected]>
@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 <[email protected]>
@zroubalik yep, we want to be sure, that |
Signed-off-by: Eugene Lugovtsov <[email protected]>
/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 <[email protected]>
…<[email protected]> Co-authored-by: Andy Ward <[email protected]> Co-authored-by: Tom Kerkhove <[email protected]> Co-authored-by: Zbynek Roubalik <[email protected]> Co-authored-by: Eldarrin <[email protected]> Co-authored-by: Eugene Lugovtsov <[email protected]> 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 <[email protected]> Signed-off-by: Jorge Turrado <[email protected]> * fix(aws-sqs): Respect `scaleOnInFlight` value (#4358) Signed-off-by: Jorge Turrado <[email protected]> Signed-off-by: Jorge Turrado <[email protected]> * chore: update supported versions in the welcome message (#4360) Signed-off-by: Jorge Turrado <[email protected]> * fix odd number of arguments passed as key-value pairs for logging (#4369) Signed-off-by: Zbynek Roubalik <[email protected]> Signed-off-by: Jorge Turrado <[email protected]> * fix: Azure Pipelines Scaler uses correct endpoint when demands are set (#4387) (#4401) Co-authored-by: Jorge Turrado Ferrero <[email protected]> Co-authored-by: Andy Ward <[email protected]> Signed-off-by: Jorge Turrado <[email protected]> * fix: respect all required demands in azure pipeline scaler (#4405) Signed-off-by: Jorge Turrado <[email protected]> * fix: Allow to remove the finalizer even if the ScaledObject isn't valid (#4397) Co-authored-by: Tom Kerkhove <[email protected]> Signed-off-by: Jorge Turrado <[email protected]> * update changelog Signed-off-by: Jorge Turrado <[email protected]> --------- Signed-off-by: Zbynek Roubalik <[email protected]> Signed-off-by: Jorge Turrado <[email protected]> Signed-off-by: Jorge Turrado <[email protected]> Co-authored-by: Zbynek Roubalik <[email protected]> Co-authored-by: Eldarrin <[email protected]> Co-authored-by: Andy Ward <[email protected]> Co-authored-by: Eugene Lugovtsov <[email protected]> Co-authored-by: Tom Kerkhove <[email protected]>
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 #