Skip to content

Commit d1bc54d

Browse files
committed
Move network to cmd/nerdctl/network
Signed-off-by: apostasie <[email protected]>
1 parent f7e033d commit d1bc54d

16 files changed

+47
-18
lines changed

cmd/nerdctl/main.go

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

3535
"github.com/containerd/nerdctl/v2/cmd/nerdctl/completion"
3636
"github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers"
37+
"github.com/containerd/nerdctl/v2/cmd/nerdctl/network"
3738
"github.com/containerd/nerdctl/v2/cmd/nerdctl/volume"
3839
"github.com/containerd/nerdctl/v2/pkg/config"
3940
ncdefaults "github.com/containerd/nerdctl/v2/pkg/defaults"
@@ -292,7 +293,7 @@ Config file ($NERDCTL_TOML): %s
292293
// #region helpers.Management
293294
newContainerCommand(),
294295
newImageCommand(),
295-
newNetworkCommand(),
296+
network.NewNetworkCommand(),
296297
volume.NewVolumeCommand(),
297298
newSystemCommand(),
298299
newNamespaceCommand(),

cmd/nerdctl/network.go renamed to cmd/nerdctl/network/network.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 network
1818

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

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

25-
func newNetworkCommand() *cobra.Command {
25+
func NewNetworkCommand() *cobra.Command {
2626
networkCommand := &cobra.Command{
2727
Annotations: map[string]string{helpers.Category: helpers.Management},
2828
Use: "network",

cmd/nerdctl/network_create.go renamed to cmd/nerdctl/network/network_create.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 network
1818

1919
import (
2020
"fmt"

cmd/nerdctl/network_create_linux_test.go renamed to cmd/nerdctl/network/network_create_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 network
1818

1919
import (
2020
"fmt"

cmd/nerdctl/network_create_unix.go renamed to cmd/nerdctl/network/network_create_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
limitations under the License.
1717
*/
1818

19-
package main
19+
package network
2020

2121
const DefaultNetworkDriver = "bridge"

cmd/nerdctl/network_create_windows.go renamed to cmd/nerdctl/network/network_create_windows.go

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

17-
package main
17+
package network
1818

1919
const DefaultNetworkDriver = "nat"

cmd/nerdctl/network_inspect.go renamed to cmd/nerdctl/network/network_inspect.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 network
1818

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

cmd/nerdctl/network_inspect_test.go renamed to cmd/nerdctl/network/network_inspect_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 network
1818

1919
import (
2020
"runtime"

cmd/nerdctl/network_list.go renamed to cmd/nerdctl/network/network_list.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 network
1818

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

cmd/nerdctl/network_list_linux_test.go renamed to cmd/nerdctl/network/network_list_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 network
1818

1919
import (
2020
"errors"

0 commit comments

Comments
 (0)