Skip to content

Commit

Permalink
fix: make sure nonSpotWeight does not go below 100
Browse files Browse the repository at this point in the history
  • Loading branch information
omBratteng committed Oct 30, 2024
1 parent d92ef01 commit bd0c082
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/k8s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export const createAutoscaledApplication = ({

if (spot?.enabled && !isAdhocEnv) {
const spotWeight = spot?.weight ?? defaultSpotWeight;
const nonSpotWeight = 100 - spotWeight;
const nonSpotWeight = Math.max(0, 100 - spotWeight);
tolerations.push({
key: 'spot',
operator: 'Equal',
Expand Down
2 changes: 1 addition & 1 deletion src/suite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function deployCron(

if (spot?.enabled) {
const spotWeight = spot?.weight ?? defaultSpotWeight;
const nonSpotWeight = 100 - spotWeight;
const nonSpotWeight = Math.max(0, 100 - spotWeight);
tolerations.push({
key: 'spot',
operator: 'Equal',
Expand Down

0 comments on commit bd0c082

Please sign in to comment.