-
Notifications
You must be signed in to change notification settings - Fork 66
Test branch #1385
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
Draft
eleo007
wants to merge
1
commit into
main
Choose a base branch
from
ella_test_branch
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.
Draft
Test branch #1385
+2
−2
Conversation
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
Added a comment to clarify the purpose of the script.
Contributor
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 🐶
percona-postgresql-operator/e2e-tests/functions
Lines 1215 to 1258 in d25fe5c
| local check_type=$1 # add | delete | |
| local component=$2 # instance | pgbouncer | repohost | |
| local vars=("${@:3}") # everything after the 2nd argument | |
| case "$component" in | |
| instance) | |
| POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/instance-set=instance1 -o 'jsonpath={.items[0].metadata.name}') | |
| CONTAINER="" | |
| ;; | |
| pgbouncer) | |
| POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/role=pgbouncer -o 'jsonpath={.items[0].metadata.name}') | |
| CONTAINER="pgbouncer" | |
| ;; | |
| repohost) | |
| POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/data=pgbackrest -o 'jsonpath={.items[0].metadata.name}') | |
| CONTAINER="pgbackrest" | |
| ;; | |
| *) | |
| echo "ERROR: unknown component '$component'" | |
| return 1 | |
| ;; | |
| esac | |
| echo "Fetching environment variables for $component pod $POD..." | |
| local env_content | |
| env_content=$(get_envs_from_pod "${NAMESPACE}" "$POD" "$CONTAINER") | |
| local errors=0 | |
| for var_entry in "${vars[@]}"; do | |
| if [[ "$check_type" == "add" ]]; then | |
| local var_name="${var_entry%%=*}" | |
| local var_expected="${var_entry#*=}" | |
| check_env_in_pod add "$POD" "$var_name" "$var_expected" "$env_content" || errors=$((errors+1)) | |
| else | |
| check_env_in_pod delete "$POD" "$var_entry" "" "$env_content" || errors=$((errors+1)) | |
| fi | |
| done | |
| if (( errors > 0 )); then | |
| echo "$errors environment check(s) failed for component '$component'" | |
| return 1 | |
| else | |
| echo "All environment checks passed for component '$component'" | |
| fi |
Collaborator
commit: d25fe5c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added a comment to clarify the purpose of the script.
CHANGE DESCRIPTION
Problem:
Short explanation of the problem.
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability