-
Notifications
You must be signed in to change notification settings - Fork 65
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
[OC-1082]: migration script to work even if px-backup is disabled and for external ls server. #320
Open
diptiranjanpx
wants to merge
1
commit into
2.1.0
Choose a base branch
from
OC-1082-2.1.0
base: 2.1.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,7 +144,7 @@ set_enabled_modules() { | |
pxmonitor_enabled=true | ||
fi | ||
|
||
ls_match=`$kubectl_cmd --namespace $namespace get deployment pxcentral-license-server` | ||
ls_match=`$kubectl_cmd --namespace $namespace get configmap $cmListLS` | ||
if [ $? -eq 0 ] ; then | ||
pxls_enabled=true | ||
fi | ||
|
@@ -153,13 +153,12 @@ set_enabled_modules() { | |
|
||
find_releases() { | ||
namespace=$1 | ||
if [ "$pxbackup_enabled" == true ]; then | ||
# Finding px-backup release name from frontend deployment as px-backup may not be installed | ||
pxbackup_release=`$kubectl_cmd --namespace $namespace get deployment $frontend_deployment -o yaml | grep "^[ ]*meta.helm.sh/release-name:" | tail -1 | awk -F ":" '{print $2}' | awk '{$1=$1}1'` | ||
if [ "$pxbackup_release" == "" ]; then | ||
echo "px-backup is enabled but could not find the px-backup release" | ||
exit 1 | ||
fi | ||
# Finding px-backup release name from frontend deployment as px-backup may not be installed | ||
# px-backup release must be installed for 1.2.x chart versions | ||
pxbackup_release=`$kubectl_cmd --namespace $namespace get deployment $frontend_deployment -o yaml | grep "^[ ]*meta.helm.sh/release-name:" | tail -1 | awk -F ":" '{print $2}' | awk '{$1=$1}1'` | ||
if [ "$pxbackup_release" == "" ]; then | ||
echo "px-backup is enabled but could not find the px-backup release" | ||
exit 1 | ||
fi | ||
if [ "$pxmonitor_enabled" == true ]; then | ||
pxmonitor_release=`$kubectl_cmd --namespace $namespace get deployment $cortex_nginx_deployment -o yaml | grep "^[ ]*meta.helm.sh/release-name:" | tail -1 | awk -F ":" '{print $2}' | awk '{$1=$1}1'` | ||
|
@@ -232,21 +231,26 @@ do_rollback() { | |
namespace=$1 | ||
version=$2 | ||
|
||
current_px_central_version="2.0.1" | ||
if [ `helm list -n px-backup | grep "px-central-2.0.0" | wc -l` -eq 1 ]; then | ||
current_px_central_version="2.1.0" | ||
if [ `helm list -n px-backup | grep "px-central-2.0.1" | wc -l` -eq 1 ]; then | ||
current_px_central_version="2.0.1" | ||
elif [ `helm list -n px-backup | grep "px-central-2.0.0" | wc -l` -eq 1 ]; then | ||
current_px_central_version="2.0.0" | ||
fi | ||
|
||
# job_imagetag | ||
if [ $current_px_central_version == "2.0.1" ]; then | ||
# TODO: Needs to modify to public tags in 2.0.1 final patch | ||
if [ $current_px_central_version == "2.1.0" ]; then | ||
# TODO: Change the following to released tag | ||
job_image="pxcentral-onprem-post-setup-base" | ||
job_imagetag="2.1.0-dev" | ||
elif [ $current_px_central_version == "2.0.1" ]; then | ||
job_image="pxcentral-onprem-post-setup" | ||
job_imagetag="2.0.1" | ||
elif [ $current_px_central_version == "2.0.0" ]; then | ||
job_image="pxcentral-onprem-post-setup" | ||
job_imagetag="2.0.0" | ||
else | ||
echo "Invalid px-central-chart version: $px_central_version , supported ones are : 2.0.1 and 2.0.0" | ||
echo "Invalid px-central-chart version: $px_central_version , supported ones are : 2.1.0, 2.0.1 and 2.0.0" | ||
fi | ||
|
||
image="$job_registry/$job_repo/$job_image:$job_imagetag" | ||
|
@@ -496,8 +500,8 @@ if [ "$helmvaluesfile" != "" ]; then | |
fi | ||
|
||
if [ "$px_central_version" != "" ]; then | ||
if [ $px_central_version != "2.0.0" ] && [ $px_central_version != "2.0.1" ]; then | ||
echo "upgrade-version can only be 2.0.1 or 2.0.0" | ||
if [ $px_central_version != "2.1.0" ] && [ $px_central_version != "2.0.1" ] && [ $px_central_version != "2.0.0" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These supported versions should be in an array or a list. |
||
echo "upgrade-version can only be 2.1.0, 2.0.1 or 2.0.0" | ||
usage | ||
exit 1 | ||
fi | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using else if can we use an array or list of the version that is supported and check for that.
In long run this will keep adding to the complexity, a better solution would be to say we support all versions ahead of 2.0.0