Skip to content

Commit 27fe98f

Browse files
author
kp2099
authored
Merge pull request #387 from hashicorp/chore(deps)/switch-vnc-library
refactor(deps): switch vnc library to `tenthirtyam/go-vnc`
2 parents 3ece6db + 111aead commit 27fe98f

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

builder/vmware/common/step_vnc_boot_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/hashicorp/packer-plugin-sdk/multistep"
1515
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
1616
"github.com/hashicorp/packer-plugin-sdk/template/interpolate"
17-
"github.com/mitchellh/go-vnc"
17+
"github.com/tenthirtyam/go-vnc"
1818
)
1919

2020
// StepVNCBootCommand executes boot commands by sending keystrokes to the VM over VNC.

builder/vmware/common/step_vnc_connect.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
"github.com/hashicorp/packer-plugin-sdk/multistep"
1212
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
13-
"github.com/mitchellh/go-vnc"
13+
"github.com/tenthirtyam/go-vnc"
1414
)
1515

1616
// StepVNCConnect represents a step for establishing VNC connection to the virtual machine.
@@ -27,7 +27,7 @@ func (s *StepVNCConnect) Run(ctx context.Context, state multistep.StateBag) mult
2727
ui := state.Get("ui").(packersdk.Ui)
2828

2929
ui.Say("Connecting to VNC...")
30-
c, err := s.ConnectVNC(state)
30+
c, err := s.ConnectVNC(ctx, state)
3131
if err != nil {
3232
err = fmt.Errorf("error connecting to VNC: %s", err)
3333
state.Put("error", err)
@@ -40,7 +40,7 @@ func (s *StepVNCConnect) Run(ctx context.Context, state multistep.StateBag) mult
4040
}
4141

4242
// ConnectVNC establishes a direct VNC connection to the virtual machine.
43-
func (s *StepVNCConnect) ConnectVNC(state multistep.StateBag) (*vnc.ClientConn, error) {
43+
func (s *StepVNCConnect) ConnectVNC(ctx context.Context, state multistep.StateBag) (*vnc.ClientConn, error) {
4444
vncIp := state.Get("vnc_ip").(string)
4545
vncPort := state.Get("vnc_port").(int)
4646
vncPassword := state.Get("vnc_password")
@@ -57,7 +57,7 @@ func (s *StepVNCConnect) ConnectVNC(state multistep.StateBag) (*vnc.ClientConn,
5757
auth = []vnc.ClientAuth{&vnc.PasswordAuth{Password: vncPassword.(string)}}
5858
}
5959

60-
c, err := vnc.Client(nc, &vnc.ClientConfig{Auth: auth, Exclusive: true})
60+
c, err := vnc.ClientWithContext(ctx, nc, &vnc.ClientConfig{Auth: auth, Exclusive: true})
6161
if err != nil {
6262
err := fmt.Errorf("error handshaking with VNC: %s", err)
6363
state.Put("error", err)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ require (
77
github.com/hashicorp/go-version v1.7.0
88
github.com/hashicorp/hcl/v2 v2.24.0
99
github.com/hashicorp/packer-plugin-sdk v0.6.3
10-
github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed
1110
github.com/stretchr/testify v1.11.1
11+
github.com/tenthirtyam/go-vnc v1.0.0
1212
github.com/zclconf/go-cty v1.16.4
1313
golang.org/x/net v0.43.0
1414
golang.org/x/sys v0.35.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,6 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG
253253
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
254254
github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
255255
github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8=
256-
github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed h1:FI2NIv6fpef6BQl2u3IZX/Cj20tfypRF4yd+uaHOMtI=
257-
github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0=
258256
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
259257
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
260258
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
@@ -332,6 +330,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
332330
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
333331
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
334332
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
333+
github.com/tenthirtyam/go-vnc v1.0.0 h1:u0QZuuwPbrS4e5+3qlrTU9l9MdrH1blxt2Y49CxebgY=
334+
github.com/tenthirtyam/go-vnc v1.0.0/go.mod h1:uEdhZJMZGgrd0yVdF5N5CbWgsjKTYzaZfqcvuws8JKA=
335335
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
336336
github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0=
337337
github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ=

0 commit comments

Comments
 (0)