Skip to content

Mehdi/flag parse os support#20

Draft
TxCorpi0x wants to merge 2 commits intomasterfrom
mehdi/flag-parse-os-support
Draft

Mehdi/flag parse os support#20
TxCorpi0x wants to merge 2 commits intomasterfrom
mehdi/flag-parse-os-support

Conversation

@TxCorpi0x
Copy link
Contributor

@TxCorpi0x TxCorpi0x commented Mar 11, 2026

Description

This pull request introduces enhancements to the build system, focusing on extensible flag handling, improved Docker image OS management, and utility functions for flag resolution. The most important changes are grouped below:

Flag Handling and Extensibility

  • Added the FlagRegistrar type and updated the Main function in build/build.go to allow callers to register custom flags and inject their values into the context before commands run. This enables more flexible and modular flag management for build commands. [1] [2]
  • Introduced build/flags.go with the ResolveFlag function, providing a standardized way to resolve flag values with precedence: CLI flag > environment variable > default. This utility is intended for use with the new flag registration mechanism.

Docker Image OS Management

  • Refactored Docker image handling in build/docker/docker.go by introducing the ImageOS type and methods. This replaces hardcoded image tags with a type-safe enum and a method to retrieve the full image reference, improving maintainability and clarity.

Reviewers checklist:

  • Try to write more meaningful comments with clear actions to be taken.
  • Nit-picking should be unblocking. Focus on core issues.

Authors checklist

  • Provide a concise and meaningful description
  • Review the code yourself first, before making the PR.
  • Annotate your PR in places that require explanation.
  • Think and try to split the PR to smaller PR if it is big.

This change is Reviewable

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.

1 participant