-
-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathview.sh
More file actions
35 lines (25 loc) · 546 Bytes
/
view.sh
File metadata and controls
35 lines (25 loc) · 546 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env sh
set -eu
view_usage() {
cat <<EOF
helm secrets view [ --driver <driver> | -d <driver> ] <path to file>
View specified encrypted yaml file
Typical usage:
$ helm secrets view secrets/myproject/nginx/secrets.yaml | grep basic_auth
EOF
}
view_helper() {
file="$1"
if [ ! -f "${file}" ]; then
printf 'File does not exist: %s\n' "${file}"
exit 1
fi
driver_decrypt_file "yaml" "${file}"
}
view() {
if is_help "$1"; then
view_usage
return
fi
view_helper "$1"
}