Bug 1460097 - env from binary file secret produces invalid Docker header
env from binary file secret produces invalid Docker header
Status: ASSIGNED
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod (Show other bugs)
3.5.1
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Seth Jennings
DeShuai Ma
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-09 02:19 EDT by Takayoshi Kimura
Modified: 2018-06-15 18:13 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Takayoshi Kimura 2017-06-09 02:19:57 EDT
Description of problem:

By mistake, put binary secret into container env var, container run fails with cryptic random message like:

$ oc logs hello-sinatra-3-f4v8x 
container_linux.go:247: starting container process caused "process_linux.go:291: setting cgroup config for ready process caused \"open /sys/fs/cgroup/cpu,cpuacct/system.slice/docker-ae38bec5b56d56780a990a2e9520af10861e6cc60b12373f769580feb1be5b5e.scope/cpu.shares: no such file or directory\""

container_linux.go:247: starting container process caused "process_linux.go:295: setting oom score for ready process caused \"write /proc/74956/oom_score_adj: invalid argument\""

$ oc secret new perl /usr/bin/perl
$ oc edit dc

     spec:
        containers:
        - env:
          - name: binary
            valueFrom:
              secretKeyRef:
                key: perl
                name: perl

The docker command for same works and it looks like docker filters some binary code for env:

# docker run --env "foo=`cat /usr/bin/perl`" --rm -it registry.access.redhat.com/rhel7  bash


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

atomic-openshift-3.5.5.15-1.git.0.4b5f317.el7.x86_64
docker-1.12.6-16.el7.x86_64

How reproducible:

Always

Steps to Reproduce:
1. See description
2.
3.

Actual results:

Failed with various random message, like cgroups file not found, invalid argument, invalid header, etc.

Expected results:

Better error message, or filter the binary like docker does.

Additional info:
Comment 1 Seth Jennings 2017-06-12 15:52:33 EDT
Related upstream issue:
https://github.com/kubernetes/kubernetes/issues/32432

Note You need to log in before you can comment on or make changes to this bug.