Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Bastide <[email protected]>
  • Loading branch information
prb112 committed Apr 5, 2024
1 parent f69721d commit 956646d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ansible/post/files/destroy-workers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ PROXY_SERVER="${1}"
NAME_PREFIX="${2}"

# Get COUNT for all power workers with name having NAME_PREFIX
# Nodes that are NotReady are included in the count intentionally
COUNT=$(oc get nodes -l kubernetes.io/arch=ppc64le | grep "${NAME_PREFIX}" | grep -c Ready)
echo "Available COUNT for Power worker/s with Prefix '${NAME_PREFIX}' is $COUNT"
echo "Available COUNT for Power worker/s with Prefix '${NAME_PREFIX}' is ${COUNT}"

IDX=0
while [ "$IDX" -lt "$COUNT" ]
Expand Down
3 changes: 2 additions & 1 deletion modules/6_post/post.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ resource "null_resource" "post_setup" {
resource "null_resource" "remove_workers" {
depends_on = [null_resource.post_setup]

# var.worker["count"] is intentionally not included as a trigger
triggers = {
# count = var.worker["count"]
name_prefix = "${var.name_prefix}"
vpc_support_server_ip = "${var.nfs_server}"
private_key = sensitive(file(var.private_key_file))
Expand Down Expand Up @@ -80,6 +80,7 @@ EOF
resource "null_resource" "post_ansible" {
depends_on = [null_resource.remove_workers, null_resource.post_setup]

# Trigger for count and name_prefix enable scale-up and scale-down
triggers = {
count = var.worker["count"]
name_prefix = "${var.name_prefix}"
Expand Down

0 comments on commit 956646d

Please sign in to comment.