Skip to content

Commit

Permalink
add info functions (#2023)
Browse files Browse the repository at this point in the history
Signed-off-by: YuChen <[email protected]>
  • Loading branch information
YCShen1010 authored Jun 4, 2024
1 parent d3be65d commit a121785
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions velero/backup/common-service/label-common-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ CM_SOURCE_NS="openshift-marketplace"
LIS_SOURCE_NS="openshift-marketplace"
LSR_SOURCE_NS="openshift-marketplace"

# Additional CatalogSources
ADDITIONAL_SOURCES=""

# default values no change
Expand All @@ -41,12 +42,9 @@ BASE_DIR=$(cd $(dirname "$0")/$(dirname "$(readlink $0)") && pwd -P)

# ---------- Main functions ----------

. ${BASE_DIR}/../../../cp3pt0-deployment/common/utils.sh

source ${BASE_DIR}/env.properties

function main() {

pre_req
label_catalogsource
label_ns_and_related
Expand Down Expand Up @@ -193,6 +191,33 @@ function label_cs(){
echo ""
}

# ---------- Info functions ----------#

function msg() {
printf '%b\n' "$1"
}

function success() {
msg "\33[32m[✔] ${1}\33[0m"
}

function error() {
msg "\33[31m[✘] ${1}\33[0m"
exit 1
}

function title() {
msg "\33[34m# ${1}\33[0m"
}

function info() {
msg "[INFO] ${1}"
}

function warning() {
msg "\33[33m[✗] ${1}\33[0m"
}

main $*

# ---------------- finish ----------------

0 comments on commit a121785

Please sign in to comment.