File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
services/compute/instance Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package cloud
33import (
44 "context"
55
6+ "github.com/sp-yduck/proxmox-go/api"
67 "github.com/sp-yduck/proxmox-go/proxmox"
78 clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
89
@@ -69,6 +70,7 @@ type MachineSetter interface {
6970 SetInstanceStatus (v infrav1.InstanceStatus )
7071 SetNodeName (name string )
7172 SetVMID (vmid int )
73+ SetConfigStatus (config api.VirtualMachineConfig )
7274 // SetFailureMessage(v error)
7375 // SetFailureReason(v capierrors.MachineStatusError)
7476 // SetAnnotation(key, value string)
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import (
2020 "context"
2121
2222 "github.com/pkg/errors"
23+ "github.com/sp-yduck/proxmox-go/api"
2324 "github.com/sp-yduck/proxmox-go/proxmox"
2425 corev1 "k8s.io/api/core/v1"
2526 "k8s.io/apimachinery/pkg/types"
@@ -198,6 +199,10 @@ func (m *MachineScope) SetVMID(vmid int) {
198199 m .ProxmoxMachine .Spec .VMID = & vmid
199200}
200201
202+ func (m * MachineScope ) SetConfigStatus (config api.VirtualMachineConfig ) {
203+ m .ProxmoxMachine .Status .Config = config
204+ }
205+
201206func (m * MachineScope ) SetReady () {
202207 m .ProxmoxMachine .Status .Ready = true
203208}
Original file line number Diff line number Diff line change @@ -40,7 +40,12 @@ func (s *Service) Reconcile(ctx context.Context) error {
4040 s .scope .SetInstanceStatus (infrav1 .InstanceStatus (instance .VM .Status ))
4141 s .scope .SetNodeName (instance .Node )
4242 s .scope .SetVMID (instance .VM .VMID )
43- // s.scope.SetAddresses()
43+
44+ config , err := instance .GetConfig (ctx )
45+ if err != nil {
46+ return err
47+ }
48+ s .scope .SetConfigStatus (* config )
4449 return nil
4550}
4651
You can’t perform that action at this time.
0 commit comments