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

network-tools pod-run-netns-command option --no-substitution does not work

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 4.20, 4.21
    • oc
    • None
    • None
    • False
    • Hide

      None

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

      Description of problem:

      network-tools pod-run-netns-command option --no-substitution does not work, the variables were substituted even use the option

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

       4.20, 4/21

      How reproducible:

      always    

      Steps to Reproduce:

      Run command that needs to preserve the literal meaning with --no-substitution, following example in help:
      
      
      % oc adm must-gather  --image-stream=openshift/network-tools:latest -- network-tools pod-run-netns-command --no-substitution test hello-pod "'"'i=0; i=$(( $i + 1 )); echo result$i'"'" 
      [must-gather      ] OUT 2026-01-26T12:14:31.616298Z Using must-gather plug-in image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:485ea58f6ab78e43d625d1ba29ec88101ce83b50710040fa6c89e74ba000ca68
      When opening a support case, bugzilla, or issue please include the following summary data along with any other requested information:
      ClusterID: 21a670a5-ac3e-49ee-b3fd-bc274482330d
      ClientVersion: 4.21.0-0.nightly-2026-01-17-030111
      ClusterVersion: Stable at "4.21.0-0.nightly-2026-01-22-192129"
      ClusterOperators:
          All healthy and stable
      [must-gather      ] OUT 2026-01-26T12:14:32.578909Z namespace/openshift-must-gather-ndngz created
      [must-gather      ] OUT 2026-01-26T12:14:32.842178Z clusterrolebinding.rbac.authorization.k8s.io/must-gather-vqz2p created
      [must-gather      ] OUT 2026-01-26T12:14:33.59489Z pod for plug-in image quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:485ea58f6ab78e43d625d1ba29ec88101ce83b50710040fa6c89e74ba000ca68 created
      [must-gather-qdz4f] POD 2026-01-26T12:14:34.310215155Z [disk usage checker] Started
      [must-gather-qdz4f] POD 2026-01-26T12:14:34.313572415Z [disk usage checker] Volume usage percentage: current = 16 ; allowed = 70
      [must-gather-qdz4f] POD 2026-01-26T12:14:34.769369387Z Starting pod/ip-10-0-12-46us-east-2computeinternal-debug-5ktmr ...
      [must-gather-qdz4f] POD 2026-01-26T12:14:34.769369387Z To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
      [must-gather-qdz4f] POD 2026-01-26T12:14:35.780536421Z 
      [must-gather-qdz4f] POD 2026-01-26T12:14:35.780536421Z Removing debug pod ...
      [must-gather-qdz4f] POD 2026-01-26T12:14:35.800190152Z 
      [must-gather-qdz4f] POD 2026-01-26T12:14:35.800190152Z INFO: Running 'i=0; i=1; echo result' in the netns of pod hello-pod
      [must-gather-qdz4f] POD 2026-01-26T12:14:35.903490615Z Starting pod/ip-10-0-12-46us-east-2computeinternal-debug-rf7l7 ...
      [must-gather-qdz4f] POD 2026-01-26T12:14:35.903528819Z To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
      [must-gather-qdz4f] POD 2026-01-26T12:14:36.781664559Z result
      [must-gather-qdz4f] POD 2026-01-26T12:14:36.782150211Z 
      [must-gather-qdz4f] POD 2026-01-26T12:14:36.782150211Z Removing debug pod ...
      [must-gather-qdz4f] POD 2026-01-26T12:14:36.814799286Z Caches written to disk
      [must-gather-qdz4f] OUT 2026-01-26T12:14:44.254585Z waiting for gather to complete
      [must-gather-qdz4f] OUT 2026-01-26T12:14:44.468883Z downloading gather output
      [must-gather-qdz4f] OUT 2026-01-26T12:14:49.687927Z Transfer starting: 1 files
      [must-gather-qdz4f] OUT 2026-01-26T12:14:49.688098Z ./
      [must-gather-qdz4f] OUT 2026-01-26T12:14:49.688118Z 
      [must-gather-qdz4f] OUT 2026-01-26T12:14:49.688134Z sent 22 bytes  received 58 bytes  800000 bytes/sec
      [must-gather-qdz4f] OUT 2026-01-26T12:14:49.688288Z total size is 0  speedup is 0.00
      [must-gather      ] OUT 2026-01-26T12:14:49.909507Z namespace/openshift-must-gather-ndngz deleted
      Reprinting Cluster State:
      When opening a support case, bugzilla, or issue please include the following summary data along with any other requested information:
      ClusterID: 21a670a5-ac3e-49ee-b3fd-bc274482330d
      ClientVersion: 4.21.0-0.nightly-2026-01-17-030111
      ClusterVersion: Stable at "4.21.0-0.nightly-2026-01-22-192129"
      ClusterOperators:
          All healthy and stable

      Actual results:

      The variables were substituted even use the option
      
      log in output:
      [must-gather-qdz4f] POD 2026-01-26T12:14:35.800190152Z INFO: Running 'i=0; i=1; echo result' in the netns of pod hello-pod
      
      result of the command in output:
      [must-gather-qdz4f] POD 2026-01-26T12:14:36.781664559Z result

      Expected results:

      The variables should not be substituted
      
      expected log in output: 
      INFO: Running 'i=0; i=$(( $i + 1 )); echo result$i' in the netns of pod hello-pod
      
      expected result of the command in output:
      result1

      Additional info:

          

              aos-workloads-staff Workloads Team Bot Account
              rh-ee-qiowang Qiong Wang
              None
              None
              Qiong Wang Qiong Wang
              Ashley Hardin Ashley Hardin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: