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
7588a6a5
Unverified
Commit
7588a6a5
authored
Jan 14, 2021
by
Adin Schmahmann
Committed by
GitHub
Jan 14, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7829 from ipfs/fix/pin-remote-service-ls-json
fix: remote services ls always return a list
parents
651e3cca
216b858f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
core/commands/pin/remotepin.go
core/commands/pin/remotepin.go
+1
-1
test/sharness/t0700-remotepin.sh
test/sharness/t0700-remotepin.sh
+8
-0
No files found.
core/commands/pin/remotepin.go
View file @
7588a6a5
...
...
@@ -486,7 +486,7 @@ var lsRemotePinServiceCmd = &cmds.Command{
return
err
}
if
cfg
.
Pinning
.
RemoteServices
==
nil
{
return
nil
// no pinning services added yet
return
cmds
.
EmitOnce
(
res
,
&
PinServicesList
{
make
([]
ServiceDetails
,
0
)})
}
services
:=
cfg
.
Pinning
.
RemoteServices
result
:=
PinServicesList
{
make
([]
ServiceDetails
,
0
,
len
(
services
))}
...
...
test/sharness/t0700-remotepin.sh
View file @
7588a6a5
...
...
@@ -20,6 +20,14 @@ TEST_PIN_SVC_KEY=$(curl -s -X POST "$TEST_PIN_SVC/users" -d email="go-ipfs-sharn
# pin remote service add|ls|rm
# confirm empty service list response has proper json struct
# https://github.com/ipfs/go-ipfs/pull/7829
test_expect_success
"test 'ipfs pin remote service ls' JSON on empty list"
'
ipfs pin remote service ls --stat --enc=json | tee empty_ls_out &&
echo "{\"RemoteServices\":[]}" > exp_ls_out &&
test_cmp exp_ls_out empty_ls_out
'
# add valid and invalid services
test_expect_success
"creating test user on remote pinning service"
'
echo CI host IP address ${TEST_PIN_SVC} &&
...
...
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