-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(crd): upgrade script for refactoring the CRD
steps to upgrade :- 1. run pre-upgrade.sh 2. upgrade the driver t0 v0.6 3. run post-upgrade.sh Signed-off-by: Pawan <pawan@mayadata.io>
- Loading branch information
1 parent
27517c6
commit 710cf3b
Showing
2 changed files
with
60 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,28 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
kubectl get zfsvolumes.openebs.io -n openebs -oyaml > volumes.yaml | ||
|
||
# remove the finalizer from the old CR | ||
sed -i "/zfs.openebs.io\/finalizer/d" volumes.yaml | ||
kubectl apply -f volumes.yaml | ||
|
||
# delete the old CR | ||
kubectl delete -f volumes.yaml | ||
|
||
# delete the CRD definition | ||
kubectl delete crd zfsvolumes.openebs.io | ||
|
||
|
||
kubectl get zfssnapshots.openebs.io -n openebs -oyaml > snapshots.yaml | ||
|
||
# remove the finalizer from the old CR | ||
sed -i "/zfs.openebs.io\/finalizer/d" snapshots.yaml | ||
kubectl apply -f snapshots.yaml | ||
|
||
# delete the old CR | ||
kubectl delete -f snapshots.yaml | ||
|
||
# delete the CRD definition | ||
kubectl delete crd zfssnapshots.openebs.io |
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,32 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# ZFSVolumes: create the new CR with apiVersion as zfs.openebs.io and kind as Volume | ||
|
||
kubectl get zfsvolumes.openebs.io -n openebs -oyaml > volumes.yaml | ||
|
||
|
||
# update the group name to zfs.openebs.io | ||
sed -i "s/apiVersion: openebs.io/apiVersion: zfs.openebs.io/g" volumes.yaml | ||
# update the kind to Volume | ||
sed -i "s/kind: ZFSVolume/kind: Volume/g" volumes.yaml | ||
# create the new CR | ||
kubectl apply -f volumes.yaml | ||
|
||
rm volumes.yaml | ||
|
||
|
||
# ZFSSnapshots: create the new CR with apiVersion as zfs.openebs.io and kind as Snapshot | ||
|
||
kubectl get zfssnapshots.openebs.io -n openebs -oyaml > snapshots.yaml | ||
|
||
|
||
# update the group name to zfs.openebs.io | ||
sed -i "s/apiVersion: openebs.io/apiVersion: zfs.openebs.io/g" snapshots.yaml | ||
# update the kind to Snapshot | ||
sed -i "s/kind: ZFSSnapshot/kind: Snapshot/g" snapshots.yaml | ||
# create the new CR | ||
kubectl apply -f snapshots.yaml | ||
|
||
rm snapshots.yaml |