Skip to content

Commit

Permalink
add Image to MetalMachineSpec (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
defo89 authored Aug 14, 2024
1 parent d23225f commit 198bf0c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/metalmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ type MetalMachineSpec struct {
// +optional
ProviderID *string `json:"providerID,omitempty"`

// Image specifies the boot image to be used for the server.
Image string `json:"image"`

// ServerSelector specifies matching criteria for labels on Servers.
// This is used to claim specific Server types for a MetalMachine.
// +optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spec:
spec:
description: MetalMachineSpec defines the desired state of MetalMachine
properties:
image:
description: Image specifies the boot image to be used for the server.
type: string
providerID:
description: ProviderID is the unique identifier as specified by the
cloud provider.
Expand All @@ -55,6 +58,8 @@ spec:
Server
type: object
type: object
required:
- image
type: object
status:
description: MetalMachineStatus defines the observed state of MetalMachine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ spec:
spec:
description: MetalMachineSpec defines the desired state of MetalMachine
properties:
image:
description: Image specifies the boot image to be used for
the server.
type: string
providerID:
description: ProviderID is the unique identifier as specified
by the cloud provider.
Expand All @@ -87,6 +91,8 @@ spec:
on a chosen Server
type: object
type: object
required:
- image
type: object
required:
- spec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ spec:
serverSelector:
matchLabels:
server: metal
image: ghcr.io/ironcore-dev/os-images/gardenlinux:1443.3
3 changes: 1 addition & 2 deletions internal/controller/metalmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ func (r *MetalMachineReconciler) applyServerClaim(ctx context.Context, log *logr
IgnitionSecretRef: &corev1.LocalObjectReference{
Name: ignitionsecret.Name,
},
// TODO: Allow configuring os-image.
Image: "ghcr.io/ironcore-dev/os-images/gardenlinux:1443.3",
Image: metalmachine.Spec.Image,
},
}

Expand Down

0 comments on commit 198bf0c

Please sign in to comment.