suppor k8s node etcd

This commit is contained in:
magicsong
2019-09-02 16:54:34 +08:00
parent f22e8ea90e
commit 82f5309a1c
18 changed files with 232 additions and 14 deletions

View File

@@ -8,6 +8,8 @@ IMG=magicsong/ks-network:$tag
DEST=/tmp/manager.yaml
TEST_NS=network-test-$tag
SKIP_BUILD=no
STORE_MODE=etcd
MODE=test
export TEST_NAMESPACE=$TEST_NS
export YAML_PATH=$DEST
@@ -33,6 +35,16 @@ case $key in
shift # past argument
shift # past value
;;
-S|--store-mode)
STORE_MODE="$2"
shift # past argument
shift # past value
;;
-m|--mode)
MODE="$2"
shift # past argument
shift # past value
;;
--default)
DEFAULT=YES
shift # past argument
@@ -51,7 +63,7 @@ if [ $SKIP_BUILD == "no" ]; then
docker push $IMG
fi
kustomize_dir="./kustomize/network"
kustomize_dir="./kustomize/network/calico-${STORE_MODE}"
if [ "$(uname)" == "Darwin" ]; then
sed -i '' -e 's/namespace: .*/namespace: '"${TEST_NS}"'/' $kustomize_dir/kustomization.yaml
sed -i '' -e 's/namespace: .*/namespace: '"${TEST_NS}"'/' $kustomize_dir/patch_role_binding.yaml
@@ -62,6 +74,11 @@ else
sed -i -e 's@image: .*@image: '"${IMG}"'@' $kustomize_dir/patch_image_name.yaml
fi
kustomize build $kustomize_dir -o $DEST
ginkgo -v ./test/e2e/...
kustomize build $kustomize_dir -o $DEST
if [ $MODE == "test" ]; then
ginkgo -v ./test/e2e/...
elif [ $MODE == "debug" ]; then
kubectl create ns $TEST_NS --dry-run -o yaml | kubectl apply -f -
kubectl apply -f $DEST
fi