Skip to content

Commit a07d906

Browse files
committed
Move volume actions under subpackage
Signed-off-by: apostasie <[email protected]>
1 parent 061d0cb commit a07d906

14 files changed

+42
-14
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/volume"
3738
"github.com/containerd/nerdctl/v2/pkg/config"
3839
ncdefaults "github.com/containerd/nerdctl/v2/pkg/defaults"
3940
"github.com/containerd/nerdctl/v2/pkg/errutil"
@@ -292,7 +293,7 @@ Config file ($NERDCTL_TOML): %s
292293
newContainerCommand(),
293294
newImageCommand(),
294295
newNetworkCommand(),
295-
newVolumeCommand(),
296+
volume.NewVolumeCommand(),
296297
newSystemCommand(),
297298
newNamespaceCommand(),
298299
newBuilderCommand(),

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

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

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

25-
func newVolumeCommand() *cobra.Command {
25+
func NewVolumeCommand() *cobra.Command {
2626
volumeCommand := &cobra.Command{
2727
Annotations: map[string]string{helpers.Category: helpers.Management},
2828
Use: "volume",

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

1919
import (
2020
"fmt"

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

1919
import (
2020
"testing"

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

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

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

1919
import (
2020
"crypto/rand"

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

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

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

1919
import (
2020
"errors"

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

1919
import (
2020
"testing"

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

1919
import (
2020
"fmt"

0 commit comments

Comments
 (0)