Skip to content

Conversation

@ckyrouac
Copy link
Collaborator

Check for the policy csum to make sure there is actually a policy available to lookup when trying to label the bootc container storage.

Fixes #1303

Check for the policy csum to make sure there is actually a policy
available to lookup when trying to label the bootc container storage.

Fixes bootc-dev#1303

Signed-off-by: ckyrouac <[email protected]>
Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Thanks!

I do feel like this is a bug probably in the ostree sepolicy code. It'd feel better to just return None in this case probably?

But...mmm...I think I have a vague memory now that the reason it's this way is historical because I in C code it was convenient to just pass around a *OstreeSepolicy and not always check it for null or something?

Comment on lines +107 to +111
let sepolicy = if sepolicy.csum().is_none() {
None
} else {
Some(sepolicy)
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is also let sepolicy = sepolicy.filter(|policy| policy.csum.is_some()); too

@cgwalters cgwalters merged commit 5c1cb06 into bootc-dev:main May 15, 2025
27 of 30 checks passed
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.

No label found in policy 'None'

2 participants