Skip to content

Commit

Permalink
fix: create new container mount when force override (#4068) (#4072) (#…
Browse files Browse the repository at this point in the history
…4079)

(cherry picked from commit 4242e7c)

Signed-off-by: fengxsong <fengxsong@outlook.com>
Signed-off-by: cuisongliu <cuisongliu@qq.com>
Co-authored-by: sealos-ci-robot <109538726+sealos-ci-robot@users.noreply.github.com>
Co-authored-by: fengxsong <fengxsong@outlook.com>
  • Loading branch information
3 people committed Oct 12, 2023
1 parent ff6ac8c commit 34236b4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/apply/processor/install.go
Expand Up @@ -19,6 +19,8 @@ import (
"fmt"
"strings"

"github.com/labring/sealos/pkg/utils/rand"

"golang.org/x/sync/errgroup"
"k8s.io/apimachinery/pkg/util/sets"

Expand All @@ -32,7 +34,6 @@ import (
"github.com/labring/sealos/pkg/utils/confirm"
"github.com/labring/sealos/pkg/utils/logger"
"github.com/labring/sealos/pkg/utils/maps"
"github.com/labring/sealos/pkg/utils/rand"
)

var ForceOverride bool
Expand Down Expand Up @@ -145,11 +146,12 @@ func (c *InstallProcessor) PreProcess(cluster *v2.Cluster) error {
if !ForceOverride {
continue
}
ctrName = mount.Name
logger.Debug("trying to override app %s", img)
} else {
ctrName = rand.Generator(8)
if err := c.Buildah.Delete(mount.Name); err != nil {
return err
}
}
ctrName = rand.Generator(8)
cluster.Spec.Image = merge(cluster.Spec.Image, img)
bderInfo, err := c.Buildah.Create(ctrName, img)
if err != nil {
Expand Down

0 comments on commit 34236b4

Please sign in to comment.