Skip to content

Commit

Permalink
refactor: remove unused namespace param
Browse files Browse the repository at this point in the history
Signed-off-by: Teresa Romero <teresa@okteto.com>
  • Loading branch information
teresaromero committed Nov 11, 2021
1 parent 955d560 commit 18c7b8e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func Build(ctx context.Context) *cobra.Command {
}

ctx := context.Background()
if err := build.Run(ctx, "", options); err != nil {
if err := build.Run(ctx, options); err != nil {
analytics.TrackBuild(okteto.Context().Builder, false)
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func buildImage(ctx context.Context, dev *model.Dev, imageTag, imageFromApp, okt
BuildArgs: buildArgs,
OutputMode: progress,
}
if err := build.Run(ctx, dev.Namespace, buildOptions); err != nil {
if err := build.Run(ctx, buildOptions); err != nil {
return "", err
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/up/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func (up *upContext) buildDevImage(ctx context.Context, app apps.App) error {
BuildArgs: buildArgs,
OutputMode: "tty",
}
if err := buildCMD.Run(ctx, up.Dev.Namespace, buildOptions); err != nil {
if err := buildCMD.Run(ctx, buildOptions); err != nil {
return err
}
for _, s := range up.Dev.Services {
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ type BuildOptions struct {
}

// Run runs the build sequence
func Run(ctx context.Context, namespace string, buildOptions BuildOptions) error {
func Run(ctx context.Context, buildOptions BuildOptions) error {
if okteto.Context().Builder == "" {
if err := buildWithDocker(ctx, buildOptions); err != nil {
return err
}
} else {
if err := buildWithOkteto(ctx, namespace, buildOptions); err != nil {
if err := buildWithOkteto(ctx, buildOptions); err != nil {
return err
}
}
return nil
}

func buildWithOkteto(ctx context.Context, namespace string, buildOptions BuildOptions) error {
func buildWithOkteto(ctx context.Context, buildOptions BuildOptions) error {
log.Infof("building your image on %s", okteto.Context().Builder)
buildkitClient, err := getBuildkitClient(ctx)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/stack/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func buildServices(ctx context.Context, s *model.Stack, options *StackDeployOpti
BuildArgs: buildArgs,
OutputMode: options.Progress,
}
if err := build.Run(ctx, s.Namespace, buildOptions); err != nil {
if err := build.Run(ctx, buildOptions); err != nil {
return hasBuiltSomething, err
}
svc.SetLastBuiltAnnotation()
Expand Down Expand Up @@ -219,7 +219,7 @@ func addVolumeMountsToBuiltImage(ctx context.Context, s *model.Stack, options *S
BuildArgs: buildArgs,
OutputMode: options.Progress,
}
if err := build.Run(ctx, s.Namespace, buildOptions); err != nil {
if err := build.Run(ctx, buildOptions); err != nil {
return hasAddedAnyVolumeMounts, err
}
svc.SetLastBuiltAnnotation()
Expand Down

0 comments on commit 18c7b8e

Please sign in to comment.