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
echo"Label Cert Manager resources to prepare for Backup."
45
+
echo"Cert Manager namespace is always required."
46
+
echo""
47
+
echo"Options:"
48
+
echo" --oc string Optional. File path to oc CLI. Default uses oc in your PATH. Can also be set in env.properties."
49
+
echo" --cert-manager-ns Optional. Specifying will enable labeling of the cert manager operator. Permissions may need to be updated to include the namespace."
50
+
echo" --enable-private-catalog Optional. Specifying will look for catalog sources in the operator namespace. If enabled, will look for cert manager in its respective namespaces."
51
+
echo" --cert-manager-catalog Optional. Specifying will look for the cert manager catalog source name."
52
+
echo" --cert-manager-catalog-ns Optional. Specifying will look for the cert manager catalog source namespace."
53
+
echo" -h, --help Print usage information"
54
+
echo""
55
+
56
+
}
57
+
58
+
functionparse_arguments() {
59
+
script_name=`basename ${0}`
60
+
echo"All arguments passed into the ${script_name}: $@"
61
+
echo""
62
+
63
+
# process options
64
+
while [[ "$@"!="" ]];do
65
+
case"$1"in
66
+
--oc)
67
+
shift
68
+
OC=$1
69
+
;;
70
+
--cert-manager-ns)
71
+
shift
72
+
CERT_MANAGER_NAMESPACE=$1
73
+
;;
74
+
--enable-private-catalog)
75
+
ENABLE_PRIVATE_CATALOG=1
76
+
;;
77
+
--cert-manager-catalog)
78
+
shift
79
+
CM_SOURCE=$1
80
+
;;
81
+
--cert-manager-catalog-ns)
82
+
shift
83
+
CM_SOURCE_NS=$1
84
+
;;
85
+
-h | --help)
86
+
print_usage
87
+
exit 1
88
+
;;
89
+
*)
90
+
echo"Entered option $1 not supported. Run ./${script_name} -h for script usage info."
91
+
;;
92
+
esac
93
+
shift
94
+
done
95
+
echo""
96
+
}
97
+
98
+
functionpre_req(){
99
+
100
+
title "Start to validate the parameters passed into script... "
101
+
# Checking oc command logged in
102
+
user=$($OC whoami 2> /dev/null)
103
+
if [ $?-ne 0 ];then
104
+
error "You must be logged into the OpenShift Cluster from the oc command line"
105
+
else
106
+
success "oc command logged in as ${user}"
107
+
fi
108
+
}
109
+
110
+
functionlabel_catalogsource() {
111
+
112
+
title "Start to label the Cert Manager catalog sources... "
113
+
# Label the Private CatalogSources in provided namespaces
0 commit comments