Merge pull request #13201 from chrisroberts/dependency-updates

Update vagrant-go dependencies
This commit is contained in:
Chris Roberts 2023-06-12 09:46:07 -07:00 committed by GitHub
commit 46cf185809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1036 additions and 448 deletions

View File

@ -84,6 +84,10 @@ clean:
test: # run tests
go test ./...
.PHONY: force-test
force-test: # run all tests (no cached results)
go test -count=1 ./...
.PHONY: format
format: # format go code
gofmt -s -w ./

211
go.mod
View File

@ -1,35 +1,35 @@
module github.com/hashicorp/vagrant
go 1.17
go 1.20
require (
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2
github.com/bmatcuk/doublestar v1.1.5
github.com/fatih/color v1.12.0
github.com/glebarez/sqlite v1.4.8
github.com/go-git/go-git/v5 v5.1.0
github.com/go-ozzo/ozzo-validation/v4 v4.2.1
github.com/gorilla/handlers v1.4.2
github.com/h2non/filetype v1.1.1
github.com/hashicorp/go-argmapper v0.2.3
github.com/hashicorp/go-getter v1.5.9
github.com/hashicorp/go-hclog v0.16.2
github.com/hashicorp/go-memdb v1.2.0
github.com/bmatcuk/doublestar v1.3.4
github.com/fatih/color v1.15.0
github.com/glebarez/sqlite v1.8.0
github.com/go-git/go-git/v5 v5.7.0
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
github.com/gorilla/handlers v1.5.1
github.com/h2non/filetype v1.1.3
github.com/hashicorp/go-argmapper v0.2.4
github.com/hashicorp/go-getter v1.7.1
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-memdb v1.3.4
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-plugin v1.3.0
github.com/hashicorp/go-retryablehttp v0.7.1
github.com/hashicorp/go-version v1.3.0
github.com/hashicorp/hcl/v2 v2.11.1
github.com/hashicorp/vagrant-plugin-sdk v0.0.0-20220928204555-798e860a8593
github.com/imdario/mergo v0.3.11
github.com/improbable-eng/grpc-web v0.13.0
github.com/hashicorp/go-plugin v1.4.10
github.com/hashicorp/go-retryablehttp v0.7.4
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/hcl/v2 v2.17.0
github.com/hashicorp/vagrant-plugin-sdk v0.0.0-20230304003807-c1e77438a1ef
github.com/imdario/mergo v0.3.16
github.com/improbable-eng/grpc-web v0.15.0
github.com/kr/text v0.2.0
github.com/mitchellh/cli v1.1.2
github.com/mitchellh/go-glint v0.0.0-20201015034436-f80573c636de
github.com/mitchellh/cli v1.1.5
github.com/mitchellh/go-glint v0.0.0-20210722152315-6515ceb4a127
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-testing-interface v1.14.1
github.com/mitchellh/go-wordwrap v1.0.1
github.com/mitchellh/mapstructure v1.3.3
github.com/mitchellh/mapstructure v1.5.0
github.com/mitchellh/protostructure v0.0.0-20200814180458-3cfccdb015ce
github.com/oklog/run v1.1.0
github.com/oklog/ulid v1.3.1
@ -37,118 +37,127 @@ require (
github.com/posener/complete v1.2.3
github.com/randall77/makefat v0.0.0-20210315173500-7ddd0e42c844
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/stretchr/testify v1.7.5
github.com/zclconf/go-cty v1.10.0
github.com/zclconf/go-cty-yaml v1.0.2
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab
golang.org/x/text v0.3.7
google.golang.org/genproto v0.0.0-20211116182654-e63d96a377c4
google.golang.org/grpc v1.42.0
google.golang.org/protobuf v1.28.0
gorm.io/datatypes v1.0.7
gorm.io/gorm v1.23.10
github.com/stretchr/testify v1.8.4
github.com/zclconf/go-cty v1.13.2
github.com/zclconf/go-cty-yaml v1.0.3
golang.org/x/sys v0.8.0
golang.org/x/text v0.9.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.30.0
gorm.io/datatypes v1.2.0
gorm.io/gorm v1.25.1
)
require (
cloud.google.com/go v0.97.0 // indirect
cloud.google.com/go/storage v1.18.2 // indirect
cloud.google.com/go v0.110.2 // indirect
cloud.google.com/go/compute v1.20.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.0 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
github.com/LK4D4/joincontext v0.0.0-20171026170139-1724345da6d5 // indirect
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/VividCortex/ewma v1.1.1 // indirect
github.com/adrg/xdg v0.2.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230528122434-6f98819771a1 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/aws/aws-sdk-go v1.42.5 // indirect
github.com/aws/aws-sdk-go v1.44.279 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/briandowns/spinner v1.11.1 // indirect
github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cheggaaa/pb/v3 v3.0.5 // indirect
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 // indirect
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 // indirect
github.com/containerd/console v1.0.1 // indirect
github.com/creack/pty v1.1.11 // indirect
github.com/briandowns/spinner v1.23.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cheggaaa/pb/v3 v3.1.2 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/creack/pty v1.1.18 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/envoyproxy/go-control-plane v0.10.1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.6.2 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/glebarez/go-sqlite v1.19.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.0.0 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/glebarez/go-sqlite v1.21.1 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/go-test/deep v1.0.7 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
github.com/gookit/color v1.3.1 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect
github.com/googleapis/gax-go/v2 v2.10.0 // indirect
github.com/gookit/color v1.5.3 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-immutable-radix v1.2.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lab47/vterm v0.0.0-20201001232628-a9dd795f94c2 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.7 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/lab47/vterm v0.0.0-20211107042118-80c3d2849f9c // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 // indirect
github.com/nicksnyder/go-i18n/v2 v2.2.0 // indirect
github.com/olekukonko/tablewriter v0.0.4 // indirect
github.com/nicksnyder/go-i18n/v2 v2.2.1 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/rs/cors v1.7.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/stretchr/objx v0.4.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rs/cors v1.9.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/skeema/knownhosts v1.1.1 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/tj/go-spin v1.1.0 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
github.com/y0ssar1an/q v1.0.7 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/api v0.60.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/y0ssar1an/q v1.0.10 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/tools v0.9.3 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.125.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/driver/mysql v1.3.2 // indirect
modernc.org/libc v1.19.0 // indirect
gorm.io/driver/mysql v1.5.1 // indirect
modernc.org/libc v1.24.1 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.4.0 // indirect
modernc.org/sqlite v1.19.1 // indirect
modernc.org/memory v1.6.0 // indirect
modernc.org/sqlite v1.23.0 // indirect
nhooyr.io/websocket v1.8.7 // indirect
)
//replace github.com/hashicorp/go-argmapper => ../go-argmapper
//replace github.com/hashicorp/vagrant-plugin-sdk => ../vagrant-plugin-sdk
replace (
// v0.3.11 panics for some reason on our tests
github.com/imdario/mergo => github.com/imdario/mergo v0.3.9
// https://github.com/ory/dockertest/issues/208
golang.org/x/sys => golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6
)

1216
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -379,7 +379,7 @@ func TestFileSet(t *testing.T) {
cty.StringVal("."),
cty.StringVal("\\"),
cty.SetValEmpty(cty.String),
true,
false,
},
{
cty.StringVal("testdata/filesystem"),

View File

@ -59,6 +59,8 @@ func TestMinimalProject(t testing.T) *Project {
}...,
)
require.NotEmpty(t, p.project.Path)
require.NoError(t, err)
require.NoError(t, p.Save())

View File

@ -89,6 +89,7 @@ func (p *Project) BeforeSave(tx *gorm.DB) error {
return err
}
}
if err := p.Validate(tx); err != nil {
return err
}
@ -358,8 +359,11 @@ func (s *State) ProjectPut(
return nil, lookupErrorToStatus("project", err)
}
// Make sure we don't have a nil value
if err != nil {
// If a project is found, remove the basis
// ref to prevent update attempts
if project != nil {
p.Basis = nil
} else {
project = &Project{}
}

View File

@ -394,8 +394,12 @@ func (s *State) TargetPut(
return nil, lookupErrorToStatus("target", err)
}
// Make sure we don't have a nil
if err != nil {
// If a target is found, remove the project
// ref to prevent update attempts
if target != nil {
t.Project = nil
} else {
// Otherwise, init target for the decode
target = &Target{}
}

View File

@ -14,6 +14,7 @@ import (
"github.com/imdario/mergo"
"github.com/mitchellh/go-testing-interface"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
"gorm.io/gorm"
"gorm.io/gorm/logger"
)
@ -165,25 +166,25 @@ func testRunnerProto(t testing.T, s *State, src *vagrant_server.Runner) *vagrant
func TestJobProto(t testing.T, src *vagrant_server.Job) *vagrant_server.Job {
t.Helper()
require.NoError(t, mergo.Merge(src,
&vagrant_server.Job{
TargetRunner: &vagrant_server.Ref_Runner{
Target: &vagrant_server.Ref_Runner_Any{
Any: &vagrant_server.Ref_RunnerAny{},
},
},
DataSource: &vagrant_server.Job_DataSource{
Source: &vagrant_server.Job_DataSource_Local{
Local: &vagrant_server.Job_Local{},
},
},
Operation: &vagrant_server.Job_Noop_{
Noop: &vagrant_server.Job_Noop{},
dst := &vagrant_server.Job{
TargetRunner: &vagrant_server.Ref_Runner{
Target: &vagrant_server.Ref_Runner_Any{
Any: &vagrant_server.Ref_RunnerAny{},
},
},
))
DataSource: &vagrant_server.Job_DataSource{
Source: &vagrant_server.Job_DataSource_Local{
Local: &vagrant_server.Job_Local{},
},
},
Operation: &vagrant_server.Job_Noop_{
Noop: &vagrant_server.Job_Noop{},
},
}
return src
proto.Merge(dst, src)
return dst
}
func TestTempDir(t testing.T) string {