Skip to content

osbuild: add force option to org.osbuild.groups and always enable [HMS-9825]#2146

Merged
supakeen merged 4 commits into
osbuild:mainfrom
achilleas-k:stages/groups/force
Jan 20, 2026
Merged

osbuild: add force option to org.osbuild.groups and always enable [HMS-9825]#2146
supakeen merged 4 commits into
osbuild:mainfrom
achilleas-k:stages/groups/force

Conversation

@achilleas-k

@achilleas-k achilleas-k commented Jan 19, 2026

Copy link
Copy Markdown
Member

The --force option of the groupadd command makes it possible to run with a group name or GID that already exists without failing. This is very useful for letting users define groups in their configs without worrying about the group existing in the base system or being created from a package, which isn't always predictable.

@achilleas-k

This comment was marked as outdated.

@achilleas-k

Copy link
Copy Markdown
Member Author

Cross-arch qemu based image build/boot smoke test will be fixed by #2145

func TestNewGroupsStageOptions(t *testing.T) {
type testCase struct {
groups []users.Group
expOptions *GroupsStageOptions

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I didn't initially parse this as meaning expected options :) I see we've used both expOptions and expectedOptions in various places so it might be nice to just use the long form.

@thozza
thozza force-pushed the stages/groups/force branch from ba4f47e to 2d14832 Compare January 19, 2026 18:20

@bcl bcl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good, I don't feel too strongly about the naming of expOptions :)

@achilleas-k

Copy link
Copy Markdown
Member Author

I don't feel too strongly about the naming of expOptions :)

hah, funny you should mention it, I felt it was a bit too lazy to call it that, paused for a second, thought I shouldn't spend much time thinking hard about a variable name in a tiny test, and moved on.

@thozza thozza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general, LGTM.

I've added a few comments. I think that the behavior of the --force option with two groups with the same GIDs is worth addressing, but could be in a follow up or as a documentation.

// groups in their configs without worrying about the group existing in
// the base system or being created from a package, which isn't
// predictable. Enable it unconditionally for all builds
Force: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nitpick: After reading the man page, it also When used with -g, and the specified GID already exists, another (unique) GID is chosen (i.e. -g is turned off).. This means that if a user specifies two different groups with the same GID in the BP, one of them will get a different GID and the build will pass. This behavior should be probably called out explicitly, or we should have an option validation to catch it and don't generate such manifest.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You're right. We can't control for conflicts between the blueprint and the packages/system, but we should make things more predictable by keeping the blueprint sane at least and error on duplicates, even though it would technically work. I think that wouldn't be surprising or unusual behaviour.

That might be more appropriate for validation in the blueprint itself though.

The note I added to the blueprint reference covers the GID behaviour too, though maybe that's not entirely clear either: https://github.com/osbuild/osbuild.github.io/pull/188/changes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK. Documentation and validation on the BP level sound good to me!

Comment thread data/dependencies/deps_test.go
This version introduced the 'force' option in org.osbuild.groups.
It's also the current latest release.
The --force option of the groupadd command makes it possible to run with
a group name or GID that already exists without failing.  This is very
useful for letting users define groups in their configs without worrying
about the group existing in the base system or being created from a
package, which isn't always predictable.
The wheel group is created by the setup package on all systems by
default.  Before our use of the force option, this would fail.  This new
config now tests that the build doesn't fail since we enable the force
option unconditionally.
@supakeen
supakeen added this pull request to the merge queue Jan 20, 2026
Merged via the queue into osbuild:main with commit 273037a Jan 20, 2026
25 checks passed
@achilleas-k
achilleas-k deleted the stages/groups/force branch January 21, 2026 10:18
@achilleas-k

Copy link
Copy Markdown
Member Author

Here we go: osbuild/blueprint#43

achilleas-k added a commit to osbuild/osbuild.github.io that referenced this pull request Feb 4, 2026
supakeen pushed a commit to osbuild/osbuild.github.io that referenced this pull request Feb 4, 2026
achilleas-k pushed a commit to achilleas-k/image-builder that referenced this pull request Jun 17, 2026
This bumps the osbuild/images to the version that uses depsolver V2
API.

Also bump the minimum required osbuild version and pin it in the
Schutzfile.

Changes with 0.235.0

----------------
  - Align the bootc distro package with the generic one (osbuild#2136)
    - Author: Achilleas Koutsou, Reviewers: Lukáš Zapletal, Tomáš Hozza
  - Ensure pinned osbuild version is used consistently in CI and build command. (HMS-10070) (osbuild#2145)
    - Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Simon de Vlieger
  - GHA: bump used golangci-lint version to 2.8 (HMS-10069) (osbuild#2144)
    - Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Lukáš Zapletal
  - Update osbuild dependency commit ID (osbuild#2141)
    - Author: SchutzBot, Reviewers: Achilleas Koutsou, Tomáš Hozza
  - Use the correct libvirt pool instead of hardcoded default (osbuild#2147)
    - Author: Jakub Kadlčík, Reviewers: Achilleas Koutsou, Simon de Vlieger
  - boot-image: add make_check_host_config to boot-aws (osbuild#2143)
    - Author: Lukáš Zapletal, Reviewers: Simon de Vlieger, Tomáš Hozza
  - osbuild: add force option to org.osbuild.groups and always enable [HMS-9825] (osbuild#2146)
    - Author: Achilleas Koutsou, Reviewers: Brian C. Lane, Lukáš Zapletal, Tomáš Hozza

— Somewhere on the Internet, 2026-01-26

---

Changes with 0.236.0

----------------
  - Add V2 depsolver API support and make it the default (HMS-10029) (osbuild#2139)
    - Author: Tomáš Hozza, Reviewers: Lukáš Zapletal, Simon de Vlieger

— Somewhere on the Internet, 2026-01-26

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
achilleas-k pushed a commit to achilleas-k/image-builder that referenced this pull request Jun 17, 2026
This bumps the osbuild/images to the version that uses depsolver V2
API.

Also bump the minimum required osbuild version and pin it in the
Schutzfile.

Changes with 0.235.0

----------------
  - Align the bootc distro package with the generic one (osbuild#2136)
    - Author: Achilleas Koutsou, Reviewers: Lukáš Zapletal, Tomáš Hozza
  - Ensure pinned osbuild version is used consistently in CI and build command. (HMS-10070) (osbuild#2145)
    - Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Simon de Vlieger
  - GHA: bump used golangci-lint version to 2.8 (HMS-10069) (osbuild#2144)
    - Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Lukáš Zapletal
  - Update osbuild dependency commit ID (osbuild#2141)
    - Author: SchutzBot, Reviewers: Achilleas Koutsou, Tomáš Hozza
  - Use the correct libvirt pool instead of hardcoded default (osbuild#2147)
    - Author: Jakub Kadlčík, Reviewers: Achilleas Koutsou, Simon de Vlieger
  - boot-image: add make_check_host_config to boot-aws (osbuild#2143)
    - Author: Lukáš Zapletal, Reviewers: Simon de Vlieger, Tomáš Hozza
  - osbuild: add force option to org.osbuild.groups and always enable [HMS-9825] (osbuild#2146)
    - Author: Achilleas Koutsou, Reviewers: Brian C. Lane, Lukáš Zapletal, Tomáš Hozza

— Somewhere on the Internet, 2026-01-26

---

Changes with 0.236.0

----------------
  - Add V2 depsolver API support and make it the default (HMS-10029) (osbuild#2139)
    - Author: Tomáš Hozza, Reviewers: Lukáš Zapletal, Simon de Vlieger

— Somewhere on the Internet, 2026-01-26

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
achilleas-k pushed a commit to achilleas-k/image-builder that referenced this pull request Jun 18, 2026
This bumps the osbuild/images to the version that uses depsolver V2
API.

Also bump the minimum required osbuild version and pin it in the
Schutzfile.

Changes with 0.235.0

----------------
  - Align the bootc distro package with the generic one (osbuild#2136)
    - Author: Achilleas Koutsou, Reviewers: Lukáš Zapletal, Tomáš Hozza
  - Ensure pinned osbuild version is used consistently in CI and build command. (HMS-10070) (osbuild#2145)
    - Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Simon de Vlieger
  - GHA: bump used golangci-lint version to 2.8 (HMS-10069) (osbuild#2144)
    - Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Lukáš Zapletal
  - Update osbuild dependency commit ID (osbuild#2141)
    - Author: SchutzBot, Reviewers: Achilleas Koutsou, Tomáš Hozza
  - Use the correct libvirt pool instead of hardcoded default (osbuild#2147)
    - Author: Jakub Kadlčík, Reviewers: Achilleas Koutsou, Simon de Vlieger
  - boot-image: add make_check_host_config to boot-aws (osbuild#2143)
    - Author: Lukáš Zapletal, Reviewers: Simon de Vlieger, Tomáš Hozza
  - osbuild: add force option to org.osbuild.groups and always enable [HMS-9825] (osbuild#2146)
    - Author: Achilleas Koutsou, Reviewers: Brian C. Lane, Lukáš Zapletal, Tomáš Hozza

— Somewhere on the Internet, 2026-01-26

---

Changes with 0.236.0

----------------
  - Add V2 depsolver API support and make it the default (HMS-10029) (osbuild#2139)
    - Author: Tomáš Hozza, Reviewers: Lukáš Zapletal, Simon de Vlieger

— Somewhere on the Internet, 2026-01-26

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
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.

5 participants