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

managers/apk: Support packages.repositories[].key #905

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

nbuwe
Copy link
Contributor

@nbuwe nbuwe commented Feb 28, 2025

Not sure it it would have been better off as a feature request issue. Since I have a proposed patch, a draft PR seemed more expedient. Easy to file an issue retroactively if the procedure requires one.

This patch makes apk manager write packages.repositories[].key to /etc/apk/keys/$name if name is set.

Silently ignore entries that don't set both the name and the key so that existing configs that (ab)use (previously ignored) name as a comment don't break suddenly.

url and name+key are handled independently of each other, so you can combine them or keep them separate (one key for several repos) as necessary.

This allows for stuff like:

packages:
  manager: apk
  repositories:
    # custom repo and its key
    - url: https://localhost:8088/packages/user
      name: user-badc0ffe.rsa.pub
      key: |-
        -----BEGIN PUBLIC KEY-----
        ...

    # ci keys (common, fixed)
    - name: [email protected]
      variants: [musl]
      key: |-
        -----BEGIN PUBLIC KEY-----
        ...

    - name: [email protected]
      variants: [glibc]
      key: |-
        -----BEGIN PUBLIC KEY-----
        ...

    # ci ephemeral repo(s) for some MR(s)
    - url: https://ci/{{image.variant}}/mergerequests/MR-37/testing
    - url: https://ci/{{image.variant}}/mergerequests/MR-42/testing

Write key to /etc/apk/keys/$name if name is set.

Silently ignore entries that don't set both the name and the key so
that existing configs that (ab)use (previously ignored) name as a
comment don't break suddenly.

Signed-off-by: Valery Ushakov <[email protected]>
@stgraber stgraber marked this pull request as ready for review March 10, 2025 04:02
@stgraber stgraber merged commit 6f83902 into lxc:main Mar 10, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants