Skip to content
Permalink
Browse files
fix: panic when auto host cleanup runs in some werf commands
Disable auto host cleanup when buildah build runtime is used.

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Feb 21, 2022
1 parent 5202e5d commit a7064ff89a4104853e84033ad851dd52aa9f2667
Showing with 19 additions and 1 deletion.
  1. +4 −0 cmd/werf/bundle/export/export.go
  2. +4 −0 cmd/werf/bundle/publish/publish.go
  3. +4 −0 cmd/werf/cleanup/cleanup.go
  4. +3 −0 cmd/werf/compose/main.go
  5. +3 −0 cmd/werf/converge/converge.go
  6. +1 −1 cmd/werf/dismiss/dismiss.go
@@ -17,6 +17,7 @@ import (
"github.com/werf/werf/cmd/werf/common"
"github.com/werf/werf/pkg/build"
"github.com/werf/werf/pkg/config"
"github.com/werf/werf/pkg/container_runtime"
"github.com/werf/werf/pkg/deploy/helm/chart_extender"
"github.com/werf/werf/pkg/deploy/helm/chart_extender/helpers"
"github.com/werf/werf/pkg/git_repo"
@@ -162,6 +163,9 @@ func runExport(ctx context.Context) error {
}

defer func() {
if _, match := containerRuntime.(*container_runtime.DockerServerRuntime); !match {
return
}
if err := common.RunAutoHostCleanup(ctx, &commonCmdData); err != nil {
logboek.Context(ctx).Error().LogF("Auto host cleanup failed: %s\n", err)
}
@@ -20,6 +20,7 @@ import (
"github.com/werf/werf/cmd/werf/common"
"github.com/werf/werf/pkg/build"
"github.com/werf/werf/pkg/config"
"github.com/werf/werf/pkg/container_runtime"
"github.com/werf/werf/pkg/deploy/bundles"
"github.com/werf/werf/pkg/deploy/helm/chart_extender"
"github.com/werf/werf/pkg/deploy/helm/chart_extender/helpers"
@@ -178,6 +179,9 @@ func runPublish(ctx context.Context) error {
}

defer func() {
if _, match := containerRuntime.(*container_runtime.DockerServerRuntime); !match {
return
}
if err := common.RunAutoHostCleanup(ctx, &commonCmdData); err != nil {
logboek.Context(ctx).Error().LogF("Auto host cleanup failed: %s\n", err)
}
@@ -9,6 +9,7 @@ import (
"github.com/werf/logboek"
"github.com/werf/werf/cmd/werf/common"
"github.com/werf/werf/pkg/cleaning"
"github.com/werf/werf/pkg/container_runtime"
"github.com/werf/werf/pkg/git_repo"
"github.com/werf/werf/pkg/git_repo/gitdata"
"github.com/werf/werf/pkg/image"
@@ -133,6 +134,9 @@ func runCleanup(ctx context.Context) error {
}

defer func() {
if _, match := containerRuntime.(*container_runtime.DockerServerRuntime); !match {
return
}
if err := common.RunAutoHostCleanup(ctx, &commonCmdData); err != nil {
logboek.Context(ctx).Error().LogF("Auto host cleanup failed: %s\n", err)
}
@@ -323,6 +323,9 @@ func runMain(ctx context.Context, dockerComposeCmdName string, cmdData composeCm
}

defer func() {
if _, match := containerRuntime.(*container_runtime.DockerServerRuntime); !match {
return
}
if err := common.RunAutoHostCleanup(ctx, &commonCmdData); err != nil {
logboek.Context(ctx).Error().LogF("Auto host cleanup failed: %s\n", err)
}
@@ -203,6 +203,9 @@ func runMain(ctx context.Context) error {
}

defer func() {
if _, match := containerRuntime.(*container_runtime.DockerServerRuntime); !match {
return
}
if err := common.RunAutoHostCleanup(ctx, &commonCmdData); err != nil {
logboek.Context(ctx).Error().LogF("Auto host cleanup failed: %s\n", err)
}
@@ -6,7 +6,7 @@ import (
"time"

"github.com/spf13/cobra"
helm_v3 "helm.sh/helm/v3/cmd/helm"
"helm.sh/helm/v3/cmd/helm"
"helm.sh/helm/v3/pkg/action"

"github.com/werf/kubedog/pkg/kube"

0 comments on commit a7064ff

Please sign in to comment.