-
Notifications
You must be signed in to change notification settings - Fork 31
K8SPS-335: Add gr-upgrade and async-upgrade tests #918
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
Open
egegunes
wants to merge
10
commits into
main
Choose a base branch
from
K8SPS-335
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+734
−26
Open
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b2ddb7f
K8SPS-335: Add gr-upgrade and async-upgrade tests
egegunes f4f9a84
fix cluster-wide
egegunes 084a106
run shfmt
egegunes 76e650a
ensure no rollout
egegunes c367e5b
fix operator upgrade on cluster-wide
egegunes 03f3a40
run only upgrade tests
egegunes 5c73861
fixes
egegunes 8a263b9
Revert "run only upgrade tests"
egegunes bd3031b
Merge branch 'main' into K8SPS-335
egegunes e88c2ff
Merge branch 'main' into K8SPS-335
gkech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,26 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
timeout: 120 | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: perconaservermysqls.ps.percona.com | ||
spec: | ||
group: ps.percona.com | ||
names: | ||
kind: PerconaServerMySQL | ||
listKind: PerconaServerMySQLList | ||
plural: perconaservermysqls | ||
shortNames: | ||
- ps | ||
singular: perconaservermysql | ||
scope: Namespaced | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
metadata: | ||
name: check-operator-deploy-status | ||
timeout: 120 | ||
commands: | ||
- script: kubectl assert exist-enhanced deployment percona-server-mysql-operator -n ${OPERATOR_NS:-$NAMESPACE} --field-selector status.readyReplicas=1 |
This file contains hidden or 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,15 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: |- | ||
set -o errexit | ||
set -o xtrace | ||
|
||
source ../../functions | ||
init_temp_dir # do this only in the first TestStep | ||
|
||
git_tag="v$(latest_operator_version_in_vs)" | ||
deploy_operator_gh ${git_tag} | ||
deploy_non_tls_cluster_secrets | ||
deploy_tls_cluster_secrets | ||
deploy_client |
This file contains hidden or 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,58 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
timeout: 420 | ||
--- | ||
kind: StatefulSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: async-upgrade-mysql | ||
status: | ||
observedGeneration: 1 | ||
replicas: 3 | ||
readyReplicas: 3 | ||
currentReplicas: 3 | ||
updatedReplicas: 3 | ||
collisionCount: 0 | ||
--- | ||
kind: StatefulSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: async-upgrade-haproxy | ||
status: | ||
observedGeneration: 1 | ||
replicas: 3 | ||
readyReplicas: 3 | ||
updatedReplicas: 3 | ||
--- | ||
kind: StatefulSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: async-upgrade-orc | ||
status: | ||
observedGeneration: 1 | ||
replicas: 3 | ||
readyReplicas: 3 | ||
currentReplicas: 3 | ||
updatedReplicas: 3 | ||
collisionCount: 0 | ||
--- | ||
apiVersion: ps.percona.com/v1alpha1 | ||
kind: PerconaServerMySQL | ||
metadata: | ||
name: async-upgrade | ||
finalizers: | ||
- percona.com/delete-mysql-pods-in-order | ||
status: | ||
mysql: | ||
ready: 3 | ||
size: 3 | ||
state: ready | ||
haproxy: | ||
ready: 3 | ||
size: 3 | ||
state: ready | ||
orchestrator: | ||
ready: 3 | ||
size: 3 | ||
state: ready | ||
state: ready |
This file contains hidden or 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,22 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: |- | ||
set -o errexit | ||
set -o xtrace | ||
|
||
source ../../functions | ||
|
||
version=$(latest_operator_version_in_vs) | ||
init_image=$(get_operator_image) | ||
|
||
if [[ -z ${init_image} ]]; then | ||
echo "failed to get operator image" | ||
exit 1 | ||
fi | ||
|
||
get_cr_with_latest_versions_in_vs \ | ||
| yq eval "$(printf '.spec.initImage="%s"' "${init_image}")" - \ | ||
| yq eval "$(printf '.spec.crVersion="%s"' "${version}")" - \ | ||
| yq eval '.spec.mysql.clusterType="async"' - \ | ||
| kubectl -n "${NAMESPACE}" apply -f - |
This file contains hidden or 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,14 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- timeout: 120 | ||
script: |- | ||
set -o errexit | ||
set -o xtrace | ||
|
||
source ../../functions | ||
|
||
apply_crd | ||
apply_rbac | ||
upgrade_operator_image ${IMAGE} | ||
wait_deployment percona-server-mysql-operator ${OPERATOR_NS:-$NAMESPACE} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[shfmt] reported by reviewdog 🐶