Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
* Use python kube-client
* Modularize delete functionality
* Add -n, --namespace parameter for namespace
* Error handling

Signed-off-by: Chirayu Kapoor <dev.csociety@gmail.com>
  • Loading branch information
chiukapoor committed Jul 8, 2024
1 parent c582411 commit 553d884
Show file tree
Hide file tree
Showing 4 changed files with 727 additions and 796 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
KUBEPLUS_TEST_OUTPUT: yes
jobs:
job1:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
name: Deploy to minikube
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
pip3 install -r requirements.txt
apiserver=`kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}'`
echo "API_SERVER_URL:$apiserver"
python3 provider-kubeconfig.py -s $apiserver create $KUBEPLUS_NS
python3 provider-kubeconfig.py create -s $apiserver -n $KUBEPLUS_NS
deactivate
echo "Building mutating-webhook..."
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Let’s look at an example of creating a multi-instance WordPress Service using
source venv/bin/activate
pip3 install -r requirements.txt
apiserver=`kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}'`
python3 provider-kubeconfig.py -s $apiserver create $KUBEPLUS_NS
python3 provider-kubeconfig.py create -s $apiserver -n $KUBEPLUS_NS
deactivate
```

Expand Down
1 change: 1 addition & 0 deletions kubeplus-saas-provider.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"apiVersion": "v1", "kind": "Config", "clusters": [{"name": "kubeplus-saas-provider", "cluster": {"server": "https://127.0.0.1:37325", "insecure-skip-tls-verify": true}}], "users": [{"name": "kubeplus-saas-provider", "user": {"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IlcxbXU1VUU3UDhaUTlLekNMZUVYZ3ZhSC1NUFF5cEpYLVFVTk1fdmt1aFEifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJhYmMiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlY3JldC5uYW1lIjoia3ViZXBsdXMtc2Fhcy1wcm92aWRlciIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrdWJlcGx1cy1zYWFzLXByb3ZpZGVyIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiNjM1Mjc1NGMtNmY5OS00YmMyLTkzNWQtZjcyZjY2MzM3YjkwIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50OmFiYzprdWJlcGx1cy1zYWFzLXByb3ZpZGVyIn0.IvI9d_GB9uAHGOpjbo_PBDFF7nadXI_d8Iwe-Vv-48O4bADcNyW12c2I4zdOoPwVIitGc_3j4CYB4qtNdvdVzklS3W_orsFaq2WfU3Hg58E39QYp1yLwgeF7ef2YpMjc-aNtXRNY9wKEKcmGgOIu4rTFEncB-IK1nsFAxIlHj7pHpvMF6aT98MdgggkTlnn98Ku63nnNVm-sem_mFSHq-evkxm3X7Ljb2E683Mc2VxuioGUyR3BKM_LIsEzyPHgLDZg9vVWji6fq_6QGBJWqA_8AqB8tYO2RI_M67R3VwpqW9EbGI9UcUFxgDcgCxShccnhGsAWBBChYbL63Z-3QLg"}}], "contexts": [{"name": "kubeplus-saas-provider", "context": {"cluster": "kubeplus-saas-provider", "user": "kubeplus-saas-provider", "namespace": "abc"}}], "current-context": "kubeplus-saas-provider"}
Loading

0 comments on commit 553d884

Please sign in to comment.