Develop #120

Merged
metal3d merged 8 commits from develop into master 2025-06-26 22:27:50 +00:00
Owner

This pull request introduces several updates to the katenary project, including enhancements to the Makefile, code refactoring for improved maintainability, and dependency updates. Key changes involve adding UPX compression to the build process, renaming fields for consistency, introducing utility functions, and updating dependencies. Below is a categorized summary of the most important changes:

Build Process Enhancements:

  • Added UPX compression to the build process in the Makefile, enabling binary size reduction for multiple target platforms. This includes the addition of the upx target and its integration into the dist target. (Makefile, [1] [2] [3]

Code Refactoring and Consistency:

  • Renamed the ApiVersion field to APIVersion in the HelmChart struct and updated all references to ensure consistency with Go naming conventions. (generator/chart.go, [1] [2]
  • Replaced manual environment copying with the maps.Copy utility for better readability and performance. (generator/chart.go, generator/chart.goL139-R141)
  • Changed calls to utils.GetContainerByName to use service.ContainerName instead of service.Name for more accurate container identification. (generator/chart.go, [1] [2]; generator/deployment.go, [3] [4] [5] [6]; generator/generator.go, [7] [8]

New Utility Functions:

  • Introduced fixContainerNames to ensure container names are unique and properly formatted, and integrated it into the project generation process. (generator/generator.go, generator/generator.goR421-R432)
  • Replaced strings.Split with strings.SplitSeq for improved string splitting in the fixPorts function. (generator/utils.go, generator/utils.goL56-R57)

Dependency Updates:

  • Updated dependencies in go.mod, including k8s.io/api, k8s.io/apimachinery, and sigs.k8s.io/yaml, to their latest versions for compatibility and security improvements. (go.mod, [1] [2]

Documentation Improvements:

  • Improved package-level documentation for clarity and consistency across multiple files, including generator/doc.go, parser/main.go, utils/doc.go, and others. (generator/doc.go, [1]; parser/main.go, [2]; utils/doc.go, [3]

These changes collectively enhance the project's functionality, maintainability, and performance while ensuring adherence to best practices.

This pull request introduces several updates to the `katenary` project, including enhancements to the Makefile, code refactoring for improved maintainability, and dependency updates. Key changes involve adding UPX compression to the build process, renaming fields for consistency, introducing utility functions, and updating dependencies. Below is a categorized summary of the most important changes: ### Build Process Enhancements: * Added UPX compression to the build process in the `Makefile`, enabling binary size reduction for multiple target platforms. This includes the addition of the `upx` target and its integration into the `dist` target. (`Makefile`, [[1]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R15-R16) [[2]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L98-R110) [[3]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R152-R158) ### Code Refactoring and Consistency: * Renamed the `ApiVersion` field to `APIVersion` in the `HelmChart` struct and updated all references to ensure consistency with Go naming conventions. (`generator/chart.go`, [[1]](diffhunk://#diff-eba92d4872680b46c7e6b3518bef21be0f724d0e0fb9c3f4eb4b1db5d87ba8ccL45-R47) [[2]](diffhunk://#diff-eba92d4872680b46c7e6b3518bef21be0f724d0e0fb9c3f4eb4b1db5d87ba8ccL59-R61) * Replaced manual environment copying with the `maps.Copy` utility for better readability and performance. (`generator/chart.go`, [generator/chart.goL139-R141](diffhunk://#diff-eba92d4872680b46c7e6b3518bef21be0f724d0e0fb9c3f4eb4b1db5d87ba8ccL139-R141)) * Changed calls to `utils.GetContainerByName` to use `service.ContainerName` instead of `service.Name` for more accurate container identification. (`generator/chart.go`, [[1]](diffhunk://#diff-eba92d4872680b46c7e6b3518bef21be0f724d0e0fb9c3f4eb4b1db5d87ba8ccL377-R377) [[2]](diffhunk://#diff-eba92d4872680b46c7e6b3518bef21be0f724d0e0fb9c3f4eb4b1db5d87ba8ccL388-L392); `generator/deployment.go`, [[3]](diffhunk://#diff-d980d24f8bd990a1d2918af6dd78c2fff5bf931de30e8a81d1c5f800e78e1402L134-R134) [[4]](diffhunk://#diff-d980d24f8bd990a1d2918af6dd78c2fff5bf931de30e8a81d1c5f800e78e1402L256-R257) [[5]](diffhunk://#diff-d980d24f8bd990a1d2918af6dd78c2fff5bf931de30e8a81d1c5f800e78e1402L411-R411) [[6]](diffhunk://#diff-d980d24f8bd990a1d2918af6dd78c2fff5bf931de30e8a81d1c5f800e78e1402L666-R666); `generator/generator.go`, [[7]](diffhunk://#diff-ebe0c9061541da82c4de858d4996649ee6d33bf4036cb96200cc3f3ae891a536L268-R270) [[8]](diffhunk://#diff-ebe0c9061541da82c4de858d4996649ee6d33bf4036cb96200cc3f3ae891a536L320-R322) ### New Utility Functions: * Introduced `fixContainerNames` to ensure container names are unique and properly formatted, and integrated it into the project generation process. (`generator/generator.go`, [generator/generator.goR421-R432](diffhunk://#diff-ebe0c9061541da82c4de858d4996649ee6d33bf4036cb96200cc3f3ae891a536R421-R432)) * Replaced `strings.Split` with `strings.SplitSeq` for improved string splitting in the `fixPorts` function. (`generator/utils.go`, [generator/utils.goL56-R57](diffhunk://#diff-8ee7e2f8cdb0c22b7c4b85fa1ca27819e947861fe39105601939ac055c51236cL56-R57)) ### Dependency Updates: * Updated dependencies in `go.mod`, including `k8s.io/api`, `k8s.io/apimachinery`, and `sigs.k8s.io/yaml`, to their latest versions for compatibility and security improvements. (`go.mod`, [[1]](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6L14-R16) [[2]](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6L47-R55) ### Documentation Improvements: * Improved package-level documentation for clarity and consistency across multiple files, including `generator/doc.go`, `parser/main.go`, `utils/doc.go`, and others. (`generator/doc.go`, [[1]](diffhunk://#diff-ba99e9ffad99caa8fc6c30f5e4f558f8f11ec15123cc1452f92e6ed97cf36398L2-R15); `parser/main.go`, [[2]](diffhunk://#diff-f2c3f67f5248dfd9d86627e311562801a1da4210266f82ea29b429e9cdbc4b73L1-R1); `utils/doc.go`, [[3]](diffhunk://#diff-d60331d289f4ffded786e9189a86468501ba11c60f87678fb445004e94f71114L1-R2) These changes collectively enhance the project's functionality, maintainability, and performance while ensuring adherence to best practices.
Sign in to join this conversation.
No description provided.