-
Notifications
You must be signed in to change notification settings - Fork 47
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
✨ Add upgrade E2E #1003
base: main
Are you sure you want to change the base?
✨ Add upgrade E2E #1003
Changes from all commits
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,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 | ||
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. +1 on checking that the existing ClusterCatalog and ClusterExtension remain Unpacked and Installed. But two questions:
Also, potentially out-of-scope in this PR, but in the catalogd-specific upgrade tests, I think we'll want a scenario where the catalog image referenced by a ClusterCatalog receives an update after the upgrade, which would ensure that our polling logic doesn't break. That scenario may be relevant in operator-controller because we expect catalog updates to trigger reconciles (and potentially upgrade) ClusterExtension objects. 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.
You are right, the new deployment might be ready (first check), but it is likely that we perform Any ideas how in happy scenario we can check that say If
Are you suggesting to use "a" to trigger reconciliation? A workaround to my above question? Why do you think we need "b"?
This sounds like a regular E2E scenario for catalogd. Not sure that I understand the need for this as part of upgrade test. Could you please expand on this (ideally on the relevant catalogd issue). 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.
Note to self: 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 updated the scripts to initially install version 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 do think it would be better if we could
To do (1), we can check |
||
|
||
|
||
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 |
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 |
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.
Can we also run the standard e2e after an upgrade as well?
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.
We were considering this, but decided not to because: