diff --git a/src/cp.ts b/src/cp.ts index 8b312d67be..c13dcecae2 100644 --- a/src/cp.ts +++ b/src/cp.ts @@ -28,7 +28,7 @@ export class Cp { ): Promise { const tmpFile = tmp.fileSync(); const tmpFileName = tmpFile.name; - const command = ['tar', 'cf', '-', srcPath]; + const command = ['tar', 'zcf', '-', srcPath]; const writerStream = fs.createWriteStream(tmpFileName); const errStream = new WritableStreamBuffer(); this.execInstance.exec( diff --git a/src/cp_test.ts b/src/cp_test.ts index 72b78bd522..c6b5b06968 100644 --- a/src/cp_test.ts +++ b/src/cp_test.ts @@ -21,7 +21,7 @@ describe('Cp', () => { const container = 'container'; const srcPath = '/'; const tgtPath = '/'; - const cmdArray = ['tar', 'cf', '-', srcPath]; + const cmdArray = ['tar', 'zcf', '-', srcPath]; const path = `/api/v1/namespaces/${namespace}/pods/${pod}/exec`; const query = {