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

pkg/oscap: refactor & clean up #814

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

kingsleyzissou
Copy link
Contributor

The oscap tailoring and remediation configs were too tightly coupled with the osbuild stage implementations. These configs can be refactored further by making the TailoringConfig a pointer on the
RemediationConfig, reversing the dependency of the configs.

These changes should reduce the complexity of the OpenSCAP stage options and hopefully reduce some of the confusion too.

Thanks to @thozza for the suggestion

Add some basic unit tests for the creation of the OpenSCAP remediation &
tailoring configs.
The oscap tailoring and remediation configs were too tightly coupled
with the osbuild stage implementations. These configs can be refactored
further by making the `TailoringConfig` a pointer on the
`RemediationConfig`, reversing the dependency of the configs.

These changes should reduce the complexity of the OpenSCAP stage options
and hopefully reduce some of the confusion too.
Add some new test cases to make sure that the remediation stage options
are set correctly when tailoring options have been specified.
Copy link
Member

@thozza thozza left a comment

Choose a reason for hiding this comment

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

Nice refactoring. I think that this makes the code much easier to follow. Thanks!

@thozza thozza requested a review from mvo5 August 1, 2024 07:56
Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

Yes, this is much nicer.

@achilleas-k achilleas-k added this pull request to the merge queue Aug 1, 2024
@kingsleyzissou
Copy link
Contributor Author

Yes, this is much nicer.

Thanks, I guess I was too close to the code and @thozza made a great suggestion and helped me zoom out a bit and untangle this... so big thanks to him for that! 🙏

Merged via the queue into osbuild:main with commit 24cd028 Aug 1, 2024
18 checks passed
@kingsleyzissou kingsleyzissou deleted the oscap-clean-up branch August 1, 2024 12:31
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.

3 participants