Skip to content

Commit

Permalink
- review comments incorporated
Browse files Browse the repository at this point in the history
  • Loading branch information
ravikanth-nalla-hpe committed Aug 9, 2024
1 parent 3c42bff commit 2e8f978
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ansible/config_sbps_iscsi_targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
# Configure SBPS DNS "SRV" and "A" records
- role: csm.sbps.dns_srv_records
# Mount s3 bucket 'boot-images' using s3fs read-only policy for SBPS agent
#- role: csm.sbps.mount_s3_images
- role: csm.sbps.mount_s3_images
9 changes: 5 additions & 4 deletions ansible/roles/csm.sbps.apply_label/files/apply_k8s_label.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
LABEL="iscsi=sbps"
HOST_NAME="$(awk '{print $1}' /etc/hostname)"

if ! kubectl get nodes -l $LABEL | grep -q "$HOST_NAME"
then
kubectl label nodes "$HOST_NAME" $LABEL
fi
# If the label is already applied to this node, then exit
kubectl get nodes -l "$LABEL" --no-headers | grep -Eq "^${HOST_NAME}[[:space:]]" && exit 0

# Otherwise, apply the label to the node
kubectl label nodes "$HOST_NAME" "$LABEL"

0 comments on commit 2e8f978

Please sign in to comment.