Skip to content

Add subscription-manager fact generation - #977

Merged
cgwalters merged 6 commits into
bootc-dev:mainfrom
jeckersb:rhsm
Dec 19, 2024
Merged

cgwalters merged 6 commits into
bootc-dev:mainfrom
jeckersb:rhsm

Conversation

@jeckersb

Copy link
Copy Markdown
Collaborator

Resolves: #929

@jeckersb

Copy link
Copy Markdown
Collaborator Author

This is functional as-is, but could use an integration test and some amount of documentation. How much we put into the docs is up for debate, since this is currently (but could change if deemed necessary) a bootc internals command so not really something to be widely advertised.

@cgwalters cgwalters 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.

Nice! This all looks pretty good to me overall; some nits and some test requests but that's it. I'd be OK to merge mostly as is too and doing some things as followups.

Thanks for working on this!!

Comment thread lib/src/imgstorage.rs Resolved
Comment thread lib/src/imgstorage.rs Resolved
Comment thread lib/src/deploy.rs
println!("Next boot: rollback deployment");
}

sysroot.update_mtime()?;

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.

Unrelated to this particular changed line but I think we could test this in one of the integration tests pretty easily.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thinking about punting this to a followup. Unless I'm blind, it doesn't look like in integration we currently test any of upgrade/edit/switch/rollback so that's a whole other thing.

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.

We do in test-image-pushpull-upgrade.nu for example

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ah yeah I was just looking at the stuff under tests-integration

Comment thread lib/src/store/mod.rs Resolved
Comment thread lib/src/rhsm.rs Resolved
Comment thread lib/src/rhsm.rs Resolved
Comment thread lib/src/rhsm.rs Resolved
@jeckersb
jeckersb force-pushed the rhsm branch 2 times, most recently from db0a07a to e3107a5 Compare December 18, 2024 18:02
@jeckersb

Copy link
Copy Markdown
Collaborator Author

Last TODO before removing draft status is docs for the whole mtime -> .path -> .target -> .service flow

Comment thread lib/src/rhsm.rs Resolved
Comment thread lib/src/rhsm.rs Resolved
@cgwalters cgwalters added enhancement New feature or request area/client Related to the client/CLI labels Dec 18, 2024
jeckersb and others added 6 commits December 19, 2024 16:26
Also refactor imgstore to base its subpath to be relative to
BOOTC_ROOT.  This is prep for store::Storage to update the mtime on
BOOTC_ROOT.

Signed-off-by: John Eckersberg <[email protected]>
This updates the mtime after a successful invocation of
upgrade/switch/edit/rollback

Signed-off-by: John Eckersberg <[email protected]>
This adds a new systemd path unit which activates on bootc status
changing, and in turn triggers a new systemd target.  This allows
adding arbitrary new systemd services with `WantedBy =
bootc-status-updated.target` that will be activated each time the
bootc status is updated.

Signed-off-by: John Eckersberg <[email protected]>
This adds a new subcommand `bootc internals publish-rhsm-facts` which
writes out facts data to /etc/rhsm/facts/bootc.json

Signed-off-by: John Eckersberg <[email protected]>
When enabled, this triggers on bootc-status-updated.target to update
the facts file for Red Hat Subscription Manager integration via
`bootc internals publish-rhsm-facts`

Signed-off-by: John Eckersberg <[email protected]>
Signed-off-by: Colin Walters <[email protected]>
@jeckersb

Copy link
Copy Markdown
Collaborator Author

Last TODO before removing draft status is docs for the whole mtime -> .path -> .target -> .service flow

Added this, should be good to go now unless we want to hold to get the integration/tmt thing sorted out.

@jeckersb
jeckersb marked this pull request as ready for review December 19, 2024 22:11
Comment thread lib/Cargo.toml
install = []
# This featuares enables `bootc internals publish-rhsm-facts` to integrate with
# Red Hat Subscription Manager
rhsm = []

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.

OK as is, but we will also need to do a corresponding change to the Fedora spec file to turn it on (bcond that is default off in Fedora, on in RHEL?)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@cgwalters
cgwalters merged commit c88fcfd into bootc-dev:main Dec 19, 2024
cgwalters added a commit to cgwalters/bootc that referenced this pull request Jan 6, 2025
Followup to bootc-dev#977

In chatting with John we had some agreement to statically
enable the `.path` unit by default upstream here since
it's a feature we want to be available by default
so that tooling can react dynamically to changes.

Signed-off-by: Colin Walters <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/client Related to the client/CLI enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add optional subscription-manager fact generation

2 participants