-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor code of variuos CDI installations:
* cluster-sync/install.sh - contains all supported installation techniques and a install_cdi method that derives the technique based on CDI_INSTALL variable - operator manifests - OLM manifests * per provider there is cluster-sync/${PROVIDER}/install.sh that has the settting for CDI_INSTALL for specific provider * default technique is CDI installation via operator
- Loading branch information
1 parent
2c29c95
commit 8009b34
Showing
11 changed files
with
67 additions
and
57 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
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 @@ | ||
CDI_INISTALL=${CDI_INSTALL_OPERATOR} |
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
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,51 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
source ./cluster-sync/${KUBEVIRT_PROVIDER}/install.sh | ||
|
||
function _kubectl(){ | ||
kubectl "$@" | ||
} | ||
|
||
function install_cdi_olm { | ||
#Install CDI via OLM | ||
_kubectl create ns $NAMESPACE | ||
_kubectl apply -f _out/manifests/release/olm/operatorgroup.yaml | ||
_kubectl apply -f _out/manifests/release/olm/k8s/cdi-catalogsource-registry.yaml | ||
_kubectl apply -f _out/manifests/release/olm/k8s/cdi-subscription.yaml | ||
} | ||
|
||
function install_cdi_operator { | ||
_kubectl apply -f "./_out/manifests/release/cdi-operator.yaml" | ||
} | ||
|
||
|
||
function install_cdi { | ||
case "${CDI_INSTALL}" in | ||
"${CDI_INSTALL_OPERATOR}") | ||
install_cdi_operator | ||
;; | ||
"${CDI_INSTALL_OLM}") | ||
install_cdi_olm | ||
;; | ||
esac | ||
} | ||
|
||
|
||
function wait_cdi_crd_installed { | ||
timeout=$1 | ||
crd_defined=0 | ||
while [ $crd_defined -eq 0 ] && [ $timeout > 0 ]; do | ||
crd_defined=$(_kubectl get customresourcedefinition| grep cdis.cdi.kubevirt.io | wc -l) | ||
sleep 1 | ||
timeout=timeout-1 | ||
done | ||
|
||
#In case CDI crd is not defined after 120s - throw error | ||
if [ $timeout \< 1 ]; then | ||
echo "ERROR - CDI CRD is not defined after timeout" | ||
exit 1 | ||
fi | ||
|
||
} | ||
|
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 @@ | ||
CDI_INSTALL=${CDI_INSTALL_OPERATOR} |
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 @@ | ||
CDI_INSTALL=${CDI_INSTALL_OLM} |
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
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 @@ | ||
CDI_INSTALL=${CDI_INSTALL_OPERATOR} |
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
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
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