mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
Merge pull request #1317 from 24sama/master
Fix: remove kubekey/artifact dir after exporting an artifact
This commit is contained in:
commit
68c2f94cf9
|
|
@ -18,17 +18,19 @@ package artifact
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/kubesphere/kubekey/pkg/common"
|
||||
"github.com/kubesphere/kubekey/pkg/core/connector"
|
||||
"github.com/kubesphere/kubekey/pkg/core/logger"
|
||||
coreutil "github.com/kubesphere/kubekey/pkg/core/util"
|
||||
"github.com/pkg/errors"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/kubesphere/kubekey/pkg/common"
|
||||
"github.com/kubesphere/kubekey/pkg/core/connector"
|
||||
"github.com/kubesphere/kubekey/pkg/core/logger"
|
||||
coreutil "github.com/kubesphere/kubekey/pkg/core/util"
|
||||
)
|
||||
|
||||
type DownloadISOFile struct {
|
||||
|
|
@ -107,6 +109,11 @@ func (a *ArchiveDependencies) Execute(runtime connector.Runtime) error {
|
|||
if err := coreutil.Tar(src, a.Manifest.Arg.Output, src); err != nil {
|
||||
return errors.Wrapf(errors.WithStack(err), "archive %s failed", src)
|
||||
}
|
||||
|
||||
// remove the src directory
|
||||
if err := os.RemoveAll(src); err != nil {
|
||||
return errors.Wrapf(errors.WithStack(err), "remove %s failed", src)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue