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

Accomodate ART limitation in parsing [[]] bash #3669

Merged

Conversation

jupierce
Copy link
Contributor

The downstream build pipeline parses bash in Dockerfile RUN commands in order to smooth over yum/dnf invocations that break downstream builds. For example, upstream Dockerfiles may use --disablerepo / --enablerepo / microdnf -- none of which will work as intended in brew/koji builds.
The intent of this feature is to allow, to a reasonable extent, teams to use the same Dockerfile for upstream and downstream -- preventing the overhead of managing two nearly identical files.
When processing changes introduced by c1f5e35 , a limitation in the bashlex parser has been discovered where it cannot handle the (admittedly commonplace / proper) [[ .. ]] test syntax.
Many OCP repos rely on this parsing feature, so the simplest course of action is to use the supported [ .. ] syntax in the MCO Dockerfile.

@@ -13,14 +13,14 @@ COPY --from=builder /go/src/github.com/openshift/machine-config-operator/instroo
RUN cd / && tar xf /tmp/instroot.tar && rm -f /tmp/instroot.tar
COPY install /manifests

RUN if [[ "${TAGS}" == "fcos" ]] || [[ "${TAGS}" == "scos" ]]; then \
RUN if [ "${TAGS}" = "fcos" ] || [ "${TAGS}" = "scos" ]; then \
Copy link
Member

Choose a reason for hiding this comment

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

So, if memory serves correctly, we generate Dockerfile.rhel7 from our Dockerfile using a make step. This change should probably also be made to our Dockerfile as well. Other than that, this change seems fine.

The downstream build pipeline parses bash in Dockerfile `RUN` commands
in order to smooth over yum/dnf invocations that break downstream builds.
For example, upstream Dockerfiles may use `--disablerepo`  /
`--enablerepo` / `microdnf` -- none of which will work as intended
in brew/koji builds.

The intent of this feature is to allow, to a reasonable extent, teams to
use the same Dockerfile for upstream and downstream -- preventing the
overhead of managing two nearly identical files.

When processing changes introduced by
openshift@c1f5e35 ,
a limitation in the bashlex parser has been discovered where it cannot
handle the (admittedly commonplace / proper) `[[ .. ]]` test syntax.

Many OCP repos rely on this parsing feature, so the simplest course of
action is to use the supported `[ .. ]` syntax in the MCO Dockerfile.
@cheesesashimi
Copy link
Member

/lgtm
/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 10, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 10, 2023
@cgwalters
Copy link
Member

/approve
(This can't break e2e, if it builds it works, so if we hit test flakes I'd vote we override)

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 10, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, cheesesashimi, jupierce

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [cgwalters,cheesesashimi]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 10, 2023

@jupierce: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-gcp-ovn-upgrade f56c1d3 link false /test okd-scos-e2e-gcp-ovn-upgrade
ci/prow/okd-scos-e2e-aws-ovn f56c1d3 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-alibabacloud-ovn f56c1d3 link false /test e2e-alibabacloud-ovn

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 4b2c9ac into openshift:master Apr 10, 2023
10 of 13 checks passed
@joepvd
Copy link

joepvd commented Apr 11, 2023

/cherrypick release-4.13

@openshift-cherrypick-robot

@joepvd: new pull request created: #3671

In response to this:

/cherrypick release-4.13

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants