image: panic if unknown compression option is specified
Currently we only support "xz", but keeping it as a `switch` to easily support more types in the future. The empty string is also supported as a no-op.
This commit is contained in:
parent
6374ec022d
commit
b3f4d75699
1 changed files with 6 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package image
|
package image
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
|
||||||
"github.com/osbuild/osbuild-composer/internal/artifact"
|
"github.com/osbuild/osbuild-composer/internal/artifact"
|
||||||
|
|
@ -99,6 +100,11 @@ func (img *LiveImage) InstantiateManifest(m *manifest.Manifest,
|
||||||
xzPipeline := manifest.NewXZ(m, buildPipeline, artifactPipeline)
|
xzPipeline := manifest.NewXZ(m, buildPipeline, artifactPipeline)
|
||||||
xzPipeline.Filename = img.Filename
|
xzPipeline.Filename = img.Filename
|
||||||
artifact = xzPipeline.Export()
|
artifact = xzPipeline.Export()
|
||||||
|
case "":
|
||||||
|
// do nothing
|
||||||
|
default:
|
||||||
|
// panic on unknown strings
|
||||||
|
panic(fmt.Sprintf("unsupported compression type %q", img.Compression))
|
||||||
}
|
}
|
||||||
|
|
||||||
return artifact, nil
|
return artifact, nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue