Skip to content

Conversation

umohnani8
Copy link
Contributor

Add install time support for Image Mode by using a pre-built custom OS container image with the MachineOSConfig CR created at install time in the manifests directory.

Core Seeding Implementation for Pre-built Container Image:

  • Added annotation-driven seeding detection in addMachineOSConfig()
  • Implemented seedMachineOSConfigWithExistingImage() for complete seeding workflow
  • Added createSyntheticMachineOSBuild() to generate "successful" builds for pre-built images
  • Added updateMachineOSConfigForSeeding() to update status and annotations

Bootstrap Integration:

  • Added MachineOSConfig recognition in bootstrap processing
  • Implemented syncMachineOSConfigs() in operator for post-bootstrap processing
  • Creates /etc/mcs/bootstrap/machine-os-configs/ directory structure
  • Processes MachineOSConfig manifests during cluster startup

Constants and Configuration:

  • Added PreBuiltImageAnnotationKey constant for annotation-driven behavior
  • Added bootstrap integration constants and paths
  • Enhanced build controller with seeding detection logic

Testing Infrastructure:

  • Added comprehensive unit tests for seeding workflow
  • TestCreateSyntheticMachineOSBuild validates synthetic build creation
  • TestAddMachineOSConfigRouting tests annotation detection
  • TestAddMachineOSConfigSeeding tests seeding decision logic
  • Added bootstrap test validation with layered-worker example manifest

Key Features:

  • Maintains 100% backward compatibility with existing MachineOSConfig objects
  • Routes annotated configs to seeding workflow, non-annotated to normal OCL
  • Creates proper metadata, labels, and object references expected by MCO
  • Enables seamless integration with existing controller logic

Technical Details:

  • Uses PreBuiltImageAnnotationKey annotation to trigger seeding behavior
  • Validates image format (digest format @sha256: required)
  • Creates synthetic MachineOSBuild objects with success status
  • Updates MachineOSConfig status with CurrentImagePullSpec for MCD consumption
  • Uses PreBuiltImageLabelKey label to keep track of MOSB created by pre-built container image
  • Integrates with existing sync pipeline and bootstrap completion detection

- What I did

- How to verify it

- Description for the changelog

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 30, 2025
Copy link
Contributor

openshift-ci bot commented Sep 30, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

openshift-ci bot commented Sep 30, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: umohnani8

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 30, 2025
@umohnani8 umohnani8 force-pushed the reboots branch 9 times, most recently from bb4ef32 to a391d17 Compare October 2, 2025 17:18
Add install time support for Image Mode by using a pre-built custom OS
container image with the MachineOSConfig CR created at install time in
the manifests directory.

**Core Seeding Implementation for Pre-built Container Image:**
- Added annotation-driven seeding detection in addMachineOSConfig()
- Implemented seedMachineOSConfigWithExistingImage() for complete seeding workflow
- Added createSyntheticMachineOSBuild() to generate "successful" builds for pre-built images
- Added updateMachineOSConfigForSeeding() to update status and annotations

**Bootstrap Integration:**
- Added MachineOSConfig recognition in bootstrap processing
- Implemented syncMachineOSConfigs() in operator for post-bootstrap processing
- Creates /etc/mcs/bootstrap/machine-os-configs/ directory structure
- Processes MachineOSConfig manifests during cluster startup

**Constants and Configuration:**
- Added PreBuiltImageAnnotationKey constant for annotation-driven behavior
- Added bootstrap integration constants and paths
- Enhanced build controller with seeding detection logic

**Testing Infrastructure:**
- Added comprehensive unit tests for seeding workflow
- TestCreateSyntheticMachineOSBuild validates synthetic build creation
- TestAddMachineOSConfigRouting tests annotation detection
- TestAddMachineOSConfigSeeding tests seeding decision logic
- Added bootstrap test validation with layered-worker example manifest

**Key Features:**
- Maintains 100% backward compatibility with existing MachineOSConfig objects
- Routes annotated configs to seeding workflow, non-annotated to normal OCL
- Creates proper metadata, labels, and object references expected by MCO
- Enables seamless integration with existing controller logic

**Technical Details:**
- Uses PreBuiltImageAnnotationKey annotation to trigger seeding behavior
- Validates image format (digest format @sha256: required)
- Creates synthetic MachineOSBuild objects with success status
- Updates MachineOSConfig status with CurrentImagePullSpec for MCD consumption
- Uses PreBuiltImageLabelKey label to keep track of MOSB created by
  pre-built container image
- Integrates with existing sync pipeline and bootstrap completion detection

Signed-off-by: Urvashi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant