Skip to content

Commit

Permalink
Login code refactor
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
  • Loading branch information
apostasie committed Aug 6, 2024
1 parent 5b8cda9 commit b297e8c
Show file tree
Hide file tree
Showing 258 changed files with 1,692 additions and 564 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 b297e8c

Please sign in to comment.