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

[minor] Allow Mongodb update to use already configured storageclass #674

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions image/cli/mascli/functions/update
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ function update_interactive() {
fi

MONGODB_CURRENT_VERSION=$(oc get mongodbcommunity.mongodbcommunity.mongodb.com -A -o jsonpath='{.items[0].status.version}' 2> /dev/null)
MONGODB_STORAGE_CLASS=`oc get mongodbcommunity.mongodbcommunity.mongodb.com -A -o jsonpath='{.items[0].spec.statefulSet.spec.volumeClaimTemplates[0].spec.storageClassName}' 2> /dev/null`


# Detect Kafka in cluster and set namespace
Expand Down Expand Up @@ -231,6 +232,7 @@ function update() {
export MAS_CATALOG_VERSION
export DB2_NAMESPACE
export MONGODB_NAMESPACE
export MONGODB_STORAGE_CLASS
export MONGODB_V5_UPGRADE
export KAFKA_NAMESPACE
export KAFKA_PROVIDER
Expand Down Expand Up @@ -261,7 +263,7 @@ function update() {
echo_reset_dim "IBM Db2 Universal Operator ................. ${COLOR_RED}No${TEXT_RESET}"
fi

# IBM Db2
# MongoDB CE
if [ "$MONGODB_NAMESPACE" != "" ]; then
echo_reset_dim "MongoDb Community Edition .................. ${COLOR_GREEN}Yes ($MONGODB_NAMESPACE)${TEXT_RESET}"
else
Expand Down Expand Up @@ -305,4 +307,4 @@ function update() {
echo -e "\nView progress:\n ${COLOR_CYAN}${TEXT_UNDERLINE}https://${OCP_CONSOLE_ROUTE}/pipelines/ns/mas-pipelines${TEXT_RESET}${TEXT_RESET}"
echo

}
}
2 changes: 2 additions & 0 deletions image/cli/mascli/templates/pipelinerun-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ spec:
value: '$DB2_NAMESPACE'
- name: mongodb_namespace
value: '$MONGODB_NAMESPACE'
- name: mongodb_storage_class
value: '$MONGODB_STORAGE_CLASS'
- name: mongodb_v5_upgrade
value: '$MONGODB_V5_UPGRADE'
- name: kafka_namespace
Expand Down
6 changes: 6 additions & 0 deletions tekton/src/pipelines/update.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ spec:
type: string
description: Approves the MongoDb upgrade to version 5 if needed
default: ""
- name: mongodb_storage_class
type: string
default: ""
description: MongoDB Storage class for data and logs

# kafka update
- name: kafka_action
Expand Down Expand Up @@ -218,6 +222,8 @@ spec:
value: $(params.mongodb_namespace)
- name: mongodb_v5_upgrade
value: $(params.mongodb_v5_upgrade)
- name: mongodb_storage_class
value: $(params.mongodb_storage_class)

- name: update-kafka
taskRef:
Expand Down