Uploaded image for project: 'OpenShift Request For Enhancement'
  1. OpenShift Request For Enhancement
  2. RFE-7624

Enhance oc explain for `oauth.spec.tokenConfig.accessTokenMaxAgeSeconds` Output to Include Default Values for Fields

XMLWordPrintable

    • None
    • Product / Portfolio Work
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When executing the command {{oc explain oauth.spec.tokenConfig.accessTokenMaxAgeSeconds, }}The output currently provides the field name, type, and a brief description:

       

      oc explain oauth.spec.tokenConfig.accessTokenMaxAgeSeconds
      GROUP:       config.openshift.io
      KIND:        OAuth
      VERSION:     v1
      FIELD: accessTokenMaxAgeSeconds <integer>
      DESCRIPTION:
        accessTokenMaxAgeSeconds defines the maximum age of access tokens
      

      While this output is accurate, it does not include the default value for accessTokenMaxAgeSeconds.

      Users must refer to external documentation to find this information. For example, the documentation at https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/authentication_and_authorization/configuring-internal-oauth#oauth-configuring-internal-oauth explicitly states the default duration for access tokens.

      The oc explain command should be enhanced to include the default value for fields where one exists. For oauth.spec.tokenConfig.accessTokenMaxAgeSeconds, the output should ideally look something like this (or similar, depending on the exact format the team prefers):

      oc explain oauth.spec.tokenConfig.accessTokenMaxAgeSeconds
      GROUP:       config.openshift.io
      KIND:        OAuth
      VERSION:     v1
      
      FIELD: accessTokenMaxAgeSeconds <integer>
      
      DESCRIPTION:
        accessTokenMaxAgeSeconds defines the maximum age of access tokens
        Default: 86400 (24 hours) 

       

      Justification/Benefit:

      Including default values in oc explain output would significantly improve the user experience by:

      • Reducing friction: Users could quickly ascertain default behaviors directly from the CLI without needing to switch contexts to documentation.
      • Improving discoverability: It makes critical configuration details more readily available.
      • Enhancing consistency: Aligning the CLI's self-documentation with the comprehensive information available in the official documentation.
      • Streamlining troubleshooting: When configuring or debugging, knowing the default value upfront can save time.

      This enhancement would make the oc explain command even more powerful as a primary source of truth for OpenShift API object schemas.

              racedoro@redhat.com Ramon Acedo
              rhn-support-dpateriy Divyam Pateriya
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                None
                None