Skip to content
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

Merged
merged 7 commits into from
Mar 9, 2018
Merged

Prepare test cluster #38

merged 7 commits into from
Mar 9, 2018

Conversation

ewoutp
Copy link
Contributor

@ewoutp ewoutp commented Mar 8, 2018

This PR uses a ConfigMap in the kube-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.

Copy link
Contributor

@ObiWahn ObiWahn left a 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

if [ "${REQUIRE_LOCAL_STORAGE}" = "1" ]; then
echo "Preparing local storage"
kubectl apply -n $NS -f examples/arango-local-storage.yaml
else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exit $?

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qefs

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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor Author

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.

# Wait until custom resources are available

response=$(kubectl get crd arangodeployments.database.arangodb.com --template="non-empty" --ignore-not-found)
while [ -z $response ]; do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iswhile !command; do possible?


set -e

NS=$1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qefs

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)
Copy link
Contributor

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
Copy link
Contributor

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


# Create the local storage in the cluster if the cluster needs it.

set -e
Copy link
Contributor

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

Copy link
Contributor

@ObiWahn ObiWahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ewoutp ewoutp merged commit bb71fd6 into master Mar 9, 2018
@ewoutp ewoutp deleted the prepare-cluster-for-test branch March 9, 2018 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants