-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch databases to use implicit version 15.3
- Loading branch information
Showing
1 changed file
with
11 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash -x | ||
|
||
# This script performs a common maintenance operation of updating | ||
# status fields to version "15.3" from "15". | ||
|
||
kubectl get databaseclaim -A -o json | jq -r '.items[] | select((.spec.dbVersion == null or .spec.dbVersion == "") and (.status.activeDB.dbversion != "15.3")) | [.metadata.namespace, .metadata.name] | @tsv' | while IFS=$'\t' read -r namespace name; do | ||
kubectl get databaseclaim -n "$namespace" "$name" -ojsonpath='{.metadata.namespace}/{.metadata.name}:{.status.activeDB.dbversion}{"\n"}' | ||
kubectl patch --dry-run=server databaseclaim "$name" -n "$namespace" --type=merge --subresource=status -p '{"status":{"activeDB":{"dbversion":"15"}}}' | ||
|
||
kubectl patch --dry-run=server databaseclaim "$name" -n "$namspace" --type=merge -p '{"metadata":{"annotations":{"reconcile-now":"true"}}}' | ||
done |