-
Notifications
You must be signed in to change notification settings - Fork 873
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support selectively disabling active/standby services and service dis…
…covery role (#811)
- Loading branch information
Showing
12 changed files
with
155 additions
and
4 deletions.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bats | ||
|
||
load _helpers | ||
|
||
@test "server/DiscoveryRole: enabled by default with ha" { | ||
cd `chart_dir` | ||
local actual=$( (helm template \ | ||
--show-only templates/server-discovery-role.yaml \ | ||
. || echo "---") | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
|
||
local actual=$( (helm template \ | ||
--show-only templates/server-discovery-role.yaml \ | ||
--set 'server.ha.enabled=true' \ | ||
. || echo "---") | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "true" ] | ||
} | ||
|
||
@test "server/DiscoveryRole: can disable with server.enabled false" { | ||
cd `chart_dir` | ||
local actual=$( (helm template \ | ||
--show-only templates/server-discovery-role.yaml \ | ||
--set 'server.enabled=false' \ | ||
--set 'server.ha.enabled=true' \ | ||
. || echo "---") | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
} | ||
|
||
@test "server/DiscoveryRole: can disable with server.serviceAccount.serviceDiscovery.enabled false" { | ||
cd `chart_dir` | ||
local actual=$( (helm template \ | ||
--show-only templates/server-discovery-role.yaml \ | ||
--set 'server.ha.enabled=true' \ | ||
--set 'server.serviceAccount.serviceDiscovery.enabled=false' \ | ||
. || echo "---") | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
} |
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,41 @@ | ||
#!/usr/bin/env bats | ||
|
||
load _helpers | ||
|
||
@test "server/DiscoveryRoleBinding: enabled by default with ha" { | ||
cd `chart_dir` | ||
local actual=$( (helm template \ | ||
--show-only templates/server-discovery-rolebinding.yaml \ | ||
. || echo "---") | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
|
||
local actual=$( (helm template \ | ||
--show-only templates/server-discovery-rolebinding.yaml \ | ||
--set 'server.ha.enabled=true' \ | ||
. || echo "---") | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "true" ] | ||
} | ||
|
||
@test "server/DiscoveryRoleBinding: can disable with server.enabled false" { | ||
cd `chart_dir` | ||
local actual=$( (helm template \ | ||
--show-only templates/server-discovery-rolebinding.yaml \ | ||
--set 'server.enabled=false' \ | ||
--set 'server.ha.enabled=true' \ | ||
. || echo "---") | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
} | ||
|
||
@test "server/DiscoveryRoleBinding: can disable with server.serviceAccount.serviceDiscovery.enabled false" { | ||
cd `chart_dir` | ||
local actual=$( (helm template \ | ||
--show-only templates/server-discovery-rolebinding.yaml \ | ||
--set 'server.ha.enabled=true' \ | ||
--set 'server.serviceAccount.serviceDiscovery.enabled=false' \ | ||
. || echo "---") | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
} |
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
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