Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: forbid "werf run" in Buildah mode
Signed-off-by: Ilya Lesikov <ilya@lesikov.com>
  • Loading branch information
ilya-lesikov committed Oct 13, 2023
1 parent e099cd4 commit 09fb5bd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/werf/run/run.go
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/werf/logboek"
"github.com/werf/werf/cmd/werf/common"
"github.com/werf/werf/pkg/build"
"github.com/werf/werf/pkg/buildah"
"github.com/werf/werf/pkg/container_backend"
"github.com/werf/werf/pkg/docker"
"github.com/werf/werf/pkg/git_repo"
Expand Down Expand Up @@ -70,6 +71,12 @@ func NewCmd(ctx context.Context) *cobra.Command {
common.DocsLongMD: GetRunDocs().LongMD,
},
RunE: func(cmd *cobra.Command, args []string) error {
if mode, _, err := common.GetBuildahMode(); err != nil {
return err
} else if *mode != buildah.ModeDisabled {
return fmt.Errorf(`command "werf run" is not implemented for Buildah mode`)
}

ctx := cmd.Context()

defer global_warnings.PrintGlobalWarnings(ctx)
Expand Down

0 comments on commit 09fb5bd

Please sign in to comment.