Skip to content

Commit

Permalink
fix dex-login-test (#2830)
Browse files Browse the repository at this point in the history
* fix dex-login-test:
- set executable permission for python script
- set shebang line in python script

Signed-off-by: Tom Zaspel <40226087+tzabbi@users.noreply.github.com>

* Add all required componentes which have to be installed to test dex login

Signed-off-by: Tom Zaspel <tom@zaspel.it>

* Add kustomizeation file to deploy all required stuff to test dex login

Signed-off-by: Tom Zaspel <tom@zaspel.it>

* Add statuscode response in dex login

Signed-off-by: Tom Zaspel <40226087+tzabbi@users.noreply.github.com>

---------

Signed-off-by: Tom Zaspel <40226087+tzabbi@users.noreply.github.com>
Signed-off-by: Tom Zaspel <tom@zaspel.it>
  • Loading branch information
tzabbi authored and juliusvonkohout committed Aug 21, 2024
1 parent 617d223 commit 80a0fde
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/dex_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ jobs:
- name: Install KinD, Create KinD cluster and Install kustomize
run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh

- name: Install Istio
run: ./tests/gh-actions/install_istio.sh

- name: Build & Apply manifests
run: |
cd common/dex
kustomize build overlays/istio | kubectl apply -f -
while ! kustomize build ./tests/gh-actions/deploy-dex-login-environment | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 20; done
kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s
- name: port forward
Expand Down
58 changes: 58 additions & 0 deletions tests/gh-actions/deploy-dex-login-environment/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

sortOptions:
order: legacy
legacySortOptions:
orderFirst:
- Namespace
- ResourceQuota
- StorageClass
- CustomResourceDefinition
- MutatingWebhookConfiguration
- ServiceAccount
- PodSecurityPolicy
- NetworkPolicy
- Role
- ClusterRole
- RoleBinding
- ClusterRoleBinding
- ConfigMap
- Secret
- Endpoints
- Service
- LimitRange
- PriorityClass
- PersistentVolume
- PersistentVolumeClaim
- Deployment
- StatefulSet
- CronJob
- PodDisruptionBudget
orderLast:
- ValidatingWebhookConfiguration

resources:
# Istio
- ../../../common/istio-1-22/istio-crds/base
- ../../../common/istio-1-22/istio-namespace/base
- ../../../common/istio-1-22/istio-install/overlays/oauth2-proxy
# oauth2-proxy
- ../../../common/oauth2-proxy/overlays/m2m-self-signed
# Dex
- ../../../common/dex/overlays/oauth2-proxy
- ../../../common/istio-1-22/cluster-local-gateway/base
# Kubeflow namespace
- ../../../common/kubeflow-namespace/base
# NetworkPolicies
- ../../../common/networkpolicies/base
# Kubeflow Roles
- ../../../common/kubeflow-roles/base
# Kubeflow Istio Resources
- ../../../common/istio-1-22/kubeflow-istio-resources/base
# Central Dashboard
- ../../../apps/centraldashboard/overlays/oauth2-proxy
# Profiles + KFAM
- ../../../apps/profiles/upstream/overlays/kubeflow
# User namespace
- ../../../common/user-namespace/base
4 changes: 3 additions & 1 deletion tests/gh-actions/test_dex_login.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import re
import requests
import sys
Expand Down Expand Up @@ -101,7 +103,7 @@ def get_istio_auth_session(url: str, username: str, password: str) -> dict:
username=KUBEFLOW_USERNAME,
password=KUBEFLOW_PASSWORD
)

print(f"{resp}")
if resp == 200:
sys.exit(0)
else:
Expand Down

0 comments on commit 80a0fde

Please sign in to comment.