-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test framework improvement, doing proper clean up in BeforeSuite(), A…
…fterEach(), AfterSuite() (#225) * Add proper expectTobeClean: BeforeEach(func() { framework.ExpectToBeClean(ctx) }) AfterEach(func() { framework.ExpectToBeClean(ctx) }) * Add more `FOCUS` environment variable description, do `ExpectToBeClean` in AfterEach * remove CleanServiceNetworkVpcAssociationForCurrentK8sClusterVpc * Change back DiscoveryLabel to a non-random name * Change developer.md --------- Co-authored-by: Zijun Wang <[email protected]>
- Loading branch information
1 parent
5d91e01
commit 0a27c5b
Showing
11 changed files
with
165 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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 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 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,46 @@ | ||
#!/bin/sh | ||
|
||
# When Running the k8s Controller by GoLand IDE locally, it is required to set the environment variables, this script will generate a file called `envFile` | ||
# that contains all needed environment variables, this `envFile` file can be use by GoLand "EnvFile" plugin | ||
# When config the "green arrow"(how we `run` or `debug` this project) in GoLand, we could set a "before launch" task to run this script `load_env_variables.sh`, and set the "EnvFile" plugin to load the `envFile` file | ||
# "EnvFile" is a plugin, you can install it from GoLand plugin marketplace | ||
|
||
echo "Setting environment variables" | ||
|
||
> envFile | ||
|
||
# Set KUBEBUILDER_ASSETS if not set | ||
if [ -z "$KUBEBUILDER_ASSETS" ]; then | ||
KUBEBUILDER_ASSETS=${HOME}/.kubebuilder/bin | ||
fi | ||
echo "KUBEBUILDER_ASSETS=$KUBEBUILDER_ASSETS" >> envFile | ||
|
||
|
||
# Set CLUSTER_NAME if not set | ||
if [ -z "$CLUSTER_NAME" ]; then | ||
CLUSTER_NAME=$(kubectl config view --minify -o jsonpath='{.clusters[].name}' | rev | cut -d"/" -f1 | rev | cut -d"." -f1) | ||
fi | ||
echo "CLUSTER_NAME=$CLUSTER_NAME" >> envFile | ||
|
||
|
||
# Set CLUSTER_VPC_ID if not set | ||
if [ -z "$CLUSTER_VPC_ID" ]; then | ||
CLUSTER_VPC_ID=$(aws eks describe-cluster --name ${CLUSTER_NAME} | jq -r ".cluster.resourcesVpcConfig.vpcId") | ||
fi | ||
echo "CLUSTER_VPC_ID=$CLUSTER_VPC_ID" >> envFile | ||
|
||
# Set AWS_ACCOUNT_ID if not set | ||
if [ -z "$AWS_ACCOUNT_ID" ]; then | ||
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) | ||
fi | ||
echo "AWS_ACCOUNT_ID=$AWS_ACCOUNT_ID" >> envFile | ||
|
||
if [ -z "$REGION" ]; then | ||
REGION=us-west-2 | ||
fi | ||
echo "REGION=$REGION" >> envFile | ||
|
||
|
||
GATEWAY_API_CONTROLLER_LOGLEVEL=debug | ||
echo "GATEWAY_API_CONTROLLER_LOGLEVEL=$GATEWAY_API_CONTROLLER_LOGLEVEL" >> envFile | ||
|
This file contains 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 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 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 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 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 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 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
Oops, something went wrong.