[Proposal] Gateway Image Build: Version from build.yaml, Not CLI Flags
#875
Replies: 5 comments 2 replies
-
|
Related discussion: #516 Directory structure By default newly build images will prefixed with the parent dir name. i.e. |
Beta Was this translation helpful? Give feedback.
-
|
+1 to include gateway version to manifest yaml, otherwise giving base image version from cli is not very intuitive. policy-manifest.yaml —> gateway-manifest.yaml |
Beta Was this translation helpful? Give feedback.
-
|
We should not bind the version of the API Platform CLI to the gateway version. CLI is not only for the gateway but also it works with other platform components as well. Could you please explain the reasons behind this decision? |
Beta Was this translation helpful? Give feedback.
-
|
@nuwand, @malinthaprasan, @pubudu538 and @Krishanx92 agreed on changing the |
Beta Was this translation helpful? Give feedback.
-
|
The suggested build.yaml uses a gateway version without the "v" prefix, which is inconsistent with the policy versioning format. However, since this follows Docker versioning conventions, we will keep the structure as mentioned above. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
ap gateway image build(no morelatestdefault)policy-manifest.yaml→build.yaml(build now covers full gateway, not just policy engine)policy-manifest-lock.yaml→build-lock.yamlbuild.yamlonly (no CLI flag override)Sample new
build.yaml:Motivation
Problem Statement
The
ap gateway image buildcommand currently defaults tolatestwhen no version is specified, which creates several serious issues:Non-reproducible builds: Running the same command at different times can produce different gateway images, making debugging and rollbacks difficult.
CLI flag overrides break GitOps: Using
--versionor--builder-image/--controller-image/--router-imageCLI flags to specify versions bypasses version control. The actual version used in a build is not captured in the repository, making it impossible to reproduce builds or audit what was deployed. Different team members or CI jobs may use different flags, leading to inconsistent deployments.Version compatibility failures: The
apCLI and gateway have strict compatibility requirements (major versions must match), but the current default makes it easy to accidentally use incompatible versions.Detailed Design
Overview
The design consolidates gateway configuration into a single
build.yamlfile that explicitly declares the target gateway version. A correspondingbuild-lock.yamlcaptures resolved image references and policy checksums for reproducible builds. The CLI enforces version compatibility and provides clear feedback in both interactive and CI/CD environments.Changes Required
ap gateway image buildlatestdefault, requireversionfrombuild.yamlap gateway image build--skip-version-checkflag for compatibility bypassap gateway image build--out-controller,--out-router,--out-policy-engine)policy-manifest.yamlbuild.yamlwith new schemapolicy-manifest-lock.yamlbuild-lock.yamlwith new schemaConfiguration Changes
Why Rename
policy-manifest.yamltobuild.yaml?Previously, the
ap gateway image buildcommand only built the policy engine, hence the namepolicy-manifest.yamlmade sense. Now the command builds the entire gateway (controller, router, and policy engine), so renaming tobuild.yamlbetter reflects the broader scope.New
build.yamlSchemaThe
build.yamlfile replacespolicy-manifest.yamlwith an expanded schema that includes explicit gateway versioning:If
--out-*flags are not specified, output images are tagged with thegateway.versionvalue (e.g.,gateway-controller:1.0.4,gateway-router:1.0.4,gateway-policy-engine:1.0.4).New
build-lock.yamlSchemaThe lock file captures the fully resolved state for reproducible builds:
Version Source
The gateway configuration is read from
build.yamlonly. No CLI flags, no environment variables, no fallbacks.gateway.versiongateway.imagesIf
versionis missing, the build fails with exit code 3.build.yamlbuild-lock.yamlWhy no CLI override?
build.yamlalways builds the same versionCLI/Gateway Version Compatibility
The
apCLI enforces major version compatibility with the gateway:Exit Codes
The CLI uses meaningful exit codes for automation:
build.yamlBeta Was this translation helpful? Give feedback.
All reactions