Open AleksandarSavchev opened 5 days ago
What would you like to be added: Currently there are places for improving the Validation() method of the Option interface in the pkg/shared/ruleset/disak8sstig/option package https://github.com/gardener/diki/blob/db51f2847096aa32a15dfcdbbf4b75641636ea99/pkg/shared/ruleset/disak8sstig/option/options.go#L15-L19
Validation()
Option
pkg/shared/ruleset/disak8sstig/option
Most implementations of Option add field.Path to the errors returned from Validate(). ex: https://github.com/gardener/diki/blob/db51f2847096aa32a15dfcdbbf4b75641636ea99/pkg/shared/ruleset/disak8sstig/option/options.go#L116-L120 We should allow field.Path to be passed to the Validate() method to have a better description of which options are not valid.
field.Path
Validate()
Currently Validate() returns field.ErrorList. We should look into weather it is better to return an error which contains all other errors merged with errors.Join()
field.ErrorList
error
errors.Join()
Why is this needed: Enhance user options validation experience.
What would you like to be added: Currently there are places for improving the
Validation()
method of theOption
interface in thepkg/shared/ruleset/disak8sstig/option
package https://github.com/gardener/diki/blob/db51f2847096aa32a15dfcdbbf4b75641636ea99/pkg/shared/ruleset/disak8sstig/option/options.go#L15-L19Most implementations of
Option
addfield.Path
to the errors returned fromValidate()
. ex: https://github.com/gardener/diki/blob/db51f2847096aa32a15dfcdbbf4b75641636ea99/pkg/shared/ruleset/disak8sstig/option/options.go#L116-L120 We should allowfield.Path
to be passed to theValidate()
method to have a better description of which options are not valid.Currently
Validate()
returnsfield.ErrorList
. We should look into weather it is better to return anerror
which contains all othererror
s merged witherrors.Join()
Why is this needed: Enhance user options validation experience.