Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
0cb22ccf
Unverified
Commit
0cb22ccf
authored
Apr 09, 2018
by
Whyrusleeping
Committed by
GitHub
Apr 09, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4845 from ipfs/fix/default-net-bootstrap
fix default-net profile not reverting bootstrap config
parents
8c2a4206
dd23bec9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
repo/config/profile.go
repo/config/profile.go
+17
-4
test/sharness/t0021-config.sh
test/sharness/t0021-config.sh
+7
-2
No files found.
repo/config/profile.go
View file @
0cb22ccf
...
...
@@ -86,6 +86,12 @@ Inverse profile of the test profile.`,
Transform
:
func
(
c
*
Config
)
error
{
c
.
Addresses
=
addressesConfig
()
bootstrapPeers
,
err
:=
DefaultBootstrapPeers
()
if
err
!=
nil
{
return
err
}
c
.
Bootstrap
=
appendSingle
(
c
.
Bootstrap
,
BootstrapPeerStrings
(
bootstrapPeers
))
c
.
Swarm
.
DisableNatPortMap
=
false
c
.
Discovery
.
MDNS
.
Enabled
=
true
return
nil
...
...
@@ -156,14 +162,21 @@ fetching may be degraded.
}
func
appendSingle
(
a
[]
string
,
b
[]
string
)
[]
string
{
m
:=
map
[
string
]
struct
{}{}
out
:=
make
([]
string
,
0
,
len
(
a
)
+
len
(
b
))
m
:=
map
[
string
]
bool
{}
for
_
,
f
:=
range
a
{
m
[
f
]
=
struct
{}{}
if
!
m
[
f
]
{
out
=
append
(
out
,
f
)
}
m
[
f
]
=
true
}
for
_
,
f
:=
range
b
{
m
[
f
]
=
struct
{}{}
if
!
m
[
f
]
{
out
=
append
(
out
,
f
)
}
m
[
f
]
=
true
}
return
mapKeys
(
m
)
return
out
}
func
deleteEntries
(
arr
[]
string
,
del
[]
string
)
[]
string
{
...
...
test/sharness/t0021-config.sh
View file @
0cb22ccf
...
...
@@ -212,8 +212,13 @@ test_config_cmd() {
test_profile_apply_revert server local-discovery
# won't work as we already have this profile applied
# test_profile_apply_revert test
# tests above mess with values this profile changes, need to do that before testing test profile
test_expect_success
"ensure test profile is applied fully"
'
ipfs config profile apply test
'
# need to do this in reverse as the test profile is already applied in sharness
test_profile_apply_revert default-networking
test
# won't work as it changes datastore definition, which makes ipfs not launch
# without converting first
...
...
Write
Preview
Markdown
is supported
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