Skip to content

Commit 69f2f19

Browse files
Merge branch 'master' into feature/error-on-persistent-change
2 parents 40f9100 + 467f3be commit 69f2f19

File tree

8 files changed

+100
-111
lines changed

8 files changed

+100
-111
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## [master](https://github.com/arangodb-helper/arangodb/tree/master) (N/A)
44
- Show error when user tries to change value of "persistent" option
5+
- Add sanity check for pass-through args usage
6+
- Fix printing --starter.instance-up-timeout instead of hardcoded value
7+
- Fix context handling in WaitUntilStarterReady for tests
58

69
## [0.15.8](https://github.com/arangodb-helper/arangodb/tree/0.15.8) (2023-06-02)
710
- Add passing ARANGODB_SERVER_DIR env variable when starting arangod instances

config.go

+20
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,23 @@ func loadFlagValuesFromConfig(cfgFilePath string, fs, persistentFs *pflag.FlagSe
124124
}
125125
}
126126
}
127+
128+
// sanityCheckPassThroughArgs will print a warning if user does not specify value for option,
129+
// example: --args.all.log.line-number --args.all.log.performance=true
130+
func sanityCheckPassThroughArgs(fs, persistentFs *pflag.FlagSet) {
131+
sanityCheck := func(flag *pflag.Flag) {
132+
if found, _, _ := passthroughPrefixes.Lookup(flag.Name); found != nil {
133+
if flag.Value == nil {
134+
return
135+
}
136+
if sliceVal, ok := flag.Value.(pflag.SliceValue); ok {
137+
slice := sliceVal.GetSlice()
138+
if len(slice) > 0 && strings.HasPrefix(slice[0], "--") {
139+
log.Warn().Msgf("Possible wrong usage of pass-through argument --%s: its value %s looks like separate argument.", flag.Name, slice[0])
140+
}
141+
}
142+
}
143+
}
144+
fs.Visit(sanityCheck)
145+
persistentFs.Visit(sanityCheck)
146+
}

go.mod

+17-17
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,56 @@ require (
1010
github.com/coreos/go-semver v0.3.0
1111
github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5
1212
github.com/fatih/color v1.9.0
13-
github.com/fsouza/go-dockerclient v1.8.3
13+
github.com/fsouza/go-dockerclient v1.9.7
1414
github.com/golang-jwt/jwt v3.2.2+incompatible
1515
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
1616
github.com/mitchellh/go-homedir v1.1.0
17-
github.com/opencontainers/runc v1.1.5
17+
github.com/opencontainers/runc v1.1.7
1818
github.com/pkg/errors v0.9.1
1919
github.com/rs/zerolog v1.19.0
2020
github.com/ryanuber/columnize v2.1.0+incompatible
2121
github.com/spf13/cobra v1.0.0
2222
github.com/spf13/pflag v1.0.5
23-
github.com/stretchr/testify v1.8.1
24-
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
23+
github.com/stretchr/testify v1.8.2
24+
golang.org/x/crypto v0.1.0
2525
gopkg.in/ini.v1 v1.66.6
2626
)
2727

2828
require (
29-
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
30-
github.com/Microsoft/go-winio v0.6.0 // indirect
29+
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
30+
github.com/Microsoft/go-winio v0.6.1 // indirect
3131
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect
32-
github.com/containerd/containerd v1.6.19 // indirect
32+
github.com/containerd/containerd v1.7.2 // indirect
3333
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
3434
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
3535
github.com/davecgh/go-spew v1.1.1 // indirect
36-
github.com/docker/docker v23.0.3+incompatible // indirect
36+
github.com/docker/docker v24.0.2+incompatible // indirect
3737
github.com/docker/go-connections v0.4.0 // indirect
3838
github.com/docker/go-units v0.5.0 // indirect
3939
github.com/godbus/dbus/v5 v5.1.0 // indirect
4040
github.com/gogo/protobuf v1.3.2 // indirect
41-
github.com/google/go-cmp v0.5.9 // indirect
4241
github.com/inconshreveable/mousetrap v1.0.0 // indirect
43-
github.com/klauspost/compress v1.16.0 // indirect
42+
github.com/klauspost/compress v1.16.6 // indirect
4443
github.com/kr/text v0.2.0 // indirect
4544
github.com/mattn/go-colorable v0.1.7 // indirect
4645
github.com/mattn/go-isatty v0.0.12 // indirect
4746
github.com/moby/patternmatcher v0.5.0 // indirect
4847
github.com/moby/sys/mountinfo v0.6.2 // indirect
4948
github.com/moby/sys/sequential v0.5.0 // indirect
50-
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
49+
github.com/moby/term v0.5.0 // indirect
5150
github.com/morikuni/aec v1.0.0 // indirect
5251
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
5352
github.com/opencontainers/go-digest v1.0.0 // indirect
54-
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
53+
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
5554
github.com/opencontainers/runtime-spec v1.1.0-rc.1 // indirect
5655
github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible // indirect
5756
github.com/pmezard/go-difflib v1.0.0 // indirect
58-
github.com/sirupsen/logrus v1.9.0 // indirect
59-
golang.org/x/mod v0.8.0 // indirect
60-
golang.org/x/sys v0.5.0 // indirect
61-
golang.org/x/term v0.5.0 // indirect
62-
golang.org/x/tools v0.6.0 // indirect
57+
github.com/sirupsen/logrus v1.9.3 // indirect
58+
golang.org/x/mod v0.11.0 // indirect
59+
golang.org/x/sys v0.9.0 // indirect
60+
golang.org/x/term v0.6.0 // indirect
61+
golang.org/x/tools v0.10.0 // indirect
6362
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
6463
gopkg.in/yaml.v3 v3.0.1 // indirect
64+
gotest.tools/v3 v3.4.0 // indirect
6565
)

0 commit comments

Comments
 (0)