Skip to content

Commit

Permalink
Enable gzip compression when unpacking bundles to ConfigMap
Browse files Browse the repository at this point in the history
Signed-off-by: Zvi Cahana <zvic@il.ibm.com>
  • Loading branch information
zcahana committed Jul 15, 2021
1 parent f87b076 commit fd34447
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
11 changes: 8 additions & 3 deletions pkg/controller/bundle/bundle_unpacker.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,14 @@ func (c *ConfigMapUnpacker) job(cmRef *corev1.ObjectReference, bundlePath string
ImagePullSecrets: secrets,
Containers: []corev1.Container{
{
Name: "extract",
Image: c.opmImage,
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", cmRef.Namespace, "-c", cmRef.Name},
Name: "extract",
Image: c.opmImage,
Command: []string{"opm", "alpha", "bundle", "extract",
"-m", "/bundle/",
"-n", cmRef.Namespace,
"-c", cmRef.Name,
"-z",
},
Env: []corev1.EnvVar{
{
Name: configmap.EnvContainerImage,
Expand Down
12 changes: 6 additions & 6 deletions pkg/controller/bundle/bundle_unpacker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func TestConfigMapUnpacker(t *testing.T) {
{
Name: "extract",
Image: opmImage,
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
Env: []corev1.EnvVar{
{
Name: configmap.EnvContainerImage,
Expand Down Expand Up @@ -399,7 +399,7 @@ func TestConfigMapUnpacker(t *testing.T) {
{
Name: "extract",
Image: opmImage,
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
Env: []corev1.EnvVar{
{
Name: configmap.EnvContainerImage,
Expand Down Expand Up @@ -616,7 +616,7 @@ func TestConfigMapUnpacker(t *testing.T) {
{
Name: "extract",
Image: opmImage,
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
Env: []corev1.EnvVar{
{
Name: configmap.EnvContainerImage,
Expand Down Expand Up @@ -828,7 +828,7 @@ func TestConfigMapUnpacker(t *testing.T) {
{
Name: "extract",
Image: opmImage,
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
Env: []corev1.EnvVar{
{
Name: configmap.EnvContainerImage,
Expand Down Expand Up @@ -1010,7 +1010,7 @@ func TestConfigMapUnpacker(t *testing.T) {
{
Name: "extract",
Image: opmImage,
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
Env: []corev1.EnvVar{
{
Name: configmap.EnvContainerImage,
Expand Down Expand Up @@ -1203,7 +1203,7 @@ func TestConfigMapUnpacker(t *testing.T) {
{
Name: "extract",
Image: opmImage,
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
Env: []corev1.EnvVar{
{
Name: configmap.EnvContainerImage,
Expand Down

0 comments on commit fd34447

Please sign in to comment.