Bug 1886524

Summary: Change default terminal command for Windows Pods
Product: OpenShift Container Platform Reporter: Pratik Mahajan <pmahajan>
Component: Management ConsoleAssignee: Robb Hamilton <rhamilto>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.6CC: aos-bugs, jokerman, nstielau, spadgett, trankin, yanpzhan
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The terminal assumed all pods are Linux pods and did not account for Windows pods. Consequence: The terminal would not work with Windows pods as it defaulted to sh command. Fix: The terminal should detect the pod type and change the command accordingly. Result: The terminal detects if a pod is Windows and changes the command as necessary.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:24:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1887612    
Attachments:
Description Flags
windows-pod-terminal none

Description Pratik Mahajan 2020-10-08 16:34:43 UTC
Description of problem:
The default command for using the terminal on Windows Pods is currently `sh`, which causes the terminal to not work for windows pods. 
Change the terminal command for windows pods to `cmd`. This can be changed based on the underlying os of the pod. 
Windows Pod have:
```
tolerations:
  - key: "os"
    value: "Windows"
    Effect: "NoSchedule"
```

Steps to Reproduce:
1. Bring up Windows Machine Config Operator https://github.com/openshift/windows-machine-config-operator
2. Bring up a Windows Node
3. Deploy a Windows Workload
4. Open Terminal on Console

Actual results:
Terminal Does not work on Console

Expected results:
Terminal works on Console

Additional info:
For questions regarding Windows Nodes, workloads, etc ping on #forum-winc, tag @winc-team on Slack

Comment 5 Yanping Zhang 2020-10-15 10:39:25 UTC
Set up ocp 4.7 cluster containing windows node with payload 4.7.0-0.nightly-2020-10-15-011122.
Create a windows workload on the cluster, check the pod's terminal, it's using windows terminal cmd. 
The bug is fixed.

Comment 6 Yanping Zhang 2020-10-15 10:40:30 UTC
Created attachment 1721791 [details]
windows-pod-terminal

Comment 9 errata-xmlrpc 2021-02-24 15:24:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633