Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1810181: Components using globs in Dockerfile COPY commands may break on OCP 4 #802

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile.rhel7
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ ENV GO_PACKAGE github.com/openshift/cluster-kube-apiserver-operator
RUN make build --warn-undefined-variables

FROM registry.svc.ci.openshift.org/ocp/4.4:base
RUN mkdir -p /usr/share/bootkube/manifests /manifests
COPY --from=builder /go/src/github.com/openshift/cluster-kube-apiserver-operator/bindata/bootkube/* /usr/share/bootkube/manifests/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-apiserver-operator/bindata/bootkube/bootstrap-manifests /usr/share/bootkube/manifests/bootstrap-manifests/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-apiserver-operator/bindata/bootkube/config /usr/share/bootkube/manifests/config/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-apiserver-operator/bindata/bootkube/manifests /usr/share/bootkube/manifests/manifests/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-apiserver-operator/cluster-kube-apiserver-operator /usr/bin/
COPY manifests/*.yaml /manifests/
COPY manifests/image-references /manifests/
COPY manifests /manifests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know that folder structure does not matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content is exactly the same. The directory contains a bunch of yaml files and image-references file. Previously they were copied in two separate steps COPY manifests/*.yaml /manifests/ and COPY manifests/image-references /manifests/. Now only with one command COPY manifests /manifests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's see what happens when it is incorrect - I suspect the build failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All e2e tests except e2e-aws-upgrade failed on the bootstrap step.

I suspect e2e-aws-upgrade passed because the previous version applied the manifests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additionally, checking the image layer on the local disk gives the correct directory structure.

docker build
...
Step 11/13 : COPY manifests /manifests
 ---> 880677ddc878

I think that UpperDir contains changes made by that container

docker inspect 880677ddc878
...
"UpperDir":"/var/lib/docker/overlay2/5b82326af7a839d45bb2e25a3cf0903e92493f395630d39fc4835efa955916a3/diff"

Listing the content gives

ls 5b82326af7a839d45bb2e25a3cf0903e92493f395630d39fc4835efa955916a3/diff/manifests/

0000_20_kube-apiserver-operator_00_namespace.yaml             0000_20_kube-apiserver-operator_00_scc-hostnetwork.yaml  0000_20_kube-apiserver-operator_01_operator.cr.yaml         0000_20_kube-apiserver-operator_05_serviceaccount.yaml   0000_90_kube-apiserver-operator_02_prometheusrolebinding.yaml
0000_20_kube-apiserver-operator_00_scc-anyuid.yaml            0000_20_kube-apiserver-operator_00_scc-nonroot.yaml      0000_20_kube-apiserver-operator_02_service.yaml             0000_20_kube-apiserver-operator_06_deployment.yaml       0000_90_kube-apiserver-operator_03_servicemonitor.yaml
0000_20_kube-apiserver-operator_00_scc-hostaccess.yaml        0000_20_kube-apiserver-operator_00_scc-privileged.yaml   0000_20_kube-apiserver-operator_03_configmap.yaml           0000_20_kube-apiserver-operator_07_clusteroperator.yaml  0000_90_kube-apiserver-operator_04_servicemonitor-apiserver.yaml
0000_20_kube-apiserver-operator_00_scc-hostmount-anyuid.yaml  0000_20_kube-apiserver-operator_00_scc-restricted.yaml   0000_20_kube-apiserver-operator_04_clusterrolebinding.yaml  0000_90_kube-apiserver-operator_01_prometheusrole.yaml   image-references

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copying only a single file COPY manifests/image-references /manifests/ gives me

ls ab9dc871721dccc831953c924029252ed8156771251e36fbb129fe0cc20069eb/diff/manifests/
image-references

COPY vendor/github.com/openshift/api/operator/v1/0000_20_kube-apiserver-operator_01_config.crd.yaml /manifests
LABEL io.openshift.release.operator true
# FIXME: entrypoint shouldn't be bash but the binary (needs fixing the chain)
Expand Down