# Golden Image Building and Caching
#
# Hybrid pattern: defaults + makers + instances

let contracts_lib = import "./contracts.ncl" in
let defaults_lib = import "./defaults.ncl" in

{
  defaults = defaults_lib,

  # Maker functions (not exported)
  make_image_config | not_exported = fun overrides =>
    defaults_lib.GoldenImageConfig & overrides,

  make_build_job | not_exported = fun overrides =>
    defaults_lib.GoldenImageBuildJob & overrides,

  make_image_version | not_exported = fun overrides =>
    defaults_lib.GoldenImageVersion & overrides,

  make_image_cache | not_exported = fun overrides =>
    defaults_lib.GoldenImageCache & overrides,

  make_build_steps | not_exported = fun overrides =>
    defaults_lib.ImageBuildSteps & overrides,

  make_build_policy | not_exported = fun overrides =>
    defaults_lib.ImageBuildPolicy & overrides,

  make_registry | not_exported = fun overrides =>
    defaults_lib.GoldenImageRegistry & overrides,

  # Default instances
  DefaultGoldenImageConfig = defaults_lib.GoldenImageConfig,
  DefaultGoldenImageBuildJob = defaults_lib.GoldenImageBuildJob,
  DefaultGoldenImageVersion = defaults_lib.GoldenImageVersion,
  DefaultGoldenImageCache = defaults_lib.GoldenImageCache,
  DefaultImageBuildSteps = defaults_lib.ImageBuildSteps,
  DefaultImageBuildPolicy = defaults_lib.ImageBuildPolicy,
  DefaultGoldenImageRegistry = defaults_lib.GoldenImageRegistry,
}
