Bug 1629021

Summary: Image cannot be pulled from private docker hub registry
Product: OpenShift Container Platform Reporter: Adam Kirk <adamk>
Component: openshift-controller-managerAssignee: Michal Fojtik <mfojtik>
Status: CLOSED DUPLICATE QA Contact: zhou ying <yinzhou>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.9.0CC: aos-bugs, maszulik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-17 10:30:03 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:

Description Adam Kirk 2018-09-14 16:28:08 UTC
Description of problem:

Images cannot be pulled from private docker hub registry. I have tried the following steps using a private gitlab registry without issue...it seems to only affect docker hub.

I have tested all credentials manually by using docker login and docker pull for the same image, so I'm confident it's not a permissions problem.

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

OpenShift Master: v3.9.31
Kubernetes Master: v1.9.1+a0ce1bc657
OpenShift Web Console: v3.9.31

How reproducible:

Seems consistent, with docker hub.

Steps to Reproduce:

Run the following commands to create a secret:

```
$ oc create secret docker-registry dockerhubsecret \
    --docker-server=docker.io \
    --docker-username=***** \
    --docker-password="******" \
    --docker-email=*****
$ oc secrets link default dockerhubsecret --for=pull
```

Then run oc apply -f ./some.yaml 

```some.yaml
apiVersion: v1
kind: DeploymentConfig
metadata:
  annotations:
    description: test-private-image
  name: test-private-image
spec:
  replicas: 1
  selector:
    name: test-private-image
  template:
    metadata:
      labels:
        name: test-private-image
      name: test-private-image
    spec:
      imagePullSecrets:
      - name: dockerhubsecret
      containers:
      - image: docker.io/private/app:latest
        command:
        - "/bin/sh"
        - "-c"
        - "while true; do echo 'running'; sleep 1; done"
        name: test-private-image
```



Actual results:

The pod will not initialize and gives the following error:

'Failed to pull image "private/app:latest": rpc error: code = Unknown desc = repository private/app:latest not found: does not exist or no pull access'

Expected results:

The image should be pulled and the pod should initialize.

Comment 1 Maciej Szulik 2018-09-17 10:30:03 UTC
Closing as a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1561989

*** This bug has been marked as a duplicate of bug 1561989 ***