component-prerequisites

command
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

README

Component Prerequisites

This example demonstrates how to use component-level prerequisites with DependsOn to order components within a controller.

What it shows

  • Two components, one controller: The "infra" component manages a ConfigMap and reports InfraReady. The "app" component manages a Deployment and reports AppReady.
  • DependsOn prerequisite: The app component uses WithPrerequisite(component.DependsOn("InfraReady")) to block until the infra component's condition is True.
  • Permanent pass: Once a prerequisite is satisfied, it is never re-evaluated. Subsequent reconciles proceed without checking it again.
  • Sequential reconciliation: The controller reconciles infra first, then app. The owner's in-memory status is updated between the two calls, so DependsOn can read the first component's condition.

Reconciliation steps

  1. Full reconciliation: infra sets InfraReady=True, then app's prerequisite passes and it proceeds.
  2. Version upgrade: both components reconcile normally (prerequisite already passed).

Running

go run ./examples/component-prerequisites/.

Documentation

Overview

Package main demonstrates component-level prerequisites with DependsOn.

Two components share one owner. The "infra" component manages a ConfigMap and reports InfraReady. The "app" component manages a Deployment and uses DependsOn("InfraReady") to wait for the infra component before proceeding.

Directories

Path Synopsis
Package app provides a sample controller demonstrating component-level prerequisites.
Package app provides a sample controller demonstrating component-level prerequisites.
Package resources provides resource factories for the component-prerequisites example.
Package resources provides resource factories for the component-prerequisites example.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL