Merged
Conversation
Rename BaseLLB to slowly reflect better the purpose of the function. Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Refactor the ToPack function to improve the readability and remove complicated logic with complex nested if statements> Instead move some of the logic in helper functions to assist with performing all the necessary steps. In particular create the following functions: - handleKernel: Which is repsonsible to handle the kernel entry in bunnyfile - handleRootfs: Which is repsonsible to handle the rootfs entry in bunnyfile - makeCopy: which creates a new copy struct with the necessary information for a file copy from another state - SetBaseAndGetPaths: Chooses the base of the final image based on the rootfs and kernel entries and returns the respective kernel and rootfs paths inside that base image. - SetAnnotations: Sets up the necessary annotations in the PackInstructions struct. Furthermore, create a new struct PackEntry, which maintains the necessary information for a processed bunnyfile entry (i.e. rootfs, kernel) Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Adjust the unit tests according to the changes that have been made in ToPack during the refactoring. Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Add new unit tests for the new functions after the refactor and update the previous unit tests for ToPack Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
cc78c10 to
16c87fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refactor the main function that handles the transformation of bunnyfile to the necessary instructions for the creation of the final image through LLB.