-
Notifications
You must be signed in to change notification settings - Fork 73
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
Prepare test cluster #38
Conversation
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.
looks fine except for quotes and ´set -e´ usage and other minor issues
scripts/kube_create_storage.sh
Outdated
if [ "${REQUIRE_LOCAL_STORAGE}" = "1" ]; then | ||
echo "Preparing local storage" | ||
kubectl apply -n $NS -f examples/arango-local-storage.yaml | ||
else |
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.
exit $?
scripts/kube_create_operator.sh
Outdated
response=$(kubectl get crd arangodeployments.database.arangodb.com --template="non-empty" --ignore-not-found) | ||
while [ -z $response ]; do | ||
sleep 1 | ||
response=$(kubectl get crd arangodeployments.database.arangodb.com --template="non-empty" --ignore-not-found) |
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.
qefs
scripts/kube_create_operator.sh
Outdated
response=$(kubectl get crd arangodeployments.database.arangodb.com --template="non-empty" --ignore-not-found) | ||
echo -n . | ||
done | ||
response=$(kubectl get crd arangolocalstorages.storage.arangodb.com --template="non-empty" --ignore-not-found) |
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.
qefs
|
||
set -e | ||
|
||
cluster=$(kubectl config current-context) |
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.
08:30:38 obiwahn │ !qefs
08:30:39 greybot │ "$Quote" "$Every" "$Fucking" "$Substitution"
esac | ||
|
||
mapname="arango-operator-test" | ||
configfile=$(mktemp) |
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.
TRAP cleanup_function EXIT
to clean up tempfile
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.
Or use read to store it in a variable.
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.
It has to be a file (for --from-env-file
to work)
Since it is temp, I'm not that worried about it being left behind a few times. In the normal case it is now removed.
scripts/kube_create_operator.sh
Outdated
# Wait until custom resources are available | ||
|
||
response=$(kubectl get crd arangodeployments.database.arangodb.com --template="non-empty" --ignore-not-found) | ||
while [ -z $response ]; do |
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.
Iswhile !command; do
possible?
scripts/kube_create_storage.sh
Outdated
|
||
set -e | ||
|
||
NS=$1 |
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.
qefs
scripts/kube_create_operator.sh
Outdated
response=$(kubectl get crd arangolocalstorages.storage.arangodb.com --template="non-empty" --ignore-not-found) | ||
while [ -z $response ]; do | ||
sleep 1 | ||
response=$(kubectl get crd arangolocalstorages.storage.arangodb.com --template="non-empty" --ignore-not-found) |
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.
Same command string twice?
|
||
# Sets the configuration of the cluster in a ConfigMap in kube-system. | ||
|
||
set -e |
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.
Do not use set -e
scripts/kube_create_storage.sh
Outdated
|
||
# Create the local storage in the cluster if the cluster needs it. | ||
|
||
set -e |
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.
Do not use set -e
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.
LGTM
This PR uses a
ConfigMap
in thekube-system
namespace to store the test configuration of that cluster.In the tests itself, this
ConfigMap
is fetched and when needed, local storage is created.