From fd344476b1d04b9439590c5fd0da81d7efc3b600 Mon Sep 17 00:00:00 2001 From: Zvi Cahana Date: Wed, 7 Jul 2021 18:18:56 +0300 Subject: [PATCH] Enable gzip compression when unpacking bundles to ConfigMap Signed-off-by: Zvi Cahana --- pkg/controller/bundle/bundle_unpacker.go | 11 ++++++++--- pkg/controller/bundle/bundle_unpacker_test.go | 12 ++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pkg/controller/bundle/bundle_unpacker.go b/pkg/controller/bundle/bundle_unpacker.go index 67e86de300..962e8066dd 100644 --- a/pkg/controller/bundle/bundle_unpacker.go +++ b/pkg/controller/bundle/bundle_unpacker.go @@ -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, diff --git a/pkg/controller/bundle/bundle_unpacker_test.go b/pkg/controller/bundle/bundle_unpacker_test.go index 0149606048..5d8ff740ab 100644 --- a/pkg/controller/bundle/bundle_unpacker_test.go +++ b/pkg/controller/bundle/bundle_unpacker_test.go @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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,