Skip to content

Builder publish handshake

A build is accepted on what the builder reports, so the shape of that report is agreed before the build starts. The handshake declares which builder is being used, what it must return, and what it may return. A report that does not match is refused rather than partially recorded.

The handshake is resolved first

flowchart LR
  subgraph CP["CONTROL PLANE"]
    direction TB
    subgraph HS["HANDSHAKE, resolved before the build"]
      direction TB
      H1["builder type, runtime,<br/>execution class"]
      H2["required fields"]
      H3["optional fields"]
    end
    V{{"Result validation"}}
    HS -->|"what was asked for"| V
  end
  subgraph YI["YOUR INFRASTRUCTURE"]
    direction TB
    B["Builder"]
    R[("Build result")]
    B --> R
  end
  HS -->|"on the assignment"| B
  R -->|"reported"| V

The validator has two inputs, and one of them was fixed before the build began. A result is compared with the handshake box, so a result missing a required field is refused rather than partially recorded.

Declaring the required fields up front gives the validation something to check against: the control plane compares the result with what it asked for, rather than with whatever the result happens to contain.

What a Kaniko build must return

required    image_ref, image_digest
optional    sbom_ref, executor_metadata, composition_result

The digest is required because it is what gets pinned. An image reference without a digest names a moving target, and the control plane does not pin one.

The four refusals

Reason Condition
builder_type_unsupported The builder named is not a supported type
builder_runtime_mismatch The builder's runtime does not match the executor's declared runtime mode
builder_execution_class_unsupported The execution class is not one the builder provides
builder_required_fields_undeclared The handshake did not declare the fields the builder type requires

The last is a refusal against the handshake itself rather than against the build. A handshake that omits what its builder type must return is rejected before a build is dispatched, so a result can always be validated when it arrives.

Two contract versions

The handshake and the result have separate versions:

build.builder_publish_handshake.v1   what was agreed before the build
build.builder_publish_result.v1      what the builder returned

Versioning them apart lets a result be validated against the agreement it was made under, rather than against whatever the current agreement shape is.

Why the control plane trusts the report

The node performs the push, so the digest exists on your side of the boundary before the control plane hears about it. What makes the report trustworthy is that it is checked: against the handshake's declared shape, against the publish contract's requirement that a digest be present, and against the assignment's ownership and fence. An accepted report is then pinned, and the pin is what every later reference resolves through.

See Publish and pull contracts for the publish rules, and The assignment ledger for the fence a report is written under.