Skip to content

Commit

Permalink
feature(main): delete registry feature using sreg code replace (#3714)
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu authored Aug 21, 2023
1 parent d578fb4 commit ada947f
Show file tree
Hide file tree
Showing 61 changed files with 37 additions and 6,492 deletions.
3 changes: 1 addition & 2 deletions cmd/sealctl/cmd/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ limitations under the License.
package cmd

import (
"github.com/labring/sreg/pkg/registry/commands"
"github.com/spf13/cobra"

"github.com/labring/sealos/pkg/registry/commands"
)

func newRegistryCmd() *cobra.Command {
Expand Down
3 changes: 3 additions & 0 deletions cmd/sealctl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"fmt"
"os"

sreglog "github.com/labring/sreg/pkg/utils/logger"

"github.com/spf13/cobra"
"k8s.io/kubectl/pkg/util/templates"

Expand Down Expand Up @@ -52,6 +54,7 @@ func Execute() {
func init() {
cobra.OnInitialize(func() {
logger.CfgConsoleLogger(debug, false)
sreglog.CfgConsoleLogger(debug, false)
})

rootCmd.PersistentFlags().BoolVar(&debug, "debug", false, "enable debug logger")
Expand Down
10 changes: 6 additions & 4 deletions cmd/sealos/cmd/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package cmd

import (
sregcmd "github.com/labring/sreg/pkg/registry/commands"
"github.com/spf13/cobra"

"github.com/labring/sealos/pkg/registry/commands"
Expand All @@ -27,10 +28,11 @@ func newRegistryCmd(examplePrefix string) *cobra.Command {
Use: "registry",
Short: "registry related",
}
examplePrefix = examplePrefix + " registry"
cmd.AddCommand(commands.NewRegistryPasswdCmd())
cmd.AddCommand(commands.NewServeRegistryCommand())
cmd.AddCommand(commands.NewRegistryImageSaveCmd(examplePrefix))
cmd.AddCommand(commands.NewSyncRegistryCommand(examplePrefix))
cmd.AddCommand(commands.NewCopyRegistryCommand(examplePrefix))
cmd.AddCommand(sregcmd.NewServeRegistryCommand())
cmd.AddCommand(sregcmd.NewRegistryImageSaveCmd(examplePrefix))
cmd.AddCommand(sregcmd.NewSyncRegistryCommand(examplePrefix))
cmd.AddCommand(sregcmd.NewCopyRegistryCommand(examplePrefix))
return cmd
}
8 changes: 5 additions & 3 deletions cmd/sealos/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ import (
"io"
"os"

sreglog "github.com/labring/sreg/pkg/utils/logger"
"github.com/spf13/cobra"
"k8s.io/kubectl/pkg/util/templates"

"github.com/labring/sealos/pkg/buildah"
"github.com/labring/sealos/pkg/constants"
"github.com/labring/sealos/pkg/system"
"github.com/labring/sealos/pkg/utils/file"
"github.com/labring/sealos/pkg/utils/logger"

"github.com/spf13/cobra"
"k8s.io/kubectl/pkg/util/templates"
)

var (
Expand Down Expand Up @@ -108,6 +109,7 @@ func setRequireBuildahAnnotation(cmd *cobra.Command) {

func onBootOnDie() {
logger.CfgConsoleAndFileLogger(debug, constants.LogPath(), "sealos", false)
sreglog.CfgConsoleAndFileLogger(debug, constants.LogPath(), "sealos", false)
val, err := system.Get(system.DataRootConfigKey)
errExit(err)
constants.DefaultClusterRootFsDir = val
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ require (
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/labring/sealos/controllers/user v0.0.0 // indirect
github.com/labring/sreg v0.1.1 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/letsencrypt/boulder v0.0.0-20230213213521-fdfea0d469b6 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/labring/sreg v0.1.1 h1:JVI2FwdSQMPgQGRrTdsM6SEfy7eKd0F93VkweoNp3b4=
github.com/labring/sreg v0.1.1/go.mod h1:d519C7n2ekJJX6KxsUV78MeKO5Zon+atP4FkfwB++DM=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/letsencrypt/boulder v0.0.0-20230213213521-fdfea0d469b6 h1:unJdfS94Y3k85TKy+mvKzjW5R9rIC+Lv4KGbE7uNu0I=
Expand Down
7 changes: 4 additions & 3 deletions pkg/buildah/imagesaver.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"runtime"
"strings"

"github.com/labring/sealos/pkg/registry/crane"
"github.com/labring/sealos/pkg/registry/save"
"github.com/labring/sreg/pkg/registry/crane"
"github.com/labring/sreg/pkg/registry/save"

"github.com/containerd/containerd/platforms"
"github.com/containers/buildah/pkg/parse"
Expand All @@ -30,7 +30,8 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/labring/sealos/pkg/buildimage"
"github.com/labring/sreg/pkg/buildimage"

"github.com/labring/sealos/pkg/constants"
"github.com/labring/sealos/pkg/utils/logger"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/buildah/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"path"
"strings"

"github.com/labring/sealos/pkg/image"

"github.com/containers/buildah/pkg/parse"

"github.com/containers/buildah"
Expand All @@ -30,8 +32,6 @@ import (
v1 "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/spf13/cobra"

"github.com/labring/sealos/pkg/buildimage"

"github.com/labring/sealos/pkg/utils/logger"
"github.com/labring/sealos/pkg/utils/rand"
)
Expand Down Expand Up @@ -153,7 +153,7 @@ func mergeImagesWithScratchContainer(newImageName string, images []string, sette
}
}

dockerfile, err := buildimage.MergeDockerfileFromImages(imageObjList)
dockerfile, err := image.MergeDockerfileFromImages(imageObjList)
if err != nil {
return nil, err
}
Expand Down
148 changes: 0 additions & 148 deletions pkg/buildimage/chart.go

This file was deleted.

53 changes: 0 additions & 53 deletions pkg/buildimage/chart_test.go

This file was deleted.

Loading

0 comments on commit ada947f

Please sign in to comment.