Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/agents/aib-expert.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Development-focused command for non-bootc builds:
aib-dev build [OPTIONS] <manifest.aib.yml> <output-file>

# Examples
aib-dev build --distro cs9 --format qcow2 manifest.aib.yml disk.qcow2
aib-dev build --distro autosd --format qcow2 manifest.aib.yml disk.qcow2
aib-dev build --distro autosd --format raw --mode package manifest.aib.yml disk.raw
```

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
kind create cluster --name automotive-dev-e2e --wait 5m
kubectl cluster-info
kubectl get nodes
# Label node for OperatorConfig nodeSelector
kubectl label nodes --all aib=true

- name: Install Tekton Pipelines
run: |
Expand Down
47 changes: 46 additions & 1 deletion api/v1alpha1/imagebuild_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ type ImageBuildSpec struct {

// Export contains configuration for exporting build artifacts
Export *ExportSpec `json:"export,omitempty"`

// Flash contains configuration for flashing the built image to hardware via Jumpstarter
Flash *FlashSpec `json:"flash,omitempty"`
}

// FlashSpec defines configuration for flashing images to hardware via Jumpstarter
// The exporter selector and flash command are derived from OperatorConfig's JumpstarterTargetMappings
// based on the AIB target field
type FlashSpec struct {
// ClientConfigSecretRef is the name of the secret containing the Jumpstarter client config
// The secret should have a key "client.yaml" with the config contents
// If set, flash is enabled automatically
ClientConfigSecretRef string `json:"clientConfigSecretRef,omitempty"`

// LeaseDuration is the duration for the device lease in HH:MM:SS format
// +kubebuilder:default="03:00:00"
LeaseDuration string `json:"leaseDuration,omitempty"`
}

// AIBSpec defines the automotive-image-builder configuration
Expand Down Expand Up @@ -125,7 +142,7 @@ type ImageBuildStatus struct {
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// Phase represents the current phase of the build (Building, Completed, Failed)
// +kubebuilder:validation:Enum=Pending;Uploading;Building;Pushing;Completed;Failed
// +kubebuilder:validation:Enum=Pending;Uploading;Building;Pushing;Flashing;Completed;Failed
Phase string `json:"phase,omitempty"`

// StartTime is when the build started
Expand All @@ -146,6 +163,9 @@ type ImageBuildStatus struct {
// PushTaskRunName is the name of the TaskRun for pushing artifacts to registry
PushTaskRunName string `json:"pushTaskRunName,omitempty"`

// FlashTaskRunName is the name of the TaskRun for flashing to hardware
FlashTaskRunName string `json:"flashTaskRunName,omitempty"`

// Conditions represent the latest available observations of the ImageBuild's state
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
Expand All @@ -160,6 +180,10 @@ type ImageBuildStatus struct {
// This is particularly useful for bootc builds where the builder may be auto-generated
// +optional
BuilderImageUsed string `json:"builderImageUsed,omitempty"`

// LeaseID is the Jumpstarter lease ID acquired during flash
// +optional
LeaseID string `json:"leaseId,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down Expand Up @@ -333,3 +357,24 @@ func (s *ImageBuildSpec) GetLegacyExportURL() string {
// Return empty string to force an error that guides them to update
return ""
}

// IsFlashEnabled returns true if flash is configured
func (s *ImageBuildSpec) IsFlashEnabled() bool {
return s.Flash != nil && s.Flash.ClientConfigSecretRef != ""
}

// GetFlashClientConfigSecretRef returns the flash client config secret reference
func (s *ImageBuildSpec) GetFlashClientConfigSecretRef() string {
if s.Flash != nil {
return s.Flash.ClientConfigSecretRef
}
return ""
}

// GetFlashLeaseDuration returns the flash lease duration, or default
func (s *ImageBuildSpec) GetFlashLeaseDuration() string {
if s.Flash != nil && s.Flash.LeaseDuration != "" {
return s.Flash.LeaseDuration
}
return "03:00:00"
}
16 changes: 16 additions & 0 deletions api/v1alpha1/operatorconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,29 @@ type JumpstarterTargetMapping struct {
FlashCmd string `json:"flashCmd,omitempty"`
}

// DefaultJumpstarterImage is the default container image for Jumpstarter CLI operations
const DefaultJumpstarterImage = "quay.io/jumpstarter-dev/jumpstarter:latest"

// JumpstarterConfig defines configuration for Jumpstarter device flashing integration
type JumpstarterConfig struct {
// Image is the container image for Jumpstarter CLI operations
// +kubebuilder:default="quay.io/jumpstarter-dev/jumpstarter:latest"
// +optional
Image string `json:"image,omitempty"`

// TargetMappings maps build targets to Jumpstarter exporter configurations
// +optional
TargetMappings map[string]JumpstarterTargetMapping `json:"targetMappings,omitempty"`
}

// GetJumpstarterImage returns the Jumpstarter image to use, falling back to the default
func (c *JumpstarterConfig) GetJumpstarterImage() string {
if c != nil && c.Image != "" {
return c.Image
}
return DefaultJumpstarterImage
}

// BuildAPIConfig defines configuration for the Build API server
type BuildAPIConfig struct {
// MaxManifestSize is the maximum allowed manifest size in bytes
Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions bundle/manifests/automotive.sdv.cloud.redhat.com_imagebuilds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,22 @@ spec:
raw, qcow2, simg, or any AIB-supported format)
type: string
type: object
flash:
description: Flash contains configuration for flashing the built image
to hardware via Jumpstarter
properties:
clientConfigSecretRef:
description: |-
ClientConfigSecretRef is the name of the secret containing the Jumpstarter client config
The secret should have a key "client.yaml" with the config contents
If set, flash is enabled automatically
type: string
leaseDuration:
default: "03:00:00"
description: LeaseDuration is the duration for the device lease
in HH:MM:SS format
type: string
type: object
pushSecretRef:
description: |-
PushSecretRef is the name of the kubernetes.io/dockerconfigjson secret for pushing artifacts
Expand Down Expand Up @@ -218,6 +234,13 @@ spec:
- type
type: object
type: array
flashTaskRunName:
description: FlashTaskRunName is the name of the TaskRun for flashing
to hardware
type: string
leaseId:
description: LeaseID is the Jumpstarter lease ID acquired during flash
type: string
message:
description: Message provides more detail about the current phase
type: string
Expand All @@ -234,6 +257,7 @@ spec:
- Uploading
- Building
- Pushing
- Flashing
- Completed
- Failed
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ spec:
description: Jumpstarter defines configuration for Jumpstarter device
flashing integration
properties:
image:
default: quay.io/jumpstarter-dev/jumpstarter:latest
description: Image is the container image for Jumpstarter CLI
operations
type: string
targetMappings:
additionalProperties:
description: JumpstarterTargetMapping defines the Jumpstarter
Expand Down
Loading
Loading