Skip to content

Conversation

@Conan-Kudo
Copy link
Contributor

@Conan-Kudo Conan-Kudo commented Dec 6, 2025

Incus is a community-maintained fork of LXD and largely works the same way as LXD, thus it's straightforward to support.

Summary by Sourcery

New Features:

  • Introduce Incus as a supported container backend, mirroring existing LXD behavior.

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 6, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds initial plumbing to support Incus containers alongside or similar to existing LXD support in container.fc, leveraging their close compatibility.

File-Level Changes

Change Details Files
Introduce or extend container orchestration logic to handle Incus as a supported backend analogous to LXD.
  • Add configuration or type branches to recognize Incus as a valid container backend
  • Reuse or adapt existing LXD handling paths so Incus instances follow the same lifecycle operations (create, start, stop, delete)
  • Ensure capability and feature checks treat Incus similarly to LXD where appropriate
container.fc

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist
Copy link

Summary of Changes

Hello @Conan-Kudo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates support for Incus, a community-maintained fork of LXD, into the SELinux policy. It achieves this by adding comprehensive SELinux rules that mirror existing LXD policies, ensuring that Incus executables, systemd units, data directories, runtime files, and logs are correctly labeled and managed within an SELinux-enforced environment. This change allows Incus to operate securely and seamlessly on systems with SELinux enabled.

Highlights

  • SELinux Policy for Incus Executables: Added SELinux contexts for Incus executables and related binaries, including /usr/s?bin/incus-.*, /usr/s?bin/incus, and /usr/libexec/incus/.*, assigning them the container_runtime_exec_t type.
  • SELinux Policy for Incus Systemd Units: Introduced an SELinux context for Incus systemd unit files, specifically /usr/lib/systemd/system/incus.*, labeling them as container_unit_file_t.
  • SELinux Policy for Incus Data and Cache Directories: Configured SELinux contexts for Incus's primary data and cache directories, /var/lib/incus(/.*)? and /var/cache/incus(/.*)?, assigning them the container_var_lib_t type.
  • SELinux Policy for Incus Runtime and Log Files: Established SELinux contexts for Incus runtime files, sockets, and logs, including /run/incus/unix.socket(.*)?, /run/incus(/.*)? (as container_var_run_t), and /var/log/incus(/.*)? (as container_log_t).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for Incus by defining the necessary SELinux file contexts. The changes are functionally correct, mirroring the existing setup for LXD. However, I've identified several opportunities to improve code style and maintainability by enforcing consistent alphabetical sorting and alignment of entries. I've provided specific suggestions to address these minor issues.

container.fc Outdated
/usr/s?bin/incus-.* -- gen_context(system_u:object_r:container_runtime_exec_t,s0)
/usr/s?bin/lxc-.* -- gen_context(system_u:object_r:container_runtime_exec_t,s0)
/usr/s?bin/lxd-.* -- gen_context(system_u:object_r:container_runtime_exec_t,s0)
/usr/s?bin/incus -- gen_context(system_u:object_r:container_runtime_exec_t,s0)

Choose a reason for hiding this comment

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

medium

The alignment is inconsistent with the surrounding lines. Using an extra tab will align the -- separator with the other entries, improving readability and maintainability.

/usr/s?bin/incus			--	gen_context(system_u:object_r:container_runtime_exec_t,s0)

Comment on lines 58 to 62
/usr/lib/systemd/system/docker.* -- gen_context(system_u:object_r:container_unit_file_t,s0)
/usr/lib/systemd/system/incus.* -- gen_context(system_u:object_r:container_unit_file_t,s0)
/usr/lib/systemd/system/lxd.* -- gen_context(system_u:object_r:container_unit_file_t,s0)
/usr/lib/systemd/system/containerd.* -- gen_context(system_u:object_r:container_unit_file_t,s0)
/usr/lib/systemd/system/buildkit.* -- gen_context(system_u:object_r:container_unit_file_t,s0)

Choose a reason for hiding this comment

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

medium

For better maintainability, it's good practice to keep these entries sorted alphabetically. Also, the tab alignment for the new incus entry is inconsistent with the rest of the block. I've suggested a change to fix both.

/usr/lib/systemd/system/buildkit.*\t\t--\tgen_context(system_u:object_r:container_unit_file_t,s0)\n/usr/lib/systemd/system/containerd.*\t\t--\tgen_context(system_u:object_r:container_unit_file_t,s0)\n/usr/lib/systemd/system/docker.*\t\t--\tgen_context(system_u:object_r:container_unit_file_t,s0)\n/usr/lib/systemd/system/incus.*\t\t--\tgen_context(system_u:object_r:container_unit_file_t,s0)\n/usr/lib/systemd/system/lxd.*\t\t--\tgen_context(system_u:object_r:container_unit_file_t,s0)

Comment on lines 72 to 76
/var/lib/registry(/.*)? gen_context(system_u:object_r:container_var_lib_t,s0)
/var/lib/incus(/.*)? gen_context(system_u:object_r:container_var_lib_t,s0)
/var/lib/lxc(/.*)? gen_context(system_u:object_r:container_var_lib_t,s0)
/var/lib/lxd(/.*)? gen_context(system_u:object_r:container_var_lib_t,s0)
/var/lib/docker(/.*)? gen_context(system_u:object_r:container_var_lib_t,s0)

Choose a reason for hiding this comment

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

medium

For better maintainability, it's good practice to keep these entries sorted alphabetically.

/var/lib/docker(/.*)?\tgen_context(system_u:object_r:container_var_lib_t,s0)\n/var/lib/incus(/.*)?\tgen_context(system_u:object_r:container_var_lib_t,s0)\n/var/lib/lxc(/.*)?\tgen_context(system_u:object_r:container_var_lib_t,s0)\n/var/lib/lxd(/.*)?\tgen_context(system_u:object_r:container_var_lib_t,s0)\n/var/lib/registry(/.*)?\tgen_context(system_u:object_r:container_var_lib_t,s0)

Comment on lines 178 to 182
/var/log/kube-apiserver(/.*)? gen_context(system_u:object_r:container_log_t,s0)

/var/log/incus(/.*)? gen_context(system_u:object_r:container_log_t,s0)
/var/log/lxc(/.*)? gen_context(system_u:object_r:container_log_t,s0)
/var/log/lxd(/.*)? gen_context(system_u:object_r:container_log_t,s0)

Choose a reason for hiding this comment

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

medium

For better maintainability, it's good practice to keep these entries sorted alphabetically.

/var/log/incus(/.*)?\t\tgen_context(system_u:object_r:container_log_t,s0)\n/var/log/kube-apiserver(/.*)?\t\tgen_context(system_u:object_r:container_log_t,s0)\n/var/log/lxc(/.*)?\t\tgen_context(system_u:object_r:container_log_t,s0)\n/var/log/lxd(/.*)?\t\tgen_context(system_u:object_r:container_log_t,s0)

@lsm5
Copy link
Member

lsm5 commented Dec 10, 2025

/packit retest-failed

Copy link
Member

@lsm5 lsm5 left a comment

Choose a reason for hiding this comment

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

@openshift-ci
Copy link

openshift-ci bot commented Dec 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Conan-Kudo, lsm5, sourcery-ai[bot]

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

@packit-as-a-service
Copy link

Tests failed. @containers/packit-build please check.

Incus is a community-maintained fork of LXD and largely works the
same way as LXD, thus it's straightforward to support.

Signed-off-by: Neal Gompa <[email protected]>
@haircommander
Copy link
Collaborator

/lgtm

@lsm5 lsm5 merged commit cfb3281 into containers:main Dec 12, 2025
31 checks passed
@Conan-Kudo Conan-Kudo deleted the support-incus branch December 12, 2025 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants