Skip to content

RUST-1905 Add Kubernetes Support for OIDC #1276

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

Merged
merged 9 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
actually run tests
  • Loading branch information
abr-egn committed Jan 7, 2025
commit 6a45f568d7302dad96199628afd79219c9983887
104 changes: 93 additions & 11 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,10 @@ buildvariants:
AUTH: auth
SSL: ssl
tasks:
- testoidc_task_group
- testazureoidc_task_group
- testgcpoidc_task_group
- test-oidc-task-group
- test-azure-oidc-task-group
- test-gcp-oidc-task-group
- test-k8s-oidc-task-group

- name: oidc-macos
display_name: "OIDC Macos"
Expand All @@ -304,7 +305,7 @@ buildvariants:
AUTH: auth
SSL: ssl
tasks:
- testoidc_task_group
- test-oidc-task-group

- name: oidc-windows
disable: true
Expand All @@ -316,9 +317,9 @@ buildvariants:
AUTH: auth
SSL: ssl
tasks:
- testoidc_task_group
- testazureoidc_task_group
- testgcpoidc_task_group
- test-oidc-task-group
- test-azure-oidc-task-group
- test-gcp-oidc-task-group

- name: in-use-encryption
display_name: "In-Use Encryption"
Expand Down Expand Up @@ -636,7 +637,7 @@ task_groups:
tasks:
- test-aws-lambda-deployed

- name: testoidc_task_group
- name: test-oidc-task-group
setup_group:
- func: fetch source
- func: create expansions
Expand Down Expand Up @@ -665,7 +666,7 @@ task_groups:
tasks:
- oidc-auth-test-latest

- name: testazureoidc_task_group
- name: test-azure-oidc-task-group
setup_group:
- func: fetch source
- func: create expansions
Expand All @@ -692,7 +693,7 @@ task_groups:
tasks:
- oidc-auth-test-azure-latest

- name: testgcpoidc_task_group
- name: test-gcp-oidc-task-group
setup_group:
- func: fetch source
- func: create expansions
Expand All @@ -719,6 +720,31 @@ task_groups:
tasks:
- oidc-auth-test-gcp-latest

- name: test-k8s-oidc-task-group
setup_group:
- func: fetch source
- func: create expansions
- func: prepare resources
- func: fix absolute paths
- func: init test-results
- func: make files executable
- func: install rust
- command: subprocess.exec
params:
binary: bash
args:
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh
teardown_task:
- command: subprocess.exec
params:
binary: bash
args:
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/teardown.sh
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800
tasks:
- oidc-auth-test-k8s-latest

- name: happy-eyeballs-task-group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800
Expand Down Expand Up @@ -1188,6 +1214,23 @@ tasks:
GCPOIDC_DRIVERS_TAR_FILE: ${STATIC_TEST_TARBALL}
GCPOIDC_TEST_CMD: "ls -la && PROJECT_DIRECTORY='.' OIDC_ENV=gcp OIDC=oidc TEST_FILE=./${STATIC_TEST_BINARY} ./.evergreen/run-mongodb-oidc-test.sh"

- name: "oidc-auth-test-k8s-latest"
commands:
- func: "build static test tarball"
- command: ec2.assume_role
params:
role_arn: ${aws_test_secrets_role}
duration_seconds: 1800
- func: "run oidc k8s test"
vars:
VARIANT: eks
- func: "run oidc k8s test"
vars:
VARIANT: gke
- func: "run oidc k8s test"
vars:
VARIANT: aks

- name: "test-happy-eyeballs"
commands:
- command: subprocess.exec
Expand Down Expand Up @@ -1916,4 +1959,43 @@ functions:
- BUILD_FEATURES
- command: expansions.update
params:
file: src/static-test-tarball-expansion.yml
file: src/static-test-tarball-expansion.yml

"run oidc k8s test":
- command: subprocess.exec
params:
working_dir: src
binary: bash
args:
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup-pod.sh
env:
K8S_VARIANT: ${VARIANT}
include_expansions_in_env:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- DRIVERS_TOOLS
- command: subprocess.exec
type: test
params:
working_dir: src
binary: bash
args:
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/run-driver-test.sh
env:
K8S_DRIVERS_TAR_FILE: ${STATIC_TEST_TARBALL}
K8S_TEST_CMD: "ls -la && PROJECT_DIRECTORY='.' OIDC_ENV=k8s OIDC=oidc TEST_FILE=./${STATIC_TEST_BINARY} ./.evergreen/run-mongodb-oidc-test.sh"
include_expansions_in_env:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- command: subprocess.exec
params:
working_dir: src
binary: bash
args:
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/teardown-pod.sh
include_expansions_in_env:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
3 changes: 2 additions & 1 deletion .evergreen/run-mongodb-oidc-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ elif [ $OIDC_ENV == "gcp" ]; then
$TEST_FILE test::spec::oidc::gcp --nocapture
RESULT=$?
elif [ $OIDC_ENV == "k8s" ]; then
echo placeholder
$TEST_FILE test::spec::oidc::k8s --nocapture
RESULT=$?
else
echo "Unrecognized OIDC_ENV '${OIDC_ENV}'"
exit 1
Expand Down