Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove build type flag for build command #1671

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
remove build type flag for build command
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
  • Loading branch information
allencloud committed Aug 26, 2022
commit d061a689890e65a7c932db83a1c563f9da9b69a5
2 changes: 0 additions & 2 deletions cmd/sealer/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
type BuildFlag struct {
ImageName string
KubefileName string
BuildType string
BuildArgs []string
Platform string
NoCache bool
Expand Down Expand Up @@ -157,7 +156,6 @@ func buildSealerImage() error {
}

func init() {
buildCmd.Flags().StringVarP(&buildFlags.BuildType, "mode", "m", "lite", "ClusterImage build type, default is lite")
buildCmd.Flags().StringVarP(&buildFlags.Kubefile, "file", "f", "Kubefile", "Kubefile filepath")
buildCmd.Flags().StringVar(&buildFlags.Platform, "platform", parse.DefaultPlatform(), "set the target platform, like linux/amd64 or linux/amd64/v7")
buildCmd.Flags().StringVar(&buildFlags.PullPolicy, "pull", "", "pull policy. Allow for --pull, --pull=true, --pull=false, --pull=never, --pull=always")
Expand Down
2 changes: 0 additions & 2 deletions docs/design/build_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Context 结构体

```yaml
BuildContext: 构建的上下文。
BuildType: 构建的类型。
UseCache: 标志位,用于检测是否使用缓存。
```

Expand Down Expand Up @@ -157,7 +156,6 @@ ExecContext 结构体

```yaml
BuildContext: 构建的上下文。
BuildType: 构建的类型。
ContinueCache: 标志位,用于检测是否继续使用缓存,会在每一层layer执行的时候修改。
ParentID cache.ChainID: 缓存chain id,起始值为 ""。会在每一层layer执行的时候修改为包括当前layer的chain id。
CacheSvc cache.Service: 缓存layer生成接口,根据当前layer和cache id,生成对应的缓存layer。用于和ParentID一起,生成当前的chain id。
Expand Down
1 change: 0 additions & 1 deletion pkg/define/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package options

// BuildOptions should be out of buildah scope.
type BuildOptions struct {
BuildType string
Kubefile string
Tags []string
NoCache bool
Expand Down
1 change: 0 additions & 1 deletion test/sealer_build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ var _ = Describe("sealer build", func() {
SetKubeFile("Kubefile").
SetImageName(imageName).
SetContext(".").
SetBuildType(settings.LiteBuild).
Build()
sess, err := testhelper.Start(cmd)
testhelper.CheckErr(err)
Expand Down
12 changes: 2 additions & 10 deletions test/suites/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func GetTestImageName() string {
}

type ArgsOfBuild struct {
KubeFile, ImageName, Context, BuildType string
KubeFile, ImageName, Context string
}

func (a *ArgsOfBuild) SetKubeFile(kubeFile string) *ArgsOfBuild {
Expand All @@ -68,11 +68,6 @@ func (a *ArgsOfBuild) SetContext(context string) *ArgsOfBuild {
return a
}

func (a *ArgsOfBuild) SetBuildType(buildType string) *ArgsOfBuild {
a.BuildType = buildType
return a
}

func (a *ArgsOfBuild) Build() string {
if settings.DefaultSealerBin == "" || a.KubeFile == "" || a.ImageName == "" {
return ""
Expand All @@ -82,10 +77,7 @@ func (a *ArgsOfBuild) Build() string {
a.Context = "."
}

if a.BuildType == "" {
a.BuildType = settings.LiteBuild
}
return fmt.Sprintf("%s build -f %s -t %s -m %s %s -d", settings.DefaultSealerBin, a.KubeFile, a.ImageName, a.BuildType, a.Context)
return fmt.Sprintf("%s build -f %s -t %s %s -d", settings.DefaultSealerBin, a.KubeFile, a.ImageName, a.Context)
}

func NewArgsOfBuild() *ArgsOfBuild {
Expand Down