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

oc should warn a user when there is an unqualified kind/group

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • openshift-4.18, openshift-4.19
    • oc
    • None
    • None
    • Product / Portfolio Work
    • None
    • False
    • Hide

      None

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

      1. Proposed title of this feature request

      oc should warn a user when there is an unqualified kind/group

      2. What is the nature and description of the request?

      RFE-3576 / OCPSTRAT-630 landed in 4.16 with some improvement in this space, although they only looked at short-name overlap. This RFE is asking for oc to give similar warnings when the kind/group are not fully qualified, to help avoid confusion and nudge folks away from brittle assumptions in all API-lookup situations.

      3. Why does the customer need this? (List the business requirements here)

      With RFE-3576 / OCPSTRAT-630, we have ambiguous short name warnings:

      $ oc version --client
      Client Version: 4.18.0-rc.0
      Kustomize Version: v5.4.2
      $ oc -n openshift-machine-api get ma
      Warning: short name "ma" could also match lower priority resource machines.cluster.x-k8s.io
      NAME                                 REF KIND     REF NAME                             MIN   MAX   AGE
      build0-gstfj-ci-builds-worker-b      MachineSet   build0-gstfj-ci-builds-worker-b      0     120   194d
      ...
      

      But we don't have (and this RFE is requesting) underqualified type warnings:

      $ oc -n openshift-machine-api get machines
      No resources found in openshift-machine-api namespace.
      

      We should grow them, even in cases where there is no current ambiguity, because someone using oc -n openshift-machine-api get machines in a default-feature-set cluster today might be unambiguously referencing machines.machine.openshift.io, but in some future cluster lose precedence to machines.cluster.x-k8s.io, etc. We want something that points out that fully-qualified kind.group references are more reliable, and recommended for scripts and anything where the caller isn't happy to add additional clarification if they need to get at the particular resource they're hoping for.

      4. List any affected packages or components.

      Just oc, but the relevant code is upstream, so likely a large push and long lead time to make progress. Previous work and discussion in kube#110218.

              gausingh@redhat.com Gaurav Singh
              trking W. Trevor King
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                None
                None