Skip to content

Docker mode: TGZArchiver.fromFile() fails on jar/zip input #134

Description

@stokpop

Finding

When Execute(name, "/path/to/fat.jar") receives a regular file (not a directory), TGZArchiver.fromFile() assumes gzip+tar format:

// tgz_archiver.go:135
zr, err := gzip.NewReader(file)

This fails on jar/zip files with "gzip: invalid header".

CF vs Docker divergence

  • CF mode (setup.go:337): calls cf push name -p source — CF CLI + bits service handles jar/zip extraction, so Execute(name, "/path/to/fat.jar") works.
  • Docker mode (setup.go:105): calls archiver.Compress(path, source) which hits fromFile() — only gzip+tar is supported. Jars/zips fail.

Impact

Test authors who pass a jar file directly to Execute() get a passing test on CF but a broken test on Docker. The workaround is to pre-explode the jar into a directory before passing to Execute().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions