Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a patch script that is to be run before Fusion operator upgrade #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions upgrade/preupgrade-patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

##############################################################################
#Script Name : preupgrade-patch.sh
#Description : Utility to patch the FSI CRs before upgrading the Fusion operator
#Args :
#Author : Vineeth Nair
#Email : [email protected]
##############################################################################

##############################################################################
# This utility will patch the FusionServiceInstance CRs present in the cluster
# to allow the Fusion operator upgrade to proceed without any issues
# Execute it from a bash shell where you have logged into the OpenShift cluster

function print_header() {
echo "================================ $1 ================================"
}

print_header "Patching triggerCatSrcCreateStartTime field in FusionServiceInstance CRs"
oc get fusionserviceinstance -o jsonpath='{.items[*].metadata.name}' |tr ' ' '\n' | xargs -I {} oc patch fusionserviceinstance {} --type=merge --subresource=status -p '{"status": {"triggerCatSrcCreateStartTime": 0}}'

print_header "Patching currentInstallStartTime field in FusionServiceInstance CRs"
oc get fusionserviceinstance -o jsonpath='{.items[*].metadata.name}' |tr ' ' '\n' | xargs -I {} oc patch fusionserviceinstance {} --type=merge --subresource=status -p '{"status": {"currentInstallStartTime": 0}}'

print_header "Patching operatorUpgradeStartTime field in FusionServiceInstance CRs"
oc get fusionserviceinstance -o jsonpath='{.items[*].metadata.name}' |tr ' ' '\n' | xargs -I {} oc patch fusionserviceinstance {} --type=merge --subresource=status -p '{"status": {"operatorUpgradeStartTime": 0}}'

print_header "Patching operatorLastUpdateTime field in FusionServiceInstance CRs"
oc get fusionserviceinstance -o jsonpath='{.items[*].metadata.name}' |tr ' ' '\n' | xargs -I {} oc patch fusionserviceinstance {} --type=merge --subresource=status -p '{"status": {"operatorLastUpdateTime": 0}}'