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

chore(signing): Switch fully from /usr/etc/ to /etc/ #375

Merged
merged 5 commits into from
Dec 8, 2024

Conversation

fiftydinar
Copy link
Collaborator

@fiftydinar fiftydinar commented Dec 7, 2024

Fixes: #319

Related PR in CLI:
blue-build/cli#288

I tested this in vanilla Fedora & Universal Blue based image. With & without rechunk.

Logs

Before:

[11:39:42 g.i/h/rechunk:v1.0.1] => WARNING: FOUND /usr/etc. MERGING TO ETC FOR COMPATIBILITY
[11:39:42 g.i/h/rechunk:v1.0.1] => EXPECT PERMISSIONS ISSUES ON THE MERGED PATHS
[11:39:42 g.i/h/rechunk:v1.0.1] => The following files from /usr/etc will be merged to /etc:
[11:39:42 g.i/h/rechunk:v1.0.1] => ./usr/etc
[11:39:42 g.i/h/rechunk:v1.0.1] => |-- containers
[11:39:42 g.i/h/rechunk:v1.0.1] => |   |-- policy.json
[11:39:42 g.i/h/rechunk:v1.0.1] => |   `-- registries.d
[11:39:42 g.i/h/rechunk:v1.0.1] => |       `-- gidro-os.yaml
[11:39:42 g.i/h/rechunk:v1.0.1] => `-- pki
[11:39:42 g.i/h/rechunk:v1.0.1] =>     `-- containers
[11:39:42 g.i/h/rechunk:v1.0.1] =>         `-- gidro-os.pub
[11:39:42 g.i/h/rechunk:v1.0.1] => 
[11:39:42 g.i/h/rechunk:v1.0.1] => 5 directories, 3 files

After:

  • No message about remaining files in /usr/etc/

After (Universal Blue):

[20:34:11 g.i/h/rechunk:v1.0.1] => WARNING: FOUND /usr/etc. MERGING TO ETC FOR COMPATIBILITY
[20:34:11 g.i/h/rechunk:v1.0.1] => EXPECT PERMISSIONS ISSUES ON THE MERGED PATHS
[20:34:11 g.i/h/rechunk:v1.0.1] => The following files from /usr/etc will be merged to /etc:
[20:34:11 g.i/h/rechunk:v1.0.1] => ./usr/etc
[20:34:11 g.i/h/rechunk:v1.0.1] => |-- containers
[20:34:11 g.i/h/rechunk:v1.0.1] => |   `-- policy.json
[20:34:11 g.i/h/rechunk:v1.0.1] => 
[20:34:11 g.i/h/rechunk:v1.0.1] => 2 directories, 1 file

What needs to be fixed

/etc/containers/policy.json (Universal Blue only)

For Universal Blue, policy.json still remains in /usr/etc/ sadly.

Need to wait on Universal Blue to fix this properly.

Meanwhile, we'll copy policy.json to /usr/etc/containers/policy.json in Universal Blue based images only.
While otherwise, we'll normally copy to /etc/containers/policy.json

Fixes: #319

I only tested this in non-Universal Blue image. With & without rechunk.

Before:
```
[11:39:42 g.i/h/rechunk:v1.0.1] => WARNING: FOUND /usr/etc. MERGING TO ETC FOR COMPATIBILITY
[11:39:42 g.i/h/rechunk:v1.0.1] => EXPECT PERMISSIONS ISSUES ON THE MERGED PATHS
[11:39:42 g.i/h/rechunk:v1.0.1] => The following files from /usr/etc will be merged to /etc:
[11:39:42 g.i/h/rechunk:v1.0.1] => ./usr/etc
[11:39:42 g.i/h/rechunk:v1.0.1] => |-- containers
[11:39:42 g.i/h/rechunk:v1.0.1] => |   |-- policy.json
[11:39:42 g.i/h/rechunk:v1.0.1] => |   `-- registries.d
[11:39:42 g.i/h/rechunk:v1.0.1] => |       `-- gidro-os.yaml
[11:39:42 g.i/h/rechunk:v1.0.1] => `-- pki
[11:39:42 g.i/h/rechunk:v1.0.1] =>     `-- containers
[11:39:42 g.i/h/rechunk:v1.0.1] =>         `-- gidro-os.pub
[11:39:42 g.i/h/rechunk:v1.0.1] => 
[11:39:42 g.i/h/rechunk:v1.0.1] => 5 directories, 3 files
```

After:
```
[18:26:31 g.i/h/rechunk:v1.0.1] => WARNING: FOUND /usr/etc. MERGING TO ETC FOR COMPATIBILITY
[18:26:31 g.i/h/rechunk:v1.0.1] => EXPECT PERMISSIONS ISSUES ON THE MERGED PATHS
[18:26:31 g.i/h/rechunk:v1.0.1] => The following files from /usr/etc will be merged to /etc:
[18:26:31 g.i/h/rechunk:v1.0.1] => ./usr/etc
[18:26:31 g.i/h/rechunk:v1.0.1] => `-- pki
[18:26:31 g.i/h/rechunk:v1.0.1] =>     `-- containers
[18:26:31 g.i/h/rechunk:v1.0.1] =>         `-- gidro-os.pub
[18:26:31 g.i/h/rechunk:v1.0.1] => 
[18:26:31 g.i/h/rechunk:v1.0.1] => 3 directories, 1 file
```

Only thing remaining is to see if copying .pub keys to `/etc/` only will work, as it caused issues before. That would get rid of all files in `/usr/etc/`.

https://github.com/blue-build/cli/blob/a8cac2adc90fa842e4565bc1825e588df4f5bcbd/template/templates/Containerfile.j2#L26
@fiftydinar fiftydinar requested a review from xynydev as a code owner December 7, 2024 20:16
fiftydinar added a commit to fiftydinar/cli that referenced this pull request Dec 7, 2024
xynydev
xynydev previously approved these changes Dec 8, 2024
gmpinder
gmpinder previously approved these changes Dec 8, 2024
@fiftydinar fiftydinar dismissed stale reviews from gmpinder and xynydev via be33047 December 8, 2024 21:52
@fiftydinar fiftydinar merged commit 40cfcc6 into main Dec 8, 2024
5 checks passed
@fiftydinar fiftydinar deleted the signing-switch-fully-to-etc branch December 8, 2024 21:53
gmpinder pushed a commit to blue-build/cli that referenced this pull request Dec 8, 2024
Supplements main PR: blue-build/modules#375

Tests & it works, can be merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore(signing): Copy policy.json to /etc/containers/ on Universal Blue based images
3 participants