Skip to content

OKD: Add build args for FCOS and SCOS#3294

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
LorbusChris:okd-build-args
Aug 23, 2022
Merged

OKD: Add build args for FCOS and SCOS#3294
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
LorbusChris:okd-build-args

Conversation

@LorbusChris
Copy link
Copy Markdown
Contributor

@LorbusChris LorbusChris commented Aug 17, 2022

Follow up to #3286

- What I did

This change introduces the TAGS build-arg in Dockerfile which is
propagated through to the Go build as a build constraint (aka build tag).
Supported values for TAGS are fcos and scos, with fcos taking
precedence if both are specified.
This is necessary to modify the otherwise hard-coded imagestream tag
rhel-coreos-8 used for the RHCOS8 OS container image to be either
fedora-coreos in OKD on FCOS, or centos-stream-coreos-9 in OKD on
SCOS.

- How to verify it

  • CI does not break
  • manually built image (e.g. with podman build -f Dockerfile --build-arg TAGS="scos") has IS tag named centos-stream-coreos-9 in /manifests/image-references

- Description for the changelog
OKD: Add build args for FCOS and SCOS

/cc @cgwalters
/cc @vrutkovs

@openshift-ci openshift-ci Bot requested review from cgwalters and vrutkovs August 17, 2022 14:16
This change introduces the TAGS build-arg in `Dockerfile` which is
propagated through to the Go build as a build constraint (aka build tag).
Supported values for TAGS are `fcos` and `scos`, with `fcos` taking
precedence if both are specified.
This is necessary to modify the otherwise hard-coded imagestream tag
`rhel-coreos-8` used for the RHCOS8 OS container image to be either
`fedora-coreos` in OKD on FCOS, or `centos-stream-coreos-9` in OKD on
SCOS.
Copy link
Copy Markdown
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Thanks so much for diving into this!

Comment thread Dockerfile
Comment on lines +14 to +15
RUN if [[ "${TAGS}" == "fcos" ]]; then sed -i 's/rhel-coreos-8/fedora-coreos/g' /manifests/*; \
elif [[ "${TAGS}" == "scos" ]]; then sed -i 's/rhel-coreos-8/centos-stream-coreos-9/g' /manifests/*; fi && \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks totally fine as is but I think it'd be a bit nicer to have this be part of the Makefile flow so it's easier to do in local builds. IOW as is right now a local make will always do RHCOS, but it'd be nicer to support e.g. env OS=scos make to get e.g. a machine-config-daemon binary I can just copy to a node and run live without doing the whole container flow.

(But again, fine by me as is!)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! I'll take another look :)

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 17, 2022
@LorbusChris
Copy link
Copy Markdown
Contributor Author

/hold
per Colin's suggestion

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 17, 2022
@cgwalters
Copy link
Copy Markdown
Member

/lgtm

@LorbusChris feel free to /hold cancel from my PoV; build tweaks can be done as a followup.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 23, 2022
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Aug 23, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, LorbusChris

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

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

@LorbusChris
Copy link
Copy Markdown
Contributor Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 23, 2022
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 2 against base HEAD f21482c and 8 for PR HEAD 6fbc392 in total

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 1 against base HEAD f21482c and 7 for PR HEAD 6fbc392 in total

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD f21482c and 6 for PR HEAD 6fbc392 in total

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 2 against base HEAD 29d06d8 and 5 for PR HEAD 6fbc392 in total

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Aug 23, 2022

@LorbusChris: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

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.

4 participants