Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-76958

Trying to use a group to collect ingresses.networking.k8s.io by namespace inspect is not working

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • 4.16, 4.17, 4.18, 4.19, 4.20, 4.21, 4.22
    • oc
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      Trying to use a group to collect ingresses.networking.k8s.io by namespace inspect in [1] is not working. As it has been discussed in GitHub PR [2], the following should collect the `ingresses.networking.k8s.io`:
      
        {Group: "networking.k8s.io", Resource: "ingresses"},
      
      But it fails with the following error even if the resource exists and can be fetched with `oc get ingresses.networking.k8s.io` in the same namespace the `oc adm inspect` is launched:
      
      util.go:118] the server doesn't have a resource type ingresses.networking.k8s.io, skipping the inspection
      

      Version-Release number of selected component (if applicable):

      All versions including 4.22

      How reproducible:

      Always

      Steps to Reproduce:

          1. Add the following in the code [1] to try to collect the `ingresses.networking.k8s.io`: '{Group: "networking.k8s.io", Resource: "ingresses"},' (the "," needs to be there).
          2. Build the `oc`.
          3. Create a basic `ingresses.networking.k8s.io`.
          4. Check that the above created resource can be fetched by `oc get ingresses.networking.k8s.io`.
          5. Collect an inspect with the `oc` build.     

      Actual results:

      The resource is not collected by the inspect, and the following message is shown:
      
      util.go:118] the server doesn't have a resource type ingresses.networking.k8s.io, skipping the inspection

      Expected results:

      The resource should be collected by the inspect

      Additional info:

      Bug created as discussed in the PR [2]. Using '{Resource: "ingresses"},' works, but it should work also '{Group: "networking.k8s.io", Resource: "ingresses"},'

       

      [1] https://github.com/openshift/oc/blob/main/pkg/cli/admin/inspect/namespace.go#L19-L34
      [2] https://github.com/openshift/oc/pull/2004#issuecomment-3909603356

              rh-ee-okupka Ondřej Kupka
              oarribas@redhat.com Oscar Arribas Arribas
              None
              None
              Ying Zhou Ying Zhou
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: