Skip to content

Commit 3ea64eb

Browse files
committed
Move ipfs to subpackage
Signed-off-by: apostasie <[email protected]>
1 parent c8df501 commit 3ea64eb

9 files changed

+37
-9
lines changed

cmd/nerdctl/ipfs.go renamed to cmd/nerdctl/ipfs/ipfs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
limitations under the License.
1515
*/
1616

17-
package main
17+
package ipfs
1818

1919
import (
2020
"github.com/spf13/cobra"
2121

2222
"github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers"
2323
)
2424

25-
func newIPFSCommand() *cobra.Command {
25+
func NewIPFSCommand() *cobra.Command {
2626
cmd := &cobra.Command{
2727
Annotations: map[string]string{helpers.Category: helpers.Management},
2828
Use: "ipfs",

cmd/nerdctl/ipfs_build_linux_test.go renamed to cmd/nerdctl/ipfs/ipfs_build_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package main
17+
package ipfs
1818

1919
import (
2020
"fmt"

cmd/nerdctl/ipfs_compose_linux_test.go renamed to cmd/nerdctl/ipfs/ipfs_compose_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package main
17+
package ipfs
1818

1919
import (
2020
"fmt"

cmd/nerdctl/ipfs_linux_test.go renamed to cmd/nerdctl/ipfs/ipfs_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package main
17+
package ipfs
1818

1919
import (
2020
"fmt"

cmd/nerdctl/ipfs_registry.go renamed to cmd/nerdctl/ipfs/ipfs_registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package main
17+
package ipfs
1818

1919
import (
2020
"github.com/spf13/cobra"

cmd/nerdctl/ipfs_registry_linux_test.go renamed to cmd/nerdctl/ipfs/ipfs_registry_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package main
17+
package ipfs
1818

1919
import (
2020
"strings"

cmd/nerdctl/ipfs_registry_serve.go renamed to cmd/nerdctl/ipfs/ipfs_registry_serve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package main
17+
package ipfs
1818

1919
import (
2020
"github.com/spf13/cobra"

cmd/nerdctl/ipfs/ipfs_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
Copyright The containerd Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package ipfs
18+
19+
import (
20+
"testing"
21+
22+
"github.com/containerd/nerdctl/v2/pkg/testutil"
23+
)
24+
25+
func TestMain(m *testing.M) {
26+
testutil.M(m)
27+
}

cmd/nerdctl/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333

3434
"github.com/containerd/nerdctl/v2/cmd/nerdctl/completion"
3535
"github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers"
36+
"github.com/containerd/nerdctl/v2/cmd/nerdctl/ipfs"
3637
"github.com/containerd/nerdctl/v2/cmd/nerdctl/login"
3738
"github.com/containerd/nerdctl/v2/cmd/nerdctl/namespace"
3839
"github.com/containerd/nerdctl/v2/cmd/nerdctl/network"
@@ -314,7 +315,7 @@ Config file ($NERDCTL_TOML): %s
314315
newComposeCommand(),
315316

316317
// IPFS
317-
newIPFSCommand(),
318+
ipfs.NewIPFSCommand(),
318319
)
319320
addApparmorCommand(rootCmd)
320321
addCpCommand(rootCmd)

0 commit comments

Comments
 (0)