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

Complete policy.json inclusion (Also add to win installer) #21985

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

n1hility
Copy link
Member

@n1hility n1hility commented Mar 7, 2024

  • Sets default search location to always be the peer directory
    • make podman-remote now creates binaries that work the same as release zips
  • Updates release zip to match expected search location
  • Updates win installer to include the file if present in the repo cross-build archive
none

Copy link
Contributor

openshift-ci bot commented Mar 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: n1hility

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:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 7, 2024
@baude
Copy link
Member

baude commented Mar 7, 2024

Fixes #21964

@baude baude added the 5.0 label Mar 7, 2024
@@ -135,6 +135,13 @@ try {
Copy-Artifact("gvproxy.exe")
}

$loc = Get-ChildItem -Recurse -Path . -Name policy.json
Copy link
Member

Choose a reason for hiding this comment

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

i wondered about how this would work ... neat

@baude
Copy link
Member

baude commented Mar 7, 2024

LGTM

@@ -103,6 +103,8 @@ FISHINSTALLDIR=${PREFIX}/share/fish/vendor_completions.d

SELINUXOPT ?= $(shell test -x /usr/sbin/selinuxenabled && selinuxenabled && echo -Z)

MACHINE_POLICY_JSON_DIR ?= .
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should set the default for everything to ., that just doesn't make sense for local development, i.e. see #21855

Using $(pwd)/pkg/machine/ocipull and then overwriting this to . for the zip file target should be better IMO.

Copy link
Member

Choose a reason for hiding this comment

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

Anyhow it doesn't make the current situation any worse though so consider this non blocking.

Copy link
Member Author

@n1hility n1hility Mar 7, 2024

Choose a reason for hiding this comment

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

IMO a binary you build with podman-remote should work just as well (and ideally the same) as the one installed by a package (and behave similarly). It's a pain to have to build an installer just to try out a change, or to have always pass custom flags to podman-remote (that are always the same). For example, a common workflow a lot of folks use is to just copy up a new binary in the same location on the path. Another example is we had CI tasks that used the binary built from podman-remote (and not the full zip), and so the different behavior was an issue there and required installing a local override (not a huge deal, but it just illustrates the issue). IMO the issue you link is just another form of it

The path you link above is also not quite right because it only works on a system that was building the binary, you can't copy it to another system or hand to someone else to test and have it work.

I think the only thing we can do to address this reliably is to search multiple locations, which is at least already the case on Linux (where /etc/containers is likely to exist), or that other idea you had to possibly fetch a policy from somewhere if it doesnt exist.

Copy link
Member

Choose a reason for hiding this comment

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

Except a binary compiled on a dev machine running with bin/podman won't work because the policy.json is not in the same directory as in the binary.

@ashley-cui
Copy link
Member

Tested Mac pkginstaller and it seemed to work, so LGTM

@n1hility
Copy link
Member Author

n1hility commented Mar 7, 2024

CI issue is legit fix coming in one sec

- Sets default search location to always be the peer directory
  + make podman-remote now creates binaries that work the same as release zips
- Updates release zip to match expected search location
- Updates win installer to include the file if present in the repo cross-build
  archive

[NO NEW TESTS NEEDED]

Signed-off-by: Jason T. Greene <[email protected]>
@baude
Copy link
Member

baude commented Mar 7, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 7, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 4506812 into containers:main Mar 7, 2024
93 of 94 checks passed
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jun 7, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Jun 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
5.0 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. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants