Skip to content

Commit

Permalink
Merge pull request #2143 from saschagrunert/compress
Browse files Browse the repository at this point in the history
Fix archive tarball compression bug
  • Loading branch information
k8s-ci-robot committed Jun 23, 2021
2 parents 0e85c33 + 80ffd0b commit 07c3973
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions pkg/release/archive.go
Expand Up @@ -289,14 +289,20 @@ func (a *defaultArchiverImpl) CopyReleaseToBucket(releaseBuildDir, archiveBucket
return errors.Wrap(err, "normalizing destination path")
}

tarball := releaseBuildDir + ".tar.gz"
logrus.Infof("Compressing %s to %s", releaseBuildDir, tarball)
if err := tar.Compress(tarball, releaseBuildDir); err != nil {
srcPath := filepath.Join(releaseBuildDir, "k8s.io")
tarball := srcPath + ".tar.gz"
logrus.Infof("Compressing %s to %s", srcPath, tarball)
if err := tar.Compress(tarball, srcPath); err != nil {
return errors.Wrap(err, "create source tarball")
}

logrus.Infof("Copy %s to %s", tarball, remoteDest)
if err := gcs.CopyToRemote(tarball, remoteDest); err != nil {
logrus.Infof("Removing source path %s before syncing", srcPath)
if err := os.RemoveAll(srcPath); err != nil {
return errors.Wrap(err, "remove source path")
}

logrus.Infof("Rsync %s to %s", releaseBuildDir, remoteDest)
if err := gcs.RsyncRecursive(releaseBuildDir, remoteDest); err != nil {
return errors.Wrap(err, "copying release directory to bucket")
}
return nil
Expand Down

0 comments on commit 07c3973

Please sign in to comment.