Skip to content

Commit

Permalink
Login code refactor
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Aug 6, 2024
1 parent 5b8cda9 commit aa91775
Show file tree
Hide file tree
Showing 258 changed files with 1,732 additions and 550 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ RUN curl -o nydus-static.tgz -fsSL --proto '=https' --tlsv1.2 "https://github.co
mv nydus-static/nydus-image nydus-static/nydusd nydus-static/nydusify /usr/bin/ && \
rm nydus-static.tgz
CMD ["gotestsum", "--format=testname", "--rerun-fails=2", "--packages=github.com/containerd/nerdctl/v2/cmd/nerdctl/...", \
"--", "-timeout=30m", "-args", "-test.kill-daemon"]
"--", "-timeout=60m", "-args", "-test.kill-daemon"]

FROM test-integration AS test-integration-rootless
# Install SSH for creating systemd user session.
Expand All @@ -345,7 +345,7 @@ COPY ./Dockerfile.d/test-integration-rootless.sh /
CMD ["/test-integration-rootless.sh", \
"gotestsum", "--format=testname", "--rerun-fails=2", "--raw-command", \
"--", "/usr/local/go/bin/go", "tool", "test2json", "-t", "-p", "github.com/containerd/nerdctl/v2/cmd/nerdctl", \
"/usr/local/bin/nerdctl.test", "-test.v", "-test.timeout=30m", "-test.kill-daemon"]
"/usr/local/bin/nerdctl.test", "-test.v", "-test.timeout=60m", "-test.kill-daemon"]

# test for CONTAINERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=slirp4netns
FROM test-integration-rootless AS test-integration-rootless-port-slirp4netns
Expand All @@ -354,6 +354,6 @@ RUN chown -R rootless:rootless /home/rootless/.config

FROM test-integration AS test-integration-ipv6
CMD ["gotestsum", "--format=testname", "--rerun-fails=2", "--packages=github.com/containerd/nerdctl/v2/cmd/nerdctl/...", \
"--", "-timeout=30m", "-args", "-test.kill-daemon", "-test.ipv6"]
"--", "-timeout=60m", "-args", "-test.kill-daemon", "-test.ipv6"]

FROM base AS demo
4 changes: 2 additions & 2 deletions cmd/nerdctl/apparmor_inspect_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ package main
import (
"fmt"

"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/cmd/apparmor"
"github.com/containerd/nerdctl/v2/pkg/defaults"
"github.com/spf13/cobra"
)

func newApparmorInspectCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/apparmor_list_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
package main

import (
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/cmd/apparmor"
"github.com/spf13/cobra"
)

func newApparmorLsCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/apparmor_load_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package main
import (
"fmt"

"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/cmd/apparmor"
"github.com/containerd/nerdctl/v2/pkg/defaults"
"github.com/spf13/cobra"
)

func newApparmorLoadCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/apparmor_unload_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package main
import (
"fmt"

"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/cmd/apparmor"
"github.com/containerd/nerdctl/v2/pkg/defaults"
"github.com/spf13/cobra"
)

func newApparmorUnloadCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
"os/exec"
"strings"

"github.com/spf13/cobra"

"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/pkg/buildkitutil"
"github.com/spf13/cobra"
)

func newBuilderCommand() *cobra.Command {
Expand Down
4 changes: 2 additions & 2 deletions cmd/nerdctl/builder_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"strconv"
"strings"

"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/buildkitutil"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/builder"
"github.com/containerd/nerdctl/v2/pkg/strutil"

"github.com/spf13/cobra"
)

func newBuildCommand() *cobra.Command {
Expand Down
5 changes: 3 additions & 2 deletions cmd/nerdctl/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import (
"context"
"time"

"github.com/containerd/containerd"
"github.com/spf13/cobra"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/labels"
"github.com/containerd/nerdctl/v2/pkg/netutil"
"github.com/spf13/cobra"
)

func shellCompleteImageNames(cmd *cobra.Command) ([]string, cobra.ShellCompDirective) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/completion_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
package main

import (
"github.com/containerd/nerdctl/v2/pkg/apparmorutil"
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/apparmorutil"
)

func shellCompleteApparmorProfiles(cmd *cobra.Command) ([]string, cobra.ShellCompDirective) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
package main

import (
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/composer"
)

func newComposeCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
package main

import (
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposeBuildCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ package main
import (
"fmt"

"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposeConfigCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ package main
import (
"errors"

"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposeCreateCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_down.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
package main

import (
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposeDownCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ package main
import (
"errors"

"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposeExecCommand() *cobra.Command {
Expand Down
11 changes: 6 additions & 5 deletions cmd/nerdctl/compose_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ import (
"strings"
"text/tabwriter"

"github.com/containerd/containerd"
"github.com/containerd/containerd/pkg/progress"
"github.com/containerd/containerd/snapshots"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/snapshots"
"github.com/containerd/containerd/v2/pkg/progress"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/formatter"
"github.com/containerd/nerdctl/v2/pkg/imgutil"
"github.com/containerd/nerdctl/v2/pkg/labels"
"github.com/containerd/nerdctl/v2/pkg/strutil"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
)

func newComposeImagesCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
package main

import (
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposeKillCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
package main

import (
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposeLogsCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
package main

import (
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/spf13/cobra"
)

func newComposePauseCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import (
"fmt"
"strconv"

"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposePortCommand() *cobra.Command {
Expand Down
9 changes: 5 additions & 4 deletions cmd/nerdctl/compose_ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ import (
"text/tabwriter"
"time"

"github.com/containerd/containerd"
"github.com/containerd/containerd/runtime/restart"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/runtime/restart"
"github.com/containerd/errdefs"
gocni "github.com/containerd/go-cni"
"github.com/containerd/log"
Expand All @@ -34,8 +37,6 @@ import (
"github.com/containerd/nerdctl/v2/pkg/formatter"
"github.com/containerd/nerdctl/v2/pkg/labels"
"github.com/containerd/nerdctl/v2/pkg/portutil"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
)

func newComposePsCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
package main

import (
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposePullCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
package main

import (
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposeRestartCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import (
"errors"
"fmt"

"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposeRunCommand() *cobra.Command {
Expand Down
7 changes: 4 additions & 3 deletions cmd/nerdctl/compose_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import (
"fmt"
"os"

"github.com/containerd/containerd"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/errdefs"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/containerutil"
"github.com/containerd/nerdctl/v2/pkg/labels"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
)

func newComposeStartCommand() *cobra.Command {
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
package main

import (
"github.com/spf13/cobra"

"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/spf13/cobra"
)

func newComposeStopCommand() *cobra.Command {
Expand Down
5 changes: 3 additions & 2 deletions cmd/nerdctl/compose_top.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ package main
import (
"fmt"

"github.com/containerd/containerd"
"github.com/spf13/cobra"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
"github.com/containerd/nerdctl/v2/pkg/containerutil"
"github.com/containerd/nerdctl/v2/pkg/labels"
"github.com/spf13/cobra"
)

func newComposeTopCommand() *cobra.Command {
Expand Down
Loading

0 comments on commit aa91775

Please sign in to comment.