updates
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-14 09:28:30 +11:00
parent ffe0c01fd7
commit 7400e08c54
35 changed files with 731 additions and 357 deletions

View File

@@ -6,7 +6,6 @@ import (
"log"
"log/slog"
"net/url"
"os"
"path"
"strings"
@@ -30,6 +29,7 @@ type Vcenter struct {
type VcenterLogin struct {
Username string
Password string
Insecure bool
}
type VmProperties struct {
@@ -51,13 +51,6 @@ func New(logger *slog.Logger, creds *VcenterLogin) *Vcenter {
}
func (v *Vcenter) Login(vUrl string) error {
var insecure bool
// TODO - fix this
insecureString := os.Getenv("VCENTER_INSECURE")
//username := os.Getenv("VCENTER_USERNAME")
//password := os.Getenv("VCENTER_PASSWORD")
// Connect to vCenter
u, err := soap.ParseURL(vUrl)
if err != nil {
@@ -74,11 +67,7 @@ func (v *Vcenter) Login(vUrl string) error {
}
*/
if insecureString == "true" {
insecure = true
}
c, err := govmomi.NewClient(v.ctx, u, insecure)
c, err := govmomi.NewClient(v.ctx, u, v.credentials.Insecure)
if err != nil {
v.Logger.Error("Unable to connect to vCenter", "error", err)
return fmt.Errorf("unable to connect to vCenter : %s", err)