mirror of
https://github.com/siderolabs/omni.git
synced 2026-05-05 14:46:12 +02:00
fix: properly map config patch requests in the infra provision ctrl
Some checks are pending
default / default (push) Waiting to run
default / e2e-backups (push) Blocked by required conditions
default / e2e-forced-removal (push) Blocked by required conditions
default / e2e-scaling (push) Blocked by required conditions
default / e2e-short (push) Blocked by required conditions
default / e2e-short-secureboot (push) Blocked by required conditions
default / e2e-templates (push) Blocked by required conditions
default / e2e-upgrades (push) Blocked by required conditions
default / e2e-workload-proxy (push) Blocked by required conditions
Some checks are pending
default / default (push) Waiting to run
default / e2e-backups (push) Blocked by required conditions
default / e2e-forced-removal (push) Blocked by required conditions
default / e2e-scaling (push) Blocked by required conditions
default / e2e-short (push) Blocked by required conditions
default / e2e-short-secureboot (push) Blocked by required conditions
default / e2e-templates (push) Blocked by required conditions
default / e2e-upgrades (push) Blocked by required conditions
default / e2e-workload-proxy (push) Blocked by required conditions
The bug was causing missing reconciliations. Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
This commit is contained in:
parent
fe075b04b2
commit
05ab993d3d
@ -106,16 +106,41 @@ func (ctrl *ProvisionController[T]) Settings() controller.QSettings {
|
||||
}
|
||||
|
||||
// MapInput implements controller.QController interface.
|
||||
func (ctrl *ProvisionController[T]) MapInput(_ context.Context, _ *zap.Logger,
|
||||
_ controller.QRuntime, ptr resource.Pointer,
|
||||
func (ctrl *ProvisionController[T]) MapInput(ctx context.Context, _ *zap.Logger,
|
||||
r controller.QRuntime, ptr resource.Pointer,
|
||||
) ([]resource.Pointer, error) {
|
||||
if ptr.Type() == siderolink.ConnectionParamsType {
|
||||
var t T
|
||||
|
||||
switch ptr.Type() {
|
||||
case siderolink.ConnectionParamsType:
|
||||
return nil, nil
|
||||
case infra.ConfigPatchRequestType:
|
||||
configPatchRequest, err := safe.ReaderGetByID[*infra.ConfigPatchRequest](ctx, r, ptr.ID())
|
||||
if err != nil {
|
||||
if state.IsNotFoundError(err) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return nil, err
|
||||
}
|
||||
|
||||
id, ok := configPatchRequest.Metadata().Labels().Get(omni.LabelMachineRequest)
|
||||
if !ok {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return []resource.Pointer{
|
||||
infra.NewMachineRequest(id).Metadata(),
|
||||
}, nil
|
||||
case infra.MachineRequestType,
|
||||
infra.MachineRequestStatusType,
|
||||
t.ResourceDefinition().Type:
|
||||
return []resource.Pointer{
|
||||
infra.NewMachineRequest(ptr.ID()).Metadata(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
return []resource.Pointer{
|
||||
infra.NewMachineRequest(ptr.ID()).Metadata(),
|
||||
}, nil
|
||||
return nil, fmt.Errorf("got unexpected type %s", ptr.Type())
|
||||
}
|
||||
|
||||
// Reconcile implements controller.QController interface.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user