-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing upgrade from the latest release to the current commit Signed-off-by: Mikalai Radchuk <[email protected]>
- Loading branch information
Mikalai Radchuk
committed
Jul 5, 2024
1 parent
8bf5cf4
commit 51e0c3a
Showing
4 changed files
with
116 additions
and
2 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
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,36 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
help="post-upgrade-checks.sh is used to perform tests after upgrade from the previous release. | ||
Usage: | ||
post-upgrade-checks.sh [TEST_CLUSTER_CATALOG_NAME] [TEST_CLUSTER_EXTENSION_NAME] | ||
" | ||
|
||
if [[ "$#" -ne 2 ]]; then | ||
echo "Illegal number of arguments passed" | ||
echo "${help}" | ||
exit 1 | ||
fi | ||
|
||
function getObservedGeneration() { | ||
kubectl get ClusterExtension $TEST_CLUSTER_EXTENSION_NAME -o=jsonpath='{.status.conditions[?(@.type=="Installed")].observedGeneration}' | ||
} | ||
|
||
TEST_CLUSTER_CATALOG_NAME=$1 | ||
TEST_CLUSTER_EXTENSION_NAME=$2 | ||
|
||
kubectl wait --for=condition=Unpacked --timeout=60s ClusterCatalog $TEST_CLUSTER_CATALOG_NAME | ||
kubectl wait --for=condition=Installed --timeout=60s ClusterExtension $TEST_CLUSTER_EXTENSION_NAME | ||
|
||
|
||
oldObservedGeneration=$(getObservedGeneration) | ||
kubectl patch ClusterExtension $TEST_CLUSTER_EXTENSION_NAME --type='merge' -p '{"spec": {"version": "1.0.1"}}' | ||
kubectl wait --for=condition=Installed --timeout=60s ClusterExtension $TEST_CLUSTER_EXTENSION_NAME | ||
newObservedGeneration=$(getObservedGeneration) | ||
|
||
if [[ "$oldObservedGeneration" == "$newObservedGeneration" ]]; then | ||
echo "Expected ClusterExtension ($TEST_CLUSTER_EXTENSION_NAME) to have new value in observedGeneration of the Installed condition, but it remained unchanged - $newObservedGeneration" | ||
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,49 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
help="pre-upgrade-setup.sh is used to create some basic resources | ||
which will later be used in upgrade testing. | ||
Usage: | ||
post-upgrade-checks.sh [TEST_CATALOG_IMG] [TEST_CATALOG_NAME] [TEST_CLUSTER_EXTENSION_NAME] | ||
" | ||
|
||
if [[ "$#" -ne 3 ]]; then | ||
echo "Illegal number of arguments passed" | ||
echo "${help}" | ||
exit 1 | ||
fi | ||
|
||
TEST_CATALOG_IMG=$1 | ||
TEST_CLUSTER_CATALOG_NAME=$2 | ||
TEST_CLUSTER_EXTENSION_NAME=$3 | ||
|
||
kubectl apply -f - << EOF | ||
apiVersion: catalogd.operatorframework.io/v1alpha1 | ||
kind: ClusterCatalog | ||
metadata: | ||
name: ${TEST_CLUSTER_CATALOG_NAME} | ||
spec: | ||
source: | ||
type: image | ||
image: | ||
ref: ${TEST_CATALOG_IMG} | ||
pollInterval: 24h | ||
insecureSkipTLSVerify: true | ||
EOF | ||
|
||
|
||
kubectl apply -f - << EOF | ||
apiVersion: olm.operatorframework.io/v1alpha1 | ||
kind: ClusterExtension | ||
metadata: | ||
name: ${TEST_CLUSTER_EXTENSION_NAME} | ||
spec: | ||
installNamespace: default | ||
packageName: prometheus | ||
version: 1.0.0 | ||
EOF | ||
|
||
kubectl wait --for=condition=Unpacked --timeout=60s ClusterCatalog $TEST_CLUSTER_CATALOG_NAME | ||
kubectl wait --for=condition=Installed --timeout=60s ClusterExtension $TEST_CLUSTER_EXTENSION_NAME |