Skip to content

Commit c115c49

Browse files
committed
cmd/AppArmor moved to subpackage
Signed-off-by: apostasie <[email protected]>
1 parent 4b8061d commit c115c49

File tree

7 files changed

+35
-7
lines changed

7 files changed

+35
-7
lines changed

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

1919
import (
2020
"fmt"

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

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

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

25-
func newApparmorCommand() *cobra.Command {
25+
func NewApparmorCommand() *cobra.Command {
2626
cmd := &cobra.Command{
2727
Annotations: map[string]string{helpers.Category: helpers.Management},
2828
Use: "apparmor",
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 apparmor
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/apparmor_list_linux.go renamed to cmd/nerdctl/apparmor/apparmor_list_linux.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 apparmor
1818

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

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

1919
import (
2020
"fmt"

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

1919
import (
2020
"fmt"

cmd/nerdctl/main_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package main
1919
import (
2020
"github.com/spf13/cobra"
2121

22+
"github.com/containerd/nerdctl/v2/cmd/nerdctl/apparmor"
2223
"github.com/containerd/nerdctl/v2/pkg/rootlessutil"
2324
"github.com/containerd/nerdctl/v2/pkg/strutil"
2425
)
@@ -63,7 +64,7 @@ func appNeedsRootlessParentMain(cmd *cobra.Command, args []string) bool {
6364
}
6465

6566
func addApparmorCommand(rootCmd *cobra.Command) {
66-
rootCmd.AddCommand(newApparmorCommand())
67+
rootCmd.AddCommand(apparmor.NewApparmorCommand())
6768
}
6869

6970
func addCpCommand(rootCmd *cobra.Command) {

0 commit comments

Comments
 (0)