-
Notifications
You must be signed in to change notification settings - Fork 322
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
Fixes tolerations not working #4315
Merged
missylbytes
merged 17 commits into
main
from
net-10843-cannot-add-tolerations-to-apigateway
Sep 23, 2024
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f677233
Fixes annotations not working, pushing to test bats tests
missylbytes f501b95
Added bats test
missylbytes 44fed44
bats start small
missylbytes f8d0bc6
bats try again
missylbytes ae82e6c
bats try again
missylbytes d90cc93
bats try again
missylbytes ef58d91
bats try again
missylbytes 0a6baf3
Merge branch 'main' into net-10843-cannot-add-tolerations-to-apigateway
missylbytes 9b63494
Adds changelog, updates command test, tries again with bats
missylbytes 4024d00
Accidentally put changelog in wrong file
missylbytes e22efb7
Accidentally left some test data
missylbytes 50cae96
bats
missylbytes d671aec
Merge branch 'main' into net-10843-cannot-add-tolerations-to-apigateway
missylbytes a89016d
bats
missylbytes 59fdd83
bats
missylbytes c0c93b1
bats cleanup
missylbytes e52f94c
Merge branch 'main' into net-10843-cannot-add-tolerations-to-apigateway
missylbytes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
helm: fix issue where the API Gateway GatewayClassConfig tolerations can not be parsed by the Helm chart. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,6 @@ target=templates/gateway-resources-job.yaml | |
--set 'connectInject.apiGateway.managedGatewayClass.deployment.minInstances=1' \ | ||
--set 'connectInject.apiGateway.managedGatewayClass.deployment.maxInstances=3' \ | ||
--set 'connectInject.apiGateway.managedGatewayClass.nodeSelector=foo: bar' \ | ||
--set 'connectInject.apiGateway.managedGatewayClass.tolerations=- key: bar' \ | ||
--set 'connectInject.apiGateway.managedGatewayClass.copyAnnotations.service.annotations=- bingo' \ | ||
--set 'connectInject.apiGateway.managedGatewayClass.serviceType=Foo' \ | ||
--set 'connectInject.apiGateway.managedGatewayClass.openshiftSCCName=hello' \ | ||
|
@@ -90,23 +89,11 @@ target=templates/gateway-resources-job.yaml | |
local actual=$(echo "$spec" | jq 'any(index("-service-type=Foo"))') | ||
[ "${actual}" = "true" ] | ||
|
||
local actual=$(echo "$spec" | jq '.[12]') | ||
[ "${actual}" = "\"-node-selector\"" ] | ||
|
||
local actual=$(echo "$spec" | jq '.[13]') | ||
[ "${actual}" = "\"foo: bar\"" ] | ||
|
||
local actual=$(echo "$spec" | jq '.[14] | ."-tolerations=- key"') | ||
[ "${actual}" = "\"bar\"" ] | ||
|
||
local actual=$(echo "$spec" | jq '.[15]') | ||
[ "${actual}" = "\"-service-annotations\"" ] | ||
|
||
local actual=$(echo "$spec" | jq '.[16]') | ||
[ "${actual}" = "\"- bingo\"" ] | ||
local actual=$(echo $spec | yq 'contains(["-node-selector", "foo: bar"])') | ||
[ "${actual}" = "true" ] | ||
|
||
local actual=$(echo "$spec" | jq '.[17]') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was already tested on line 90 |
||
[ "${actual}" = "\"-service-type=Foo\"" ] | ||
local actual=$(echo $spec | yq 'contains(["-service-annotations", "- bingo"])') | ||
[ "${actual}" = "true" ] | ||
} | ||
|
||
@test "apiGateway/GatewayClassConfig: custom configuration openshift enabled" { | ||
|
@@ -138,3 +125,26 @@ target=templates/gateway-resources-job.yaml | |
tee /dev/stderr) | ||
[ "${actual}" = "{}" ] | ||
} | ||
|
||
|
||
#-------------------------------------------------------------------- | ||
# tolerations | ||
|
||
@test "apiGateway/GatewayClassConfig: tolerations" { | ||
cd `chart_dir` | ||
local tolerations=$(helm template \ | ||
-s $target \ | ||
--set 'connectInject.apiGateway.managedGatewayClass.tolerations=- "operator": "Equal" \ | ||
"effect": "NoSchedule" \ | ||
"key": "node" \ | ||
"value": "clients" \ | ||
- "operator": "Equal" \ | ||
"effect": "NoSchedule" \ | ||
"key": "node2" \ | ||
"value": "clients2"' \ | ||
. | tee /dev/stderr | | ||
yq '.spec.template.spec.containers[0].args' | tee /dev/stderr) | ||
|
||
local actual=$(echo $tolerations | yq 'contains(["tolerations","- \"operator\": \"Equal\" \n\"effect\": \"NoSchedule\" \n\"key\": \"node\" \n\"value\": \"clients\" \n- \"operator\": \"Equal\" \n\"effect\": \"NoSchedule\" \n\"key\": \"node2\" \n\"value\": \"clients2\"" ])') | ||
[ "${actual}" = "true" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Tolerations were moved to their own test