Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/test_edge_case.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "units-test-edge"
on:
# works for mannual, in case of github agent updated.
# we can run mannually to see if it can be fixed by update version of
# - kubectl
# - k8s cluster provider's
workflow_dispatch:
pull_request:
push:
branches:
- main
- 'releases/*'

jobs:
# folder exists should not blocking process
test_local_cluster_withEdgeCase_folder_exists:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: start from local
run: |
mkdir -p /tmp/kubeconfig
export CLUSTER_PROVIDER=kind
export CLUSTER_CONFIG=false
./main.sh up
- name: test as kepler action behavior
run: |
mkdir -p /tmp/kubeconfig
cp .kube/config /tmp/kubeconfig
export PROMETHEUS_ENABLE=true
export TEKTON_ENABLE=true
export KUBECONFIG_ROOT_DIR=/tmp/kubeconfig
./main.sh config
- name: verify cluster
run: |
./verify.sh verify_cluster

test_local_cluster_withEdgeCase_file_exists:
# file exists should not blocking process
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: start from local
run: |
echo 1 > /tmp/kubeconfig
export CLUSTER_PROVIDER=kind
export CLUSTER_CONFIG=false
./main.sh up
- name: test as kepler action behavior
run: |
mkdir -p /tmp/kubeconfig
cp .kube/config /tmp/kubeconfig
export PROMETHEUS_ENABLE=true
export TEKTON_ENABLE=true
export KUBECONFIG_ROOT_DIR=/tmp/kubeconfig
./main.sh config
- name: verify cluster
run: |
./verify.sh verify_cluster
5 changes: 5 additions & 0 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ cluster_up() {
local kubeconfig
kubeconfig="$("${CLUSTER_PROVIDER}"_kubeconfig)"

if [ -e "$KUBECONFIG_ROOT_DIR" ]; then
info "there $KUBECONFIG_ROOT_DIR moving to bak file"
mv "$KUBECONFIG_ROOT_DIR" "$KUBECONFIG_ROOT_DIR"_bak
fi

mkdir -p "$(basename "$KUBECONFIG_ROOT_DIR")"
mv -f "$kubeconfig" "${KUBECONFIG_ROOT_DIR}/${KEPLER_KUBECONFIG}"

Expand Down
1 change: 1 addition & 0 deletions providers/kind/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ kind_up() {
kind_wait_up
_run_kind_registry
ok "kind cluster $KIND_CLUSTER_NAME is up and running"
kind_print_config
}

kind_down() {
Expand Down
Loading