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

Allow passing extra flags to Podman/Docker #6785

Conversation

rm3l
Copy link
Member

@rm3l rm3l commented May 2, 2023

What type of PR is this:
/kind feature

What does this PR do / why we need it:
This introduces the following environment variables that allow users to pass extra args to Podman or Docker commands:

  • ODO_IMAGE_BUILD_ARGS: semicolon-separated list of options to pass to podman build or docker build commands when applying Image components from the Devfile
  • ODO_CONTAINER_RUN_ARGS: semicolon-separated list of options to pass specifically to the podman play kube command (when running odo on Podman)
  • ODO_CONTAINER_BACKEND_GLOBAL_ARGS: semicolon-separated list of global options to pass to all Podman/Docker commands executed by odo

Which issue(s) this PR fixes:
Fixes #6421

PR acceptance criteria:

How to test changes / Special notes to the reviewer:
See the documentation pages above for examples of how to use them.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label May 2, 2023
@openshift-ci
Copy link

openshift-ci bot commented May 2, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@netlify
Copy link

netlify bot commented May 2, 2023

Deploy Preview for odo-docusaurus-preview ready!

Name Link
🔨 Latest commit 978aabb
🔍 Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/6452d868c01a6a00093a1b69
😎 Deploy Preview https://deploy-preview-6785--odo-docusaurus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@odo-robot
Copy link

odo-robot bot commented May 2, 2023

OpenShift Unauthenticated Tests on commit a249d1d finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented May 2, 2023

NoCluster Tests on commit a249d1d finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented May 2, 2023

Unit Tests on commit a249d1d finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented May 2, 2023

Validate Tests on commit a249d1d finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented May 2, 2023

Windows Tests (OCP) on commit a249d1d finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented May 2, 2023

Kubernetes Tests on commit a249d1d finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented May 2, 2023

OpenShift Tests on commit a249d1d finished successfully.
View logs: TXT HTML

@rm3l rm3l force-pushed the 6421-allow-passing-extra-build-flags-to-podman-docker branch from e72359a to f9ff1c9 Compare May 3, 2023 09:06
@odo-robot
Copy link

odo-robot bot commented May 3, 2023

Kubernetes Docs Tests on commit d0ba624 finished successfully.
View logs: TXT HTML

@rm3l rm3l force-pushed the 6421-allow-passing-extra-build-flags-to-podman-docker branch from 9e36542 to 1d7028e Compare May 3, 2023 20:37
rm3l added 6 commits May 3, 2023 23:02
This is supported via 2 new env vars:
- ODO_IMAGE_BUILD_ARGS: passed when building images via Podman/Docker
- ODO_CONTAINER_RUN_ARGS: passed when running odo dev on Podman

Those are comma-separated list of options
that can be passed to either Podman or Docker
(depending on the PODMAN_CMD env var).
…ons for 'podman play kube'

Previously, we were handling 'ODO_CONTAINER_RUN_ARGS' as global options for Podman,
but this turns our not being that useful if we want to pass dedicated options to 'podman play kube'.
This commit introduces a new 'ODO_CONTAINER_BACKEND_GLOBAL_ARGS' env var,
which will be used as global options passed to every Podman command we execute.

This paves the way to isolating our Podman-related tests further
using the '--root' and '--runroot' global options.
@rm3l rm3l force-pushed the 6421-allow-passing-extra-build-flags-to-podman-docker branch from 1d7028e to 07deae3 Compare May 3, 2023 21:31
Doing so because some of the options of Podman/Docker can actually be either repeated or comma-separated.
@rm3l rm3l force-pushed the 6421-allow-passing-extra-build-flags-to-podman-docker branch from 07deae3 to 978aabb Compare May 3, 2023 21:55
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.2% 1.2% Duplication

@rm3l rm3l changed the title [WIP] Allow passing extra build flags to Podman/Docker Allow passing extra flags to Podman/Docker May 4, 2023
@rm3l rm3l marked this pull request as ready for review May 4, 2023 08:12
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label May 4, 2023
@openshift-ci openshift-ci bot requested review from anandrkskd and kadel May 4, 2023 08:12
@rm3l rm3l requested review from feloy and removed request for anandrkskd May 4, 2023 08:12
@rm3l rm3l requested a review from valaparthvi May 4, 2023 08:12
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label May 4, 2023
@openshift-merge-robot openshift-merge-robot merged commit 6241a66 into redhat-developer:main May 4, 2023
@rm3l rm3l deleted the 6421-allow-passing-extra-build-flags-to-podman-docker branch May 4, 2023 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow passing extra build flags to podman/docker
3 participants