Skip to content

Consolidate feature flags into a single registry#854

Open
mzihlmann wants to merge 2 commits into
mainfrom
mz852-feature-flag-table
Open

Consolidate feature flags into a single registry#854
mzihlmann wants to merge 2 commits into
mainfrom
mz852-feature-flag-table

Conversation

@mzihlmann

Copy link
Copy Markdown
Collaborator

Fixes #852

The two flags in #852 declared their default at each read site, so the same flag could be read with conflicting defaults, which is what caused the panic and the self-contradictory deprecation warning. Rather than patch the individual call sites, this moves every FF_KANIKO_* flag into a single registry in pkg/config. The environment is read once at startup into a FeatureFlags struct and call sites just read config.FF.X, so a flag's default has exactly one source of truth and the whole class of drift becomes impossible. Startup now logs which flags are active, warns when a default-on flag is explicitly disabled, and warns when an unknown FF_KANIKO_* variable is set; a completeness check guarantees every struct field is wired to a flag so a new flag cannot be left uninitialised. The assertion helper moved into its own pkg/assert because the registry guard needs it and pkg/util already depends on pkg/config, so it could not live in util without an import cycle.

Supersedes #853, which patched the two call sites directly.

@mzihlmann mzihlmann requested review from 0hlov3, BobDu, babs and nejch June 29, 2026 16:30
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

@mzihlmann mzihlmann force-pushed the mz852-feature-flag-table branch from 6efb869 to a6c479c Compare June 29, 2026 20:29
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.

Metadata command after VOLUME + --cache still panics on executor.build.without-fs (incomplete fix for #793)

1 participant