From 5fb417f9aeac8ef18b07f1a488f6b39175c2d5eb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 03:21:11 +0000 Subject: [PATCH] Add interactive flag and improve script usability Co-authored-by: rchincha <45800463+rchincha@users.noreply.github.com> --- examples/kind/README.md | 4 ++++ examples/kind/kind-oidc.sh | 22 +++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/examples/kind/README.md b/examples/kind/README.md index 49f85e54..c13ed563 100644 --- a/examples/kind/README.md +++ b/examples/kind/README.md @@ -56,7 +56,11 @@ This test validates that: #### Usage ```bash +# Run in non-interactive mode (default, suitable for CI) ./kind-oidc.sh + +# Run in interactive mode (keeps cluster running until you press Enter) +./kind-oidc.sh --interactive ``` The script will: diff --git a/examples/kind/kind-oidc.sh b/examples/kind/kind-oidc.sh index 0a26d161..8648e028 100755 --- a/examples/kind/kind-oidc.sh +++ b/examples/kind/kind-oidc.sh @@ -7,6 +7,12 @@ KIND="${ROOT_DIR}"/hack/tools/bin/kind # Reference: https://github.com/int128/kind-oidc # This test validates Kubernetes OIDC authentication with zot registry +# Parse command-line arguments +INTERACTIVE=false +if [ "$1" = "--interactive" ]; then + INTERACTIVE=true +fi + # set no_proxy if applicable if [ ! -z "${no_proxy}" ]; then echo "Updating no_proxy env var"; @@ -343,11 +349,13 @@ echo "==========================================" echo "Test completed successfully!" echo "==========================================" echo "" -echo "Note: This test creates a kind cluster with OIDC authentication enabled." -echo "The cluster will be deleted when the script exits." -echo "Press Ctrl+C to cleanup and exit, or the cleanup will happen automatically." -echo "" -# Keep the script running so user can interact with the cluster -echo "Press Enter to cleanup and exit..." -read +if [ "$INTERACTIVE" = true ]; then + echo "Note: This test created a kind cluster with OIDC authentication enabled." + echo "The cluster will be deleted when the script exits." + echo "Press Enter to cleanup and exit..." + read +else + echo "Note: Running in non-interactive mode. Cleaning up automatically..." + sleep 2 +fi