Uploaded image for project: 'Red Hat OpenShift Control Planes'
  1. Red Hat OpenShift Control Planes
  2. CNTRLPLANE-1538

Implement --no-browser flag for oc login --web command

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      Implemented a new --no-browser flag for the oc login --web command that allows users to print the authorization URL instead of automatically opening it in a browser.

      Changes Made

      • Added --no-browser flag to login command (feature-gated behind OC_ENABLE_WEB_LOGIN_NO_BROWSER)
      • Modified login examples to include the new flag usage
      • Updated validation logic to ensure -no-browser can only be used with -web
      • Enhanced URL handling to print URL with instructions when --no-browser is specified
      • Added comprehensive test coverage for the new functionality

      Files Modified

      • pkg/cli/login/login.go - Added flag definition and validation
      • pkg/cli/login/loginoptions.go - Implemented URL handling logic
      • pkg/cli/login/loginoptions_test.go - Added test cases for validation and behavior

      Related Issue

      This story implements functionality related to CNTRLPLANE-1537

              asegurap1@redhat.com Antoni Segura Puimedon
              asegurap1@redhat.com Antoni Segura Puimedon
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: