You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)."
20
-
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.)."
21
-
log_message ""
22
-
log_message " Arguments:"
23
-
log_message " -ns, --namespace NAMESPACE - (Required) The SAS Viya deployment/Kubernetes Namespace to which access should be removed."
24
-
log_message " -t, --tenant TENANT - (Optional) The tenant within the specific SAS Viya deployment/Kubernetes Namespace to which access should be removed."
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 ""
28
27
}
29
28
30
-
31
29
# set flag indicating wrapper/driver script being run
32
30
export LOGGING_DRIVER=true
33
31
34
-
35
32
#
36
33
#Handle arguments and parameters
37
34
#
38
35
POS_PARMS=""
39
36
40
37
while(( "$#" ));do
41
-
case"$1"in
42
-
-ns|--namespace)
43
-
if [ -n"$2" ] && [ "${2:0:1}"!="-" ];then
44
-
namespace=$2
45
-
shift 2
46
-
else
47
-
log_error "A value for parameter [NAMESPACE] has not been provided.">&2
48
-
show_usage
49
-
exit 2
50
-
fi
51
-
;;
52
-
-t|--tenant)
53
-
if [ -n"$2" ] && [ "${2:0:1}"!="-" ];then
54
-
tenant=$2
55
-
shift 2
56
-
else
57
-
log_error "A value for parameter [TENANT] has not been provided.">&2
58
-
show_usage
59
-
exit 2
60
-
fi
61
-
;;
62
-
-h|--help)
63
-
show_usage
64
-
exit
65
-
;;
66
-
--*=|-*) # unsupported flags
67
-
log_error "Unsupported flag $1">&2
68
-
show_usage
69
-
exit 1
70
-
;;
71
-
*) # preserve positional arguments
72
-
POS_PARMS="$POS_PARMS$1"
73
-
shift
74
-
;;
75
-
esac
38
+
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)
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
+
;;
72
+
esac
76
73
done
77
74
78
75
# set positional arguments in their proper place
79
76
evalset -- "$POS_PARMS"
80
77
81
-
82
78
# No positional parameters are supported
83
79
if [ "$#"-ge 1 ];then
84
80
log_error "Unexpected additional arguments were found; exiting."
log_info "Deleted index [$kibana_index_name]. [$response]"
153
+
log_info "Deleted index [$kibana_index_name]. [$response]"
158
154
else
159
-
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]"
155
+
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]"
log_info "Deleted index [${kibana_index_name}_*]. [$response]"
160
+
log_info "Deleted index [${kibana_index_name}_*]. [$response]"
165
161
else
166
-
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]"
162
+
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]"
167
163
fi
168
164
169
165
@@ -173,16 +169,16 @@ fi
173
169
# Delete Grafana Datasource utility user (if exists)
174
170
grfds_user="${nst}_grafana_ds"
175
171
if user_exists "$grfds_user";then
176
-
log_verbose "Removing the [$grfds_user] utility account."
177
-
delete_user "$grfds_user"
172
+
log_verbose "Removing the [$grfds_user] utility account."
173
+
delete_user "$grfds_user"
178
174
fi
179
175
180
176
# Reminder that users are not deleted
181
177
add_notice ""
182
178
add_notice " The off-boarding process does NOT remove any users. If there "
183
179
add_notice " are users which are no longer needed after off-boarding the "
184
180
if [ -n"$tenant" ];then
185
-
add_notice " tenant [$tenant] within the "
181
+
add_notice " tenant [$tenant] within the "
186
182
fi
187
183
add_notice " SAS Viya deployment/namespace of [$namespace] "
188
184
add_notice " you must delete those users manually, either through the "
@@ -199,7 +195,7 @@ echo ""
199
195
200
196
# Exit with an overall success/failure message
201
197
if [ -n"$tenant" ];then
202
-
log_notice "Successfully offboarded tenant [$tenant] within namespace [$namespace] [$(date)]"
198
+
log_notice "Successfully offboarded tenant [$tenant] within namespace [$namespace] [$(date)]"
0 commit comments