make csi pit format --write-script
optional to fix CASMTRIAGE-7156
#409
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this commit could have been a one line change to remove the
MarkFlagRequired() directive, but in an effort to improve the quality
and confidence of our tooling, I opted to create a new test for this.
this involved creating a new type, WriteLiveCDFunc, which is accepted as
a parameter.
this is required to replace the real implementation with a mock in the
go tests. this is especially important in this function since it could
destructively format a disk, so if you accidently gave it some bad
parameters, there is a possibility it may format something unintended.
this also allows finer control over what portions of the function to
test.
in this case, I mererly test that the function does not require the
--write-script flag.
further tests could certainly be added, but as CSM is EOL, I am adding
best effort tests here without going overboard.
this flag was actually marked required prior to the refactor by @rustydb
in https://github.com/Cray-HPE/cray-site-init/pull/391/files#diff-560a2ff11144e84b5ea4611785932f2f29ed01f545fbf1b61c83de7b4a56c07eL82
it is likely that the poor layout of this project at that time prevented
it from being enforced. either way, it does not need to be a required
flag since we set a default that is used in almost all cases and having
it required deviates from the documenation and causes confusion.
Signed-off-by: Jacob Salmela [email protected]