Skip to content

Commit

Permalink
update label script with cert manager config
Browse files Browse the repository at this point in the history
Signed-off-by: YuChen <[email protected]>
  • Loading branch information
YCShen1010 committed Dec 6, 2024
1 parent fb0a7b8 commit 9df416b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion velero/backup/common-service/label-common-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ function main() {
label_ns_and_related
label_configmap
label_subscription
if [[ $ENABLE_CERT_MANAGER -eq 1 ]]; then
label_cert_manager
fi
if [[ $ENABLE_LSR -eq 1 ]]; then
label_lsr
fi
Expand Down Expand Up @@ -323,7 +326,7 @@ function label_subscription() {

${OC} label subscriptions.operators.coreos.com $cs_pm foundationservices.cloudpak.ibm.com=subscription -n $OPERATOR_NS --overwrite=true 2>/dev/null
if [[ $ENABLE_CERT_MANAGER -eq 1 ]]; then
${OC} label subscriptions.operators.coreos.com $cm_pm foundationservices.cloudpak.ibm.com=singleton-subscription -n $CERT_MANAGER_NAMESPACE --overwrite=true 2>/dev/null
${OC} label subscriptions.operators.coreos.com $cm_pm foundationservices.cloudpak.ibm.com=cert-manager -n $CERT_MANAGER_NAMESPACE --overwrite=true 2>/dev/null
fi
if [[ $ENABLE_LICENSING -eq 1 ]]; then
${OC} label subscriptions.operators.coreos.com $lis_pm foundationservices.cloudpak.ibm.com=singleton-subscription -n $LICENSING_NAMESPACE --overwrite=true 2>/dev/null
Expand All @@ -334,6 +337,16 @@ function label_subscription() {
echo ""
}

function label_cert_manager(){
title "Start to label the Cert Manager resources... "
${OC} label customresourcedefinition certmanagerconfigs.operator.ibm.com foundationservices.cloudpak.ibm.com=cert-manager --overwrite=true 2>/dev/null
info "Start to label the Cert Manager Configs"
cert_manager_configs=$(${OC} get certmanagerconfigs.operator.ibm.com -n $CERT_MANAGER_NAMESPACE -o jsonpath='{.items[*].metadata.name}')
while IFS= read -r cert_manager_config; do
${OC} label certmanagerconfigs.operator.ibm.com $cert_manager_config foundationservices.cloudpak.ibm.com=cert-manager -n $CERT_MANAGER_NAMESPACE --overwrite=true 2>/dev/null
done <<< "$cert_manager_configs"
}

function label_lsr() {

title "Start to label the License Service Reporter... "
Expand Down

0 comments on commit 9df416b

Please sign in to comment.