Skip to content

Commit ed6308c

Browse files
committed
Linting: shfmt (2)
1 parent e298a3e commit ed6308c

File tree

9 files changed

+596
-625
lines changed

9 files changed

+596
-625
lines changed

logging/bin/deploy_logging_azmonitor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source logging/bin/common.sh
1111
tmpfile=$TMP_DIR/output.txt
1212
rm -f tmpfile
1313

14-
if [ "$(kubectl get ns "$LOG_NS" -o name 2>/dev/null)" == "" ]; then
14+
if [ "$(kubectl get ns "$LOG_NS" -o name 2> /dev/null)" == "" ]; then
1515
kubectl create ns "$LOG_NS"
1616
fi
1717

logging/bin/offboard.sh

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ source logging/bin/rbac-include.sh
1313
this_script=$(basename "$0")
1414

1515
function show_usage {
16-
log_message "Usage: $this_script --namespace NAMESPACE [--tenant TENANT] [OPTIONS]"
17-
log_message ""
18-
log_message "'Offboards' either the specified SAS Viya deployment (namespace) or the specified tenant within that deployment. This removes the ability to limit admins to the SAS Viya deployment (or a single tenant within a given deployment)."
19-
log_message "The offboarding process deletes the security access controls and the associated OpenSearch Dashboards tenant space (including any saved OpenSearch Dashboards content (e.g. visualizations, dashboards, etc.)."
20-
log_message ""
21-
log_message " Arguments:"
22-
log_message " -ns, --namespace NAMESPACE - (Required) The SAS Viya deployment/Kubernetes Namespace to which access should be removed."
23-
log_message " -t, --tenant TENANT - (Optional) The tenant within the specific SAS Viya deployment/Kubernetes Namespace to which access should be removed."
24-
log_message ""
25-
#log_message " Options:"
26-
#log_message ""
16+
log_message "Usage: $this_script --namespace NAMESPACE [--tenant TENANT] [OPTIONS]"
17+
log_message ""
18+
log_message "'Offboards' either the specified SAS Viya deployment (namespace) or the specified tenant within that deployment. This removes the ability to limit admins to the SAS Viya deployment (or a single tenant within a given deployment)."
19+
log_message "The offboarding process deletes the security access controls and the associated OpenSearch Dashboards tenant space (including any saved OpenSearch Dashboards content (e.g. visualizations, dashboards, etc.)."
20+
log_message ""
21+
log_message " Arguments:"
22+
log_message " -ns, --namespace NAMESPACE - (Required) The SAS Viya deployment/Kubernetes Namespace to which access should be removed."
23+
log_message " -t, --tenant TENANT - (Optional) The tenant within the specific SAS Viya deployment/Kubernetes Namespace to which access should be removed."
24+
log_message ""
25+
#log_message " Options:"
26+
#log_message ""
2727
}
2828

2929
# set flag indicating wrapper/driver script being run
@@ -34,41 +34,41 @@ export LOGGING_DRIVER=true
3434
#
3535
POS_PARMS=""
3636

37-
while (( "$#" )); do
37+
while (("$#")); do
3838
case "$1" in
39-
-ns | --namespace)
40-
if [ -n "$2" ] && [ "${2:0:1}" != "-" ]; then
41-
namespace=$2
42-
shift 2
43-
else
44-
log_error "A value for parameter [NAMESPACE] has not been provided." >&2
45-
show_usage
46-
exit 2
47-
fi
48-
;;
49-
-t | --tenant)
50-
if [ -n "$2" ] && [ "${2:0:1}" != "-" ]; then
51-
tenant=$2
52-
shift 2
53-
else
54-
log_error "A value for parameter [TENANT] has not been provided." >&2
55-
show_usage
56-
exit 2
57-
fi
58-
;;
59-
-h | --help)
39+
-ns | --namespace)
40+
if [ -n "$2" ] && [ "${2:0:1}" != "-" ]; then
41+
namespace=$2
42+
shift 2
43+
else
44+
log_error "A value for parameter [NAMESPACE] has not been provided." >&2
6045
show_usage
61-
exit
62-
;;
63-
--*= | -*) # unsupported flags
64-
log_error "Unsupported flag $1" >&2
46+
exit 2
47+
fi
48+
;;
49+
-t | --tenant)
50+
if [ -n "$2" ] && [ "${2:0:1}" != "-" ]; then
51+
tenant=$2
52+
shift 2
53+
else
54+
log_error "A value for parameter [TENANT] has not been provided." >&2
6555
show_usage
66-
exit 1
67-
;;
68-
*) # preserve positional arguments
69-
POS_PARMS="$POS_PARMS $1"
70-
shift
71-
;;
56+
exit 2
57+
fi
58+
;;
59+
-h | --help)
60+
show_usage
61+
exit
62+
;;
63+
--*= | -*) # unsupported flags
64+
log_error "Unsupported flag $1" >&2
65+
show_usage
66+
exit 1
67+
;;
68+
*) # preserve positional arguments
69+
POS_PARMS="$POS_PARMS $1"
70+
shift
71+
;;
7272
esac
7373
done
7474

@@ -162,7 +162,6 @@ else
162162
log_warn "There was an issue deleting the index [${kibana_index_name}_*] holding content related to OpenSearch Dashboards tenant space [$ktenant]. You may need to manually delete this index. [$response]"
163163
fi
164164

165-
166165
# Delete access controls
167166
./logging/bin/security_delete_rbac.sh "$namespace" "$tenant"
168167

0 commit comments

Comments
 (0)