Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Vault
Commits
9b80bd20
Commit
9b80bd20
authored
5 years ago
by
Jeff Mitchell
Browse files
Options
Download
Email Patches
Plain Diff
Sync some changes that weren't properly pulled over
parent
2f7cfc9a
Branches unavailable
v1.10.2
v1.10.1
v1.10.0
v1.10.0-rc1
v1.9.6
v1.9.5
v1.9.4
v1.9.3
v1.9.2
v1.9.1
v1.9.0
v1.9.0-rc1
v1.8.11
v1.8.10
v1.8.9
v1.8.8
v1.8.7
v1.8.6
v1.8.5
v1.8.4
v1.8.3
v1.8.2
v1.8.1
v1.8.0
v1.8.0-rc2
v1.8.0-rc1
v1.7.10
v1.7.9
v1.7.8
v1.7.7
v1.7.6
v1.7.5
v1.7.4
v1.7.3
v1.7.2
v1.7.1
v1.7.0
v1.7.0-rc2
v1.7.0-rc1
v1.6.7
v1.6.6
v1.6.5
v1.6.4
v1.6.3
v1.6.2
v1.6.1
v1.6.0
v1.6.0-rc
v1.5.9
v1.5.8
v1.5.7
v1.5.6
v1.5.5
v1.5.4
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.5.0-rc
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.4.0-rc1
v1.4.0-beta1
v1.3.10
v1.3.9
v1.3.8
v1.3.7
v1.3.6
v1.3.5
v1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.3.0-beta1
v1.2.7
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc1
sdk/v0.4.1
sdk/v0.4.0
sdk/v0.3.0
sdk/v0.2.1
sdk/v0.2.0
sdk/v0.1.13
sdk/v0.1.12
old-stable-website
old-stable-website-20210728
main-creation
last-go-modable
api/v1.5.0
api/v1.4.1
api/v1.4.0
api/v1.3.1
api/v1.3.0
api/v1.2.0
api/v1.1.1
api/v1.1.0
api/v1.0.4
api/v1.0.3
api/auth/userpass/v0.1.0
api/auth/ldap/v0.1.0
api/auth/kubernetes/v0.1.0
api/auth/gcp/v0.1.0
api/auth/azure/v0.1.0
api/auth/aws/v0.1.0
api/auth/approle/v0.1.1
api/auth/approle/v0.1.0
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+19
-5
Makefile
helper/testhelpers/testhelpers.go
+20
-0
helper/testhelpers/testhelpers.go
vault/core.go
+18
-7
vault/core.go
with
57 additions
and
12 deletions
+57
-12
Makefile
+
19
-
5
View file @
9b80bd20
...
...
@@ -3,18 +3,20 @@
THIS_FILE
:=
$(
lastword
$(MAKEFILE_LIST)
)
TEST
?=
$$
(
go list ./... |
grep
-v
/vendor/ |
grep
-v
/integ
)
TEST_TIMEOUT
?=
30m
EXTENDED_TEST_TIMEOUT
=
45m
TEST_TIMEOUT
?=
45m
EXTENDED_TEST_TIMEOUT
=
60m
INTEG_TEST_TIMEOUT
=
120m
VETARGS
?=
-asmdecl
-atomic
-bool
-buildtags
-copylocks
-methods
-nilfunc
-printf
-rangeloops
-shift
-structtags
-unsafeptr
EXTERNAL_TOOLS
=
\
github.com/elazarl/go-bindata-assetfs/...
\
github.com/hashicorp/go-bindata/...
\
github.com/mitchellh/gox
\
github.com/kardianos/govendor
\
github.com/client9/misspell/cmd/misspell
github.com/client9/misspell/cmd/misspell
\
github.com/golangci/golangci-lint/cmd/golangci-lint
GOFMT_FILES
?=
$$
(
find
.
-name
'*.go'
|
grep
-v
pb.go |
grep
-v
vendor
)
GO_VERSION_MIN
=
1.1
1
GO_VERSION_MIN
=
1.1
2.4
CGO_ENABLED
?=
0
ifneq
($(FDB_ENABLED), )
CGO_ENABLED
=
1
...
...
@@ -97,6 +99,18 @@ vet:
echo
"and fix them if necessary before submitting the code for reviewal."
;
\
fi
# lint runs vet plus a number of other checkers, it is more comprehensive, but louder
lint
:
@
go list
-f
'{{.Dir}}'
./... |
grep
-v
/vendor/
\
| xargs golangci-lint run
;
if
[
$$
?
-eq
1
]
;
then
\
echo
""
;
\
echo
"Lint found suspicious constructs. Please check the reported constructs"
;
\
echo
"and fix them if necessary before submitting the code for reviewal."
;
\
fi
# for ci jobs, runs lint against the changed packages in the commit
ci-lint
:
@
golangci-lint run
--deadline
10m
--new-from-rev
=
HEAD~
# prep runs `go generate` to build the dynamically generated
# source files.
prep
:
fmtcheck
...
...
@@ -117,7 +131,7 @@ ci-verify:
bootstrap
:
@
for
tool
in
$(EXTERNAL_TOOLS)
;
do
\
echo
"Installing/Updating
$$
tool"
;
\
go get
-u
$$
tool
;
\
GO111MODULE
=
off
go get
-u
$$
tool
;
\
done
# Note: if you have plugins in GOPATH you can update all of them via something like:
...
...
This diff is collapsed.
Click to expand it.
helper/testhelpers/testhelpers.go
+
20
-
0
View file @
9b80bd20
...
...
@@ -657,6 +657,26 @@ func WaitForMatchingMerkleRoots(t testing.T, endpoint string, primary, secondary
t
.
Fatalf
(
"roots did not become equal"
)
}
func
WaitForMatchingMerkleRootsCore
(
t
testing
.
T
,
pri
,
sec
*
vault
.
TestClusterCore
,
dr
bool
)
{
rootFunc
:=
vault
.
PerformanceMerkleRoot
if
dr
{
rootFunc
=
vault
.
DRMerkleRoot
}
t
.
Helper
()
for
i
:=
0
;
i
<
30
;
i
++
{
secRoot
:=
rootFunc
(
pri
.
Core
)
priRoot
:=
rootFunc
(
pri
.
Core
)
if
reflect
.
DeepEqual
(
priRoot
,
secRoot
)
{
return
}
time
.
Sleep
(
time
.
Second
)
}
t
.
Fatalf
(
"roots did not become equal"
)
}
func
WaitForWAL
(
t
testing
.
T
,
c
*
vault
.
TestClusterCore
,
wal
uint64
)
{
timeout
:=
time
.
Now
()
.
Add
(
3
*
time
.
Second
)
for
{
...
...
This diff is collapsed.
Click to expand it.
vault/core.go
+
18
-
7
View file @
9b80bd20
...
...
@@ -93,13 +93,16 @@ var (
manualStepDownSleepPeriod
=
10
*
time
.
Second
// Functions only in the Enterprise version
enterprisePostUnseal
=
enterprisePostUnsealImpl
enterprisePreSeal
=
enterprisePreSealImpl
startReplication
=
startReplicationImpl
stopReplication
=
stopReplicationImpl
LastWAL
=
lastWALImpl
LastRemoteWAL
=
lastRemoteWALImpl
WaitUntilWALShipped
=
waitUntilWALShippedImpl
enterprisePostUnseal
=
enterprisePostUnsealImpl
enterprisePreSeal
=
enterprisePreSealImpl
startReplication
=
startReplicationImpl
stopReplication
=
stopReplicationImpl
LastWAL
=
lastWALImpl
LastPerformanceWAL
=
lastPerformanceWALImpl
PerformanceMerkleRoot
=
merkleRootImpl
DRMerkleRoot
=
merkleRootImpl
LastRemoteWAL
=
lastRemoteWALImpl
WaitUntilWALShipped
=
waitUntilWALShippedImpl
)
// NonFatalError is an error that can be returned during NewCore that should be
...
...
@@ -1832,10 +1835,18 @@ func waitUntilWALShippedImpl(ctx context.Context, c *Core, index uint64) bool {
return
true
}
func
merkleRootImpl
(
c
*
Core
)
string
{
return
""
}
func
lastWALImpl
(
c
*
Core
)
uint64
{
return
0
}
func
lastPerformanceWALImpl
(
c
*
Core
)
uint64
{
return
0
}
func
lastRemoteWALImpl
(
c
*
Core
)
uint64
{
return
0
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help