Bug 1975553

Summary: Windows pod with a Projected Volume is stuck at ContainerCreating
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: Windows ContainersAssignee: Aravindh Puthiyaparambil <aravindh>
Status: CLOSED ERRATA QA Contact: gaoshang <sgao>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 4.7CC: aos-bugs, gmarkley, nstielau, rphillips, sdodson
Target Milestone: ---   
Target Release: 4.7.z   
Hardware: x86_64   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Windows Pods with a Projected Volume and with a RunAsUser present in the Pod's SecurityContext results in os.Chown() being executed for entities being projected. Consequence: os.Chown() is not implemented for Windows and results in an error being thrown and the Pod is stuck in ContainerCreating. Fix: Don't execute os.Chown() if the kubelet is running on Windows Result: Pods go to running
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-08 08:48:51 UTC Type: ---
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: 1973580    
Bug Blocks:    

Comment 1 Aravindh Puthiyaparambil 2021-06-28 21:38:35 UTC
This bug needs to be fixed and released as part of WMCO 2.0.2.  This is a requirement for the WMCO 3.0.0 release, to prevent Windows Pods from not coming after an upgrade from 4.7 to 4.8.

Comment 2 gaoshang 2021-07-02 09:27:07 UTC
This bug has been verified on 4.7.0-0.nightly-2021-07-01-234327 and passed, thanks.

Version-Release number of selected component (if applicable):
WMCO commit: 0a9fd1d1d820905673f82c6ec8f1eda558c411f6
OCP build: 4.7.0-0.nightly-2021-07-01-234327

Steps:
1, Build WMCO from release-4.7 branch and install the operator on OCP 4.7
2, Bootstrap Windows node
3, Create the Secrets for Projected Volume
oc new-project winc-test
echo -n "admin" > ./username.txt
echo -n "1f2d1e2e67df" > ./password.txt
oc create secret generic user --from-file=./username.txt
oc create secret generic pass --from-file=./password.txt

4, Create Windows Pod with Projected Volume
e.g.
oc create -f https://raw.githubusercontent.com/sgaoshang/winc-test/master/data/WinWebServer_Projected_Volume.yaml

5, Check creating Windows pod with a Projected Volume succeed and the projected-volume directory contains your projected sources

# oc get pod -owide
NAME                            READY   STATUS    RESTARTS   AGE   IP           NODE                                         NOMINATED NODE   READINESS GATES
win-webserver-796c99c67-8zlrt   1/1     Running   0          13m   10.132.3.2   ip-10-0-128-108.us-east-2.compute.internal   <none>           <none>

# oc exec -it win-webserver-796c99c67-8zlrt powershell
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved. 

PS C:\> ls .\projected-volume\ 


    Directory: C:\projected-volume 


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         7/2/2021   9:13 AM                ..2021_07_02_09_13_40.423701902
d----l         7/2/2021   9:13 AM                ..data
-a---l         7/2/2021   9:13 AM              0 password.txt
-a---l         7/2/2021   9:13 AM              0 username.txt


PS C:\> cat .\projected-volume\username.txt 
admin 
PS C:\> cat .\projected-volume\password.txt  
1f2d1e2e67df

Comment 5 errata-xmlrpc 2021-07-08 08:48:51 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 (Windows Container Support for Red Hat OpenShift 2.0.2 product release), 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/RHBA-2021:2671