-
Notifications
You must be signed in to change notification settings - Fork 245
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
OLM - ci -test. Create cdi-olm-catalog to be able to deploy cdi via o… #862
Changes from all commits
34bc7e1
b9ecc4c
38bca08
350508d
ed5894c
77f9e5a
0df26bf
03497da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CDI_INISTALL=${CDI_INSTALL_OPERATOR} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
source ./cluster-sync/${KUBEVIRT_PROVIDER}/install.sh | ||
|
||
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 | ||
|
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CDI_INSTALL=${CDI_INSTALL_OPERATOR} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,5 @@ re='^-?[0-9]+$' | |
if ! [[ $num_nodes =~ $re ]] || [[ $num_nodes -lt 1 ]] ; then | ||
num_nodes=1 | ||
fi | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CDI_INSTALL=${CDI_INSTALL_OLM} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,4 @@ function configure_local_storage() { | |
set -e | ||
fi | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CDI_INSTALL=${CDI_INSTALL_OPERATOR} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ re='^-?[0-9]+$' | |
if ! [[ $num_nodes =~ $re ]] || [[ $num_nodes -lt 1 ]] ; then | ||
num_nodes=1 | ||
fi | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,21 +28,27 @@ if [ "${KUBEVIRT_PROVIDER}" != "external" ]; then | |
registry=${IMAGE_REGISTRY:-localhost:$(_port registry)} | ||
DOCKER_PREFIX=${registry} | ||
MANIFEST_REGISTRY="registry:5000" | ||
QUAY_NAMESPACE="none" | ||
fi | ||
|
||
# Need to set the DOCKER_PREFIX appropriately in the call to `make docker push`, otherwise make will just pass in the default `kubevirt` | ||
QUAY_NAMESPACE=$QUAY_NAMESPACE DOCKER_PREFIX=$MANIFEST_REGISTRY PULL_POLICY=$(getTestPullPolicy) make manifests | ||
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. Why the seperate QUAY_NAMESPACE? We could just set DOCKER_PREFIX=quay.io/xxxxx This also brings back my earlier comment that we should probably change DOCKER_PREFIX to REGISTRY_NAME or something more general. This isn't your problem and shouldn't impact your patch but capturing the point here. 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. QUAY_NAMESPACE is the namespace in quay where CDI OLM bundle is located. It is not necessarily equals to DOCKER_PREFIX 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. I think Johns point is, that we either use Quay OR Docker but not both at the same time, so having two separate variables is sort of weird, it would make sense to have a 'REGISTRY_NAME' or something like instead of DOCKER_PREFIX and QUAY_NAMESPACE if they both serve the same purpose but for a different registry provider. 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.
But we do utilize both dockerhub and quay - we push all cdi images to repo in dockerhub and OLM bundle to quay 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. Sorry, my point was as @awels mentioned why both, I get that we do push to both, but we don't push to both in the same build iteration. So the idea I was getting at was use a single variable and set it appropriately for the build we're doing. If you're doing parallel buld/push operations then it would make more sense to still use a single image registry variable but make it a list and just do build, then push to 'n' registries from the list. We should probably be doing something like that anyway if we're not already rather than run a seperate build/release process for each registry. 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. As discussed we do need both DOCKER_PREFIX and QUAY_REPOSITORY variables in the same make manifests iteration. DOCKER_PREFIX for container images pushed to docker and QUAY related variables for olm manifests and bundle |
||
DOCKER_PREFIX=$DOCKER_PREFIX make docker push | ||
DOCKER_PREFIX=$MANIFEST_REGISTRY PULL_POLICY=$(getTestPullPolicy) make manifests | ||
|
||
seed_images | ||
|
||
configure_local_storage | ||
|
||
# Install CDI | ||
_kubectl apply -f "./_out/manifests/release/cdi-operator.yaml" | ||
install_cdi | ||
|
||
#wait cdi crd is installed with timeout | ||
wait_cdi_crd_installed $CDI_INSTALL_TIMEOUT | ||
|
||
_kubectl apply -f "./_out/manifests/release/cdi-cr.yaml" | ||
_kubectl wait cdis.cdi.kubevirt.io/cdi --for=condition=running --timeout=120s | ||
|
||
|
||
# Start functional test HTTP server. | ||
# We skip the functional test additions for external provider for now, as they're specific | ||
if [ "${KUBEVIRT_PROVIDER}" != "external" ]; then | ||
|
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.
I don't think you need the install.sh files for the providers, you can put
CDI_INSTALL=${CDI_INSTALL_OPERATOR}
In the provider.sh right before you source cluster-sync/ephemeral_provider.sh