mirror of
https://github.com/labring/sealos.git
synced 2026-09-01 15:38:06 +08:00
Feat typo (#1170)
* Update cmd typos to match unified code format. * 1. Update Dockerfile install typo 2. run&fix `make format` on all files
This commit is contained in:
+2
-2
@@ -25,8 +25,8 @@ COPY . /work
|
||||
RUN dpkg --add-architecture arm64 && \
|
||||
apt update && \
|
||||
apt install -y gcc-aarch64-linux-gnu && \
|
||||
apt install -y libbtrfs-dev btrfs-tools && \
|
||||
apt install -y libbtrfs-dev btrfs-tools && \
|
||||
apt install -y libgpgme-dev libdevmapper-dev && \
|
||||
apt install -y libbtrfs-dev:arm64 btrfs-tools:arm64 && \
|
||||
apt install -y libbtrfs-dev:arm64 btrfs-tools:arm64 && \
|
||||
apt install -y libgpgme-dev:arm64 libdevmapper-dev:arm64 && \
|
||||
make ${ACTION}
|
||||
|
||||
@@ -17,10 +17,11 @@ package cmd
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/cert"
|
||||
"github.com/labring/sealos/pkg/utils/flags"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func newCertCmd() *cobra.Command {
|
||||
|
||||
@@ -21,10 +21,11 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/cri"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
utilsexec "k8s.io/utils/exec"
|
||||
|
||||
"github.com/labring/sealos/pkg/cri"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -17,8 +17,9 @@ package cmd
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
func newHostsNameCmd() *cobra.Command {
|
||||
|
||||
@@ -19,9 +19,10 @@ package cmd
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/hosts"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var hostsPath string
|
||||
|
||||
@@ -16,8 +16,9 @@ package cmd
|
||||
|
||||
import (
|
||||
"github.com/labring/lvscare/care"
|
||||
"github.com/labring/sealos/pkg/utils/flags"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/flags"
|
||||
)
|
||||
|
||||
var Ipvs care.LvsCare
|
||||
|
||||
@@ -18,9 +18,10 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/exec"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func newKubeCmd() *cobra.Command {
|
||||
|
||||
@@ -18,10 +18,11 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/passwd"
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func newPasswordCmd() *cobra.Command {
|
||||
|
||||
@@ -22,6 +22,9 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/buildimage"
|
||||
"github.com/labring/sealos/pkg/passwd"
|
||||
"github.com/labring/sealos/pkg/registry"
|
||||
@@ -29,8 +32,6 @@ import (
|
||||
"github.com/labring/sealos/pkg/utils/flags"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/maps"
|
||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -18,8 +18,9 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -17,9 +17,10 @@ package cmd
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/route"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -20,11 +20,12 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/ipvs"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var staticPodPath string
|
||||
|
||||
@@ -17,10 +17,11 @@ package cmd
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/labring/sealos/pkg/token"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
|
||||
"github.com/labring/sealos/pkg/token"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
func newTokenCmd() *cobra.Command {
|
||||
|
||||
@@ -18,8 +18,9 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/labring/sealos/pkg/version"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/version"
|
||||
)
|
||||
|
||||
var shortPrint bool
|
||||
|
||||
@@ -17,9 +17,10 @@ package cmd
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/apply"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const exampleAdd = `
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/apply"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var clusterFile string
|
||||
|
||||
@@ -19,10 +19,11 @@ import (
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func newBuildCmd() *cobra.Command {
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var exampleCreate = `
|
||||
|
||||
@@ -17,10 +17,11 @@ package cmd
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/apply"
|
||||
"github.com/labring/sealos/pkg/apply/processor"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var deleteArgs apply.ScaleArgs
|
||||
|
||||
@@ -17,10 +17,11 @@ limitations under the License.
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/clusterfile"
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/ssh"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var roles string
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
)
|
||||
|
||||
func newImagesCmd() *cobra.Command {
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
)
|
||||
|
||||
func newLoadCmd() *cobra.Command {
|
||||
|
||||
@@ -17,9 +17,10 @@ package cmd
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func newLoginCmd() *cobra.Command {
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
)
|
||||
|
||||
func newLogoutCmd() *cobra.Command {
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
)
|
||||
|
||||
func newPruneCmd() *cobra.Command {
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
)
|
||||
|
||||
func newPullCmd() *cobra.Command {
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
)
|
||||
|
||||
func newPushCmd() *cobra.Command {
|
||||
|
||||
@@ -15,11 +15,12 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/apply"
|
||||
"github.com/labring/sealos/pkg/apply/processor"
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var exampleReset = `
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
)
|
||||
|
||||
func newRMICmd() *cobra.Command {
|
||||
|
||||
@@ -18,11 +18,12 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -15,11 +15,12 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/apply"
|
||||
"github.com/labring/sealos/pkg/apply/processor"
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var contact = `
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
)
|
||||
|
||||
func newSaveCmd() *cobra.Command {
|
||||
|
||||
@@ -17,10 +17,11 @@ limitations under the License.
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/clusterfile"
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/ssh"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// Shared with exec.go
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
)
|
||||
|
||||
func newTagCmd() *cobra.Command {
|
||||
|
||||
@@ -18,8 +18,9 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/labring/sealos/pkg/version"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/labring/sealos/pkg/version"
|
||||
)
|
||||
|
||||
var shortPrint bool
|
||||
|
||||
@@ -16,6 +16,7 @@ package main
|
||||
|
||||
import (
|
||||
"github.com/containers/buildah"
|
||||
|
||||
"github.com/labring/sealos/cmd/sealos/cmd"
|
||||
)
|
||||
|
||||
|
||||
@@ -18,18 +18,17 @@ import (
|
||||
"fmt"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/version"
|
||||
|
||||
"github.com/labring/sealos/pkg/apply/processor"
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/yaml"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/labring/sealos/pkg/client-go/kubernetes"
|
||||
"github.com/labring/sealos/pkg/clusterfile"
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"k8s.io/apimachinery/pkg/version"
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/yaml"
|
||||
)
|
||||
|
||||
func NewDefaultApplier(cluster *v2.Cluster, images []string) (Interface, error) {
|
||||
|
||||
@@ -19,13 +19,10 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/labring/sealos/pkg/checker"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/rand"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/labring/sealos/pkg/checker"
|
||||
"github.com/labring/sealos/pkg/clusterfile"
|
||||
"github.com/labring/sealos/pkg/config"
|
||||
"github.com/labring/sealos/pkg/filesystem"
|
||||
@@ -35,6 +32,8 @@ import (
|
||||
"github.com/labring/sealos/pkg/runtime"
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/rand"
|
||||
"github.com/labring/sealos/pkg/utils/yaml"
|
||||
)
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
package processor
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/confirm"
|
||||
@@ -22,7 +24,6 @@ import (
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/maps"
|
||||
"github.com/labring/sealos/pkg/utils/strings"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type Interface interface {
|
||||
|
||||
@@ -18,8 +18,9 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/labring/sealos/pkg/checker"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/labring/sealos/pkg/checker"
|
||||
"github.com/labring/sealos/pkg/clusterfile"
|
||||
"github.com/labring/sealos/pkg/config"
|
||||
"github.com/labring/sealos/pkg/filesystem"
|
||||
@@ -30,7 +31,6 @@ import (
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/yaml"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
type ScaleProcessor struct {
|
||||
|
||||
+2
-1
@@ -15,6 +15,8 @@
|
||||
package apply
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/labring/sealos/pkg/apply/applydrivers"
|
||||
"github.com/labring/sealos/pkg/clusterfile"
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
@@ -22,7 +24,6 @@ import (
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/yaml"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
func NewApplierFromResetArgs(args *ResetArgs) (applydrivers.Interface, error) {
|
||||
|
||||
+2
-1
@@ -21,10 +21,11 @@ import (
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
strings2 "github.com/labring/sealos/pkg/utils/strings"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
)
|
||||
|
||||
func initCluster(clusterName string) *v2.Cluster {
|
||||
|
||||
@@ -20,14 +20,13 @@ import (
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/maps"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"sigs.k8s.io/yaml"
|
||||
"github.com/labring/sealos/pkg/utils/maps"
|
||||
)
|
||||
|
||||
/*
|
||||
|
||||
+2
-3
@@ -22,13 +22,12 @@ import (
|
||||
goruntime "runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
toml "github.com/pelletier/go-toml"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
errorsutil "k8s.io/apimachinery/pkg/util/errors"
|
||||
utilsexec "k8s.io/utils/exec"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
)
|
||||
|
||||
// defaultKnownCRISockets holds the set of known CRI endpoints
|
||||
|
||||
@@ -23,20 +23,18 @@ import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
|
||||
"github.com/labring/sealos/pkg/runtime"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/labring/sealos/pkg/env"
|
||||
"github.com/labring/sealos/pkg/runtime"
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/exec"
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/ssh"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
type defaultRootfs struct {
|
||||
|
||||
+3
-5
@@ -19,21 +19,19 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/exec"
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/client-go/util/homedir"
|
||||
|
||||
"github.com/labring/sealos/fork/golang/expansion"
|
||||
|
||||
"github.com/labring/sealos/pkg/env"
|
||||
"github.com/labring/sealos/pkg/image"
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
"github.com/labring/sealos/pkg/runtime"
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/exec"
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/maps"
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -24,10 +24,10 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/emirpasic/gods/maps/linkedhashmap"
|
||||
strings2 "github.com/labring/sealos/pkg/utils/strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
strings2 "github.com/labring/sealos/pkg/utils/strings"
|
||||
)
|
||||
|
||||
type HostFile struct {
|
||||
|
||||
@@ -19,14 +19,13 @@ package binary
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/exec"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
"github.com/labring/sealos/pkg/utils/exec"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
type ClusterService struct {
|
||||
|
||||
@@ -24,21 +24,19 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/buildimage"
|
||||
"github.com/labring/sealos/pkg/registry"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/exec"
|
||||
json2 "github.com/labring/sealos/pkg/utils/json"
|
||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
|
||||
"github.com/labring/sealos/pkg/buildimage"
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
"github.com/labring/sealos/pkg/registry"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/exec"
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
json2 "github.com/labring/sealos/pkg/utils/json"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
// ImageService is the default service, which is used for image pull/push
|
||||
|
||||
@@ -17,9 +17,10 @@ limitations under the License.
|
||||
package image
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/exec"
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func initBuildah() (bool, error) {
|
||||
|
||||
@@ -17,9 +17,10 @@ limitations under the License.
|
||||
package cluster
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
bb "github.com/labring/sealos/pkg/image/buildah/cluster/buildah"
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (c *Service) Create(name string, image string) (*types.ClusterManifest, error) {
|
||||
|
||||
@@ -17,10 +17,10 @@ limitations under the License.
|
||||
package cluster
|
||||
|
||||
import (
|
||||
bb "github.com/labring/sealos/pkg/image/buildah/cluster/buildah"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
bb "github.com/labring/sealos/pkg/image/buildah/cluster/buildah"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
func (c *Service) Delete(name string) error {
|
||||
|
||||
@@ -16,10 +16,10 @@ limitations under the License.
|
||||
package cluster
|
||||
|
||||
import (
|
||||
bb "github.com/labring/sealos/pkg/image/buildah/cluster/buildah"
|
||||
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
bb "github.com/labring/sealos/pkg/image/buildah/cluster/buildah"
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
)
|
||||
|
||||
func (*Service) Inspect(name string) (*types.ClusterManifest, error) {
|
||||
|
||||
@@ -18,10 +18,10 @@ package cluster
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
bb "github.com/labring/sealos/pkg/image/buildah/cluster/buildah"
|
||||
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
bb "github.com/labring/sealos/pkg/image/buildah/cluster/buildah"
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
)
|
||||
|
||||
func (*Service) List() ([]types.ClusterInfo, error) {
|
||||
|
||||
@@ -16,33 +16,30 @@ package image
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/containers/buildah/define"
|
||||
"github.com/containers/buildah/imagebuildah"
|
||||
buildahcli "github.com/containers/buildah/pkg/cli"
|
||||
"github.com/containers/buildah/pkg/parse"
|
||||
buildahutil "github.com/containers/buildah/pkg/util"
|
||||
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/containers/common/pkg/auth"
|
||||
image_types "github.com/containers/image/v5/types"
|
||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/containers/common/pkg/auth"
|
||||
"github.com/labring/sealos/pkg/buildimage"
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
"github.com/labring/sealos/pkg/registry"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (d *Service) Build(options *types.BuildOptions, contextDir, imageName string) error {
|
||||
|
||||
@@ -22,20 +22,19 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/containers/buildah/pkg/formats"
|
||||
"github.com/containers/common/libimage"
|
||||
"github.com/docker/go-units"
|
||||
|
||||
"github.com/containers/buildah"
|
||||
"github.com/containers/buildah/define"
|
||||
"github.com/containers/buildah/pkg/formats"
|
||||
"github.com/containers/common/libimage"
|
||||
"github.com/containers/image/v5/types"
|
||||
encconfig "github.com/containers/ocicrypt/config"
|
||||
enchelpers "github.com/containers/ocicrypt/helpers"
|
||||
labring_types "github.com/labring/sealos/pkg/image/types"
|
||||
|
||||
"github.com/containers/storage"
|
||||
"github.com/containers/storage/pkg/unshare"
|
||||
"github.com/docker/go-units"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
labring_types "github.com/labring/sealos/pkg/image/types"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -24,11 +24,10 @@ import (
|
||||
"github.com/containers/buildah/pkg/formats"
|
||||
"github.com/containers/common/libimage"
|
||||
image_types "github.com/containers/image/v5/types"
|
||||
|
||||
"github.com/docker/go-units"
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
)
|
||||
|
||||
const none = "<none>"
|
||||
|
||||
@@ -19,12 +19,13 @@ import (
|
||||
|
||||
"github.com/containers/buildah"
|
||||
image_types "github.com/containers/image/v5/types"
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
json2 "github.com/labring/sealos/pkg/utils/json"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
json2 "github.com/labring/sealos/pkg/utils/json"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -25,9 +25,10 @@ import (
|
||||
"github.com/containers/buildah/pkg/parse"
|
||||
"github.com/containers/common/pkg/auth"
|
||||
image_types "github.com/containers/image/v5/types"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
labring_types "github.com/labring/sealos/pkg/image/types"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (d *Service) Load(archiveName string) error {
|
||||
|
||||
@@ -18,24 +18,23 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/containers/buildah/util"
|
||||
cp "github.com/containers/image/v5/copy"
|
||||
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/containers/buildah/util"
|
||||
"github.com/containers/common/libimage"
|
||||
"github.com/containers/common/libimage/manifests"
|
||||
cp "github.com/containers/image/v5/copy"
|
||||
"github.com/containers/image/v5/manifest"
|
||||
"github.com/containers/image/v5/transports"
|
||||
"github.com/containers/image/v5/transports/alltransports"
|
||||
"github.com/containers/image/v5/types"
|
||||
"github.com/containers/storage"
|
||||
labring_types "github.com/labring/sealos/pkg/image/types"
|
||||
imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
labring_types "github.com/labring/sealos/pkg/image/types"
|
||||
)
|
||||
|
||||
func manifestInspect(ctx context.Context, store storage.Store, systemContext *types.SystemContext, imageSpec string) (string, error) {
|
||||
|
||||
@@ -22,9 +22,10 @@ import (
|
||||
is "github.com/containers/image/v5/storage"
|
||||
"github.com/containers/storage"
|
||||
"github.com/containers/storage/pkg/unshare"
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/labring/sealos/pkg/image/types"
|
||||
)
|
||||
|
||||
// Service is the default service, which is used for image pull/push
|
||||
|
||||
@@ -20,13 +20,12 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
strings2 "github.com/labring/sealos/pkg/utils/strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
strings2 "github.com/labring/sealos/pkg/utils/strings"
|
||||
)
|
||||
|
||||
type Instance struct {
|
||||
|
||||
@@ -18,13 +18,12 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/rand"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/rand"
|
||||
)
|
||||
|
||||
func (a *AliProvider) GetAvailableImageID(host *v1beta1.InfraHost) (string, error) {
|
||||
|
||||
@@ -17,21 +17,16 @@ package aliyun
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/rand"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/validation"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/vpc"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/types/validation"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/rand"
|
||||
)
|
||||
|
||||
type ActionName string
|
||||
|
||||
@@ -18,15 +18,13 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/rand"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/vpc"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/rand"
|
||||
)
|
||||
|
||||
func (a *AliProvider) CreateVPC() error {
|
||||
|
||||
@@ -17,18 +17,15 @@ package huawei
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/rand"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
|
||||
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core"
|
||||
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
|
||||
ecs "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ecs/v2"
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
|
||||
vpc "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/vpc/v2"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/rand"
|
||||
)
|
||||
|
||||
type ActionName string
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
package huawei
|
||||
|
||||
import (
|
||||
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def"
|
||||
"github.com/labring/sealos/pkg/utils/retry"
|
||||
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/retry"
|
||||
)
|
||||
|
||||
func (a *HwProvider) RetryVpcRequest(request interface{}, def *def.HttpRequestDef) (interface{}, error) {
|
||||
|
||||
@@ -18,11 +18,11 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
//this package contains some utils to handle docker image name
|
||||
|
||||
@@ -20,10 +20,11 @@ import (
|
||||
"fmt"
|
||||
"path"
|
||||
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/yaml"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
)
|
||||
|
||||
var defaultRootDirectory = "/var/lib/image-cri-shim"
|
||||
|
||||
@@ -21,23 +21,20 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
|
||||
"github.com/labring/sealos/pkg/runtime/apis/kubeadm/v1beta2"
|
||||
"github.com/labring/sealos/pkg/runtime/apis/kubeadm/v1beta3"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
|
||||
"github.com/labring/sealos/pkg/runtime/apis/kubeadm"
|
||||
"github.com/labring/sealos/pkg/runtime/apis/kubeadm/v1beta2"
|
||||
"github.com/labring/sealos/pkg/runtime/apis/kubeadm/v1beta3"
|
||||
"github.com/labring/sealos/pkg/token"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
strings2 "github.com/labring/sealos/pkg/utils/strings"
|
||||
"github.com/labring/sealos/pkg/utils/versionutil"
|
||||
"github.com/labring/sealos/pkg/utils/yaml"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -22,17 +22,17 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/imdario/mergo"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
k8sruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/yaml"
|
||||
"k8s.io/kube-proxy/config/v1alpha1"
|
||||
"k8s.io/kubelet/config/v1beta1"
|
||||
|
||||
"github.com/labring/sealos/pkg/runtime/apis/kubeadm"
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/yaml"
|
||||
|
||||
"github.com/imdario/mergo"
|
||||
"github.com/labring/sealos/pkg/runtime/apis/kubeadm"
|
||||
k8sruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kube-proxy/config/v1alpha1"
|
||||
"k8s.io/kubelet/config/v1beta1"
|
||||
)
|
||||
|
||||
// https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/apis/kubeadm/v1beta2/types.go
|
||||
|
||||
@@ -20,13 +20,14 @@ import (
|
||||
"path"
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/ssh"
|
||||
"github.com/labring/sealos/pkg/utils/strings"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
func (k *KubeadmRuntime) InitMaster0() error {
|
||||
|
||||
+3
-2
@@ -19,12 +19,13 @@ import (
|
||||
"fmt"
|
||||
"path"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/ssh"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
func (k *KubeadmRuntime) joinNodes(newNodesIPList []string) error {
|
||||
|
||||
@@ -18,18 +18,15 @@ import (
|
||||
"fmt"
|
||||
"path"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/yaml"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
||||
"github.com/labring/sealos/pkg/passwd"
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/yaml"
|
||||
)
|
||||
|
||||
func GetRegistry(rootfs, defaultRegistry string) *v1beta1.RegistryConfig {
|
||||
|
||||
@@ -18,8 +18,9 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -21,17 +21,15 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/labring/sealos/pkg/env"
|
||||
"github.com/labring/sealos/pkg/remote"
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/ssh"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
func (k *KubeadmRuntime) getRegistry() *v1beta1.RegistryConfig {
|
||||
|
||||
@@ -19,8 +19,9 @@ import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -20,15 +20,15 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
|
||||
"github.com/labring/sealos/pkg/client-go/kubernetes"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"golang.org/x/sync/errgroup"
|
||||
v12 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/labring/sealos/pkg/client-go/kubernetes"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
+1
-2
@@ -22,13 +22,12 @@ import (
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
|
||||
v1 "github.com/labring/sealos/pkg/token/bootstraptoken/v1"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/exec"
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/yaml"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
)
|
||||
|
||||
type Token struct {
|
||||
|
||||
@@ -20,8 +20,9 @@ import (
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/strings"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/strings"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -17,11 +17,12 @@ package validation
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||
apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
)
|
||||
|
||||
// ValidateInfraName validates that the given name can be used as a infra name.
|
||||
|
||||
@@ -19,11 +19,12 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/yaml"
|
||||
|
||||
"github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/constants"
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/yaml"
|
||||
)
|
||||
|
||||
func Cluster(filepath string) (clusters []v1beta1.Cluster, err error) {
|
||||
|
||||
@@ -17,8 +17,9 @@ limitations under the License.
|
||||
package flags
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
)
|
||||
|
||||
// PrintFlags logs the flags in the flagset
|
||||
|
||||
@@ -17,9 +17,10 @@ limitations under the License.
|
||||
package json
|
||||
|
||||
import (
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
)
|
||||
|
||||
func Unmarshal(path string) (map[string]interface{}, error) {
|
||||
|
||||
@@ -21,9 +21,10 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
v2 "github.com/labring/sealos/pkg/types/v1beta1"
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
type Exec struct {
|
||||
|
||||
@@ -23,17 +23,15 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/hash"
|
||||
"github.com/pkg/sftp"
|
||||
"github.com/schollz/progressbar/v3"
|
||||
"golang.org/x/crypto/ssh"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/labring/sealos/pkg/utils/hash"
|
||||
"github.com/labring/sealos/pkg/utils/iputils"
|
||||
|
||||
"github.com/labring/sealos/pkg/utils/logger"
|
||||
"github.com/labring/sealos/pkg/utils/progress"
|
||||
"github.com/schollz/progressbar/v3"
|
||||
|
||||
"github.com/pkg/sftp"
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
|
||||
func (s *SSH) RemoteMd5Sum(host, remoteFilePath string) string {
|
||||
|
||||
@@ -17,8 +17,9 @@ limitations under the License.
|
||||
package toml
|
||||
|
||||
import (
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
"github.com/pelletier/go-toml"
|
||||
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
)
|
||||
|
||||
func MarshalTomlToFile(file string, obj interface{}) error {
|
||||
|
||||
@@ -23,11 +23,11 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
utilyaml "k8s.io/apimachinery/pkg/util/yaml"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
fileutil "github.com/labring/sealos/pkg/utils/file"
|
||||
)
|
||||
|
||||
func Unmarshal(path string) (map[string]interface{}, error) {
|
||||
|
||||
Reference in New Issue
Block a user