Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dex-login-test #2830

Merged
Merged
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
9 changes: 2 additions & 7 deletions .github/workflows/dex_test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build & Apply Dex manifests in KinD
on:

Check warning on line 2 in .github/workflows/dex_test.yaml

View workflow job for this annotation

GitHub Actions / format_YAML_files

2:1 [truthy] truthy value should be one of [false, true]
pull_request:
paths:
- .github/workflows/dex_test.yaml
Expand All @@ -25,13 +25,9 @@
- name: Install kustomize
run: ./tests/gh-actions/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 All @@ -43,5 +39,4 @@
- name: test dex login
run: |
pip3 install requests
# currently broken
# ./tests/gh-actions/test_dex_login.py
./tests/gh-actions/test_dex_login.py
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
Loading