@@ -20,19 +20,19 @@ import (
2020 "context"
2121
2222 "github.com/pkg/errors"
23- "github.com/sp-yduck/proxmox/pkg/service "
23+ "github.com/sp-yduck/proxmox-go/proxmox "
2424 corev1 "k8s.io/api/core/v1"
2525 "sigs.k8s.io/controller-runtime/pkg/client"
2626
2727 infrav1 "github.com/sp-yduck/cluster-api-provider-proxmox/api/v1beta1"
2828)
2929
3030type ProxmoxServices struct {
31- Compute * service .Service
31+ Compute * proxmox .Service
3232 Remote * SSHClient
3333}
3434
35- func newComputeService (ctx context.Context , serverRef infrav1.ServerRef , crClient client.Client ) (* service .Service , error ) {
35+ func newComputeService (ctx context.Context , serverRef infrav1.ServerRef , crClient client.Client ) (* proxmox .Service , error ) {
3636 secretRef := serverRef .SecretRef
3737 if secretRef == nil {
3838 return nil , errors .New ("failed to get proxmox client form nil secretRef" )
@@ -52,8 +52,12 @@ func newComputeService(ctx context.Context, serverRef infrav1.ServerRef, crClien
5252 if ! ok {
5353 return nil , errors .Errorf ("failed to fetch PROXMOX_PASSWORD from Secret : %v" , key )
5454 }
55+ authConfig := proxmox.AuthConfig {
56+ Username : string (proxmoxUser ),
57+ Password : string (proxmoxPassword ),
58+ }
5559
56- return service . NewServiceWithLogin (serverRef .Endpoint , string ( proxmoxUser ), string ( proxmoxPassword ) )
60+ return proxmox . NewService (serverRef .Endpoint , authConfig , true )
5761}
5862
5963func newRemoteClient (ctx context.Context , secretRef * infrav1.ObjectReference , crClient client.Client ) (* SSHClient , error ) {
0 commit comments