Skip to content

Commit

Permalink
Verify the hostpath provisioner CRD is a strucural schema. (#50)
Browse files Browse the repository at this point in the history
Update the latest kubevirtci.

Signed-off-by: Alexander Wels <awels@redhat.com>
  • Loading branch information
awels committed Jul 15, 2020
1 parent dd1e669 commit 4d0b913
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 661 deletions.
14 changes: 14 additions & 0 deletions cluster-sync/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,17 @@ hpp_obj=$(_kubectl get Hostpathprovisioner -o yaml)
echo $hpp_obj
exit 1
fi

function check_structural_schema {
for crd in "$@"; do
status=$(_kubectl get crd $crd -o jsonpath={.status.conditions[?\(@.type==\"NonStructuralSchema\"\)].status})
if [ "$status" == "True" ]; then
echo "ERROR CRD $crd is not a structural schema!, please fix"
_kubectl get crd $crd -o yaml
exit 1
fi
echo "CRD $crd is a StructuralSchema"
done
}

check_structural_schema "hostpathprovisioners.hostpathprovisioner.kubevirt.io"
16 changes: 3 additions & 13 deletions cluster-up/cluster/images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,16 @@
set -e

declare -A IMAGES
IMAGES[gocli]="gocli@sha256:220f55f6b1bcb3975d535948d335bd0e6b6297149a3eba1a4c14cad9ac80f80d"
IMAGES[gocli]="gocli@sha256:2ce75db868bbf2811395dfe4f73a68160d2ad700b1e08aeee6956b4943ceb237"
if [ -z $KUBEVIRTCI_PROVISION_CHECK ]; then
IMAGES[k8s-fedora-1.17.0]="k8s-fedora-1.17.0@sha256:aebf67b8b1b499c721f4d98a7ab9542c680553a14cbc144d1fa701fe611f3c0d"
IMAGES[k8s-1.18]="k8s-1.18@sha256:906af927cd0a998166d12c61162db2a0eb395c9e65d537ce7d1af2d603cb8690"
IMAGES[k8s-1.17]="k8s-1.17@sha256:c60f8450457d0678c40247abaad6a687cc6cfe1c1ac307291ae4008f1c490240"
IMAGES[k8s-1.18]="k8s-1.18@sha256:fcf196a188cdb600d35e594b26b39804106e4ad263deea012a8a9a863232c4e4"
IMAGES[k8s-1.17]="k8s-1.17@sha256:789c57e011101c1ba3840809898c17a7e108a20c95a12f6a713ea1d98fa0a19c"
IMAGES[k8s-1.16]="k8s-1.16@sha256:1e153fb62c9a30ce6bc6ddc1af21bb28a56b780ec93ab15e113d729bf664469a"
IMAGES[k8s-1.15]="k8s-1.15@sha256:c58cb9d79968590f24e070bc2517088d44fa2f83ba73e989a7e0f690ad08460b"
IMAGES[k8s-1.14]="k8s-1.14@sha256:46e449b292dcb420f0944cac0a7a5c667c6f19bba2a4192737380e8e77f27ed0"
IMAGES[okd-4.1]="okd-4.1@sha256:e7e3a03bb144eb8c0be4dcd700592934856fb623d51a2b53871d69267ca51c86"
IMAGES[okd-4.2]="okd-4.2@sha256:a830064ca7bf5c5c2f15df180f816534e669a9a038fef4919116d61eb33e84c5"
IMAGES[okd-4.3]="okd-4.3@sha256:63abc3884002a615712dfac5f42785be864ea62006892bf8a086ccdbca8b3d38"
IMAGES[ocp-4.3]="ocp-4.3@sha256:d293f0bca338136ed136b08851de780d710c9e40e2a1d18e5a5595491dbdd1ea"
IMAGES[ocp-4.4]="ocp-4.4@sha256:42497f3a848c2847e3caeff6fbb7f4bb28ee48b692c0541ec7099392067a0387"
fi
export IMAGES

IMAGE_SUFFIX=""
if [[ $KUBEVIRT_PROVIDER =~ (ocp|okd).* ]]; then
IMAGE_SUFFIX="-provision"
fi

image="${IMAGES[$KUBEVIRT_PROVIDER]:-${KUBEVIRT_PROVIDER}${IMAGE_SUFFIX}:latest}"
export image
14 changes: 8 additions & 6 deletions cluster-up/cluster/kind-k8s-sriov-1.17.0/config_sriov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ function deploy_sriov_operator {

echo 'Generating webhook certificates for the SR-IOV operator webhooks'
pushd "${CSRCREATORPATH}"
go run . -namespace sriov-network-operator -secret operator-webhook-service -hook operator-webhook -kubeconfig $KUBECONFIG_PATH
go run . -namespace sriov-network-operator -secret network-resources-injector-secret -hook network-resources-injector -kubeconfig $KUBECONFIG_PATH
go run . -namespace sriov-network-operator -secret operator-webhook-service -hook operator-webhook -kubeconfig $KUBECONFIG_PATH || return 1
go run . -namespace sriov-network-operator -secret network-resources-injector-secret -hook network-resources-injector -kubeconfig $KUBECONFIG_PATH || return 1
popd

echo 'Setting caBundle for SR-IOV webhooks'
Expand All @@ -225,8 +225,9 @@ function deploy_sriov_operator {
# 'operator-webhook' and 'network-resources-injector' webhooks certificates are
# configured, in order to check if caBundle reconcile is finished it is necessary
# to wait for the "NoSchedule" taint to present and then absent.
wait_for_taint "NoSchedule" || true
wait_for_taint_absence "NoSchedule" || return 1
taint="NoSchedule"
wait_for_taint "$taint" || echo "Taint $taint did not present on nodes after setting caBundle for sriov webhooks"
wait_for_taint_absence "$taint" || return 1

return 0
}
Expand Down Expand Up @@ -259,8 +260,9 @@ function apply_sriov_node_policy {
# Since SriovNodeNetworkPolicy doesnt have Status to indicate if its
# configured successfully, it is necessary to wait for the "NoSchedule"
# taint to present and then absent.
wait_for_taint "NoSchedule" || true
wait_for_taint_absence "NoSchedule" || return 1
taint="NoSchedule"
wait_for_taint "$taint" || echo "Taint $taint did not present on nodes after creating SriovNodeNetworkPolicy"
wait_for_taint_absence "$taint" || return 1

return 0
}
Expand Down
52 changes: 0 additions & 52 deletions cluster-up/cluster/ocp-4.3/README.md

This file was deleted.

73 changes: 0 additions & 73 deletions cluster-up/cluster/ocp-4.3/provider.sh

This file was deleted.

61 changes: 0 additions & 61 deletions cluster-up/cluster/ocp-4.4/README.md

This file was deleted.

73 changes: 0 additions & 73 deletions cluster-up/cluster/ocp-4.4/provider.sh

This file was deleted.

44 changes: 0 additions & 44 deletions cluster-up/cluster/okd-4.1/README.md

This file was deleted.

Loading

0 comments on commit 4d0b913

Please sign in to comment.