Skip to content

Commit

Permalink
i/statemachine: Get rid of unused verbose param in CreateTarArchive &…
Browse files Browse the repository at this point in the history
… ExtractTarArchive

Signed-off-by: Paul Mars <[email protected]>
  • Loading branch information
upils committed Oct 9, 2024
1 parent 5fe5ac9 commit 7bdc2a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions internal/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func SafeQuantitySubtraction(orig, subtract quantity.Size) quantity.Size {
// CreateTarArchive places all of the files from a source directory into a tar.
// Currently supported are uncompressed tar archives and the following
// compression types: gzip, xz bzip2, zstd
func CreateTarArchive(src, dest, compression string, verbose, debug bool) error {
func CreateTarArchive(src, dest, compression string, debug bool) error {
tarCommand := exec.Command(
"tar",
"--directory",
Expand Down Expand Up @@ -418,7 +418,7 @@ func CreateTarArchive(src, dest, compression string, verbose, debug bool) error
// ExtractTarArchive extracts all the files from a tar. Currently supported are
// uncompressed tar archives and the following compression types: zip, gzip, xz
// bzip2, zstd
func ExtractTarArchive(src, dest string, verbose, debug bool) error {
func ExtractTarArchive(src, dest string, debug bool) error {
tarCommand := exec.Command(
"tar",
"--xattrs",
Expand Down
6 changes: 3 additions & 3 deletions internal/helper/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,10 @@ func TestTarXattrs(t *testing.T) {

// now run the helper tar creation and extraction functions
tarPath := filepath.Join(testDir, "test-xattrs.tar")
err = CreateTarArchive(testDir, tarPath, "uncompressed", false, false)
err = CreateTarArchive(testDir, tarPath, "uncompressed", false)
asserter.AssertErrNil(err, true)

err = ExtractTarArchive(tarPath, extractDir, false, false)
err = ExtractTarArchive(tarPath, extractDir, false)
asserter.AssertErrNil(err, true)

// now read the extracted file's extended attributes
Expand All @@ -569,7 +569,7 @@ func TestPingXattrs(t *testing.T) {
t.Cleanup(func() { os.RemoveAll(testDir) })
testFile := filepath.Join("testdata", "rootfs_tarballs", "ping.tar")

err = ExtractTarArchive(testFile, testDir, true, true)
err = ExtractTarArchive(testFile, testDir, true)
asserter.AssertErrNil(err, true)

binPing := filepath.Join(testDir, "bin", "ping")
Expand Down
3 changes: 1 addition & 2 deletions internal/statemachine/classic_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,7 @@ func (stateMachine *StateMachine) extractRootfsTar() error {
}

// now extract the archive
return helper.ExtractTarArchive(tarPath, stateMachine.tempDirs.chroot,
stateMachine.commonFlags.Verbose, stateMachine.commonFlags.Debug)
return helper.ExtractTarArchive(tarPath, stateMachine.tempDirs.chroot, stateMachine.commonFlags.Debug)
}

var germinateState = stateFunc{"germinate", (*StateMachine).germinate}
Expand Down

0 comments on commit 7bdc2a2

Please sign in to comment.