Skip to content

Commit fd34447

Browse files
committed
Enable gzip compression when unpacking bundles to ConfigMap
Signed-off-by: Zvi Cahana <[email protected]>
1 parent f87b076 commit fd34447

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

pkg/controller/bundle/bundle_unpacker.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,14 @@ func (c *ConfigMapUnpacker) job(cmRef *corev1.ObjectReference, bundlePath string
100100
ImagePullSecrets: secrets,
101101
Containers: []corev1.Container{
102102
{
103-
Name: "extract",
104-
Image: c.opmImage,
105-
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", cmRef.Namespace, "-c", cmRef.Name},
103+
Name: "extract",
104+
Image: c.opmImage,
105+
Command: []string{"opm", "alpha", "bundle", "extract",
106+
"-m", "/bundle/",
107+
"-n", cmRef.Namespace,
108+
"-c", cmRef.Name,
109+
"-z",
110+
},
106111
Env: []corev1.EnvVar{
107112
{
108113
Name: configmap.EnvContainerImage,

pkg/controller/bundle/bundle_unpacker_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func TestConfigMapUnpacker(t *testing.T) {
222222
{
223223
Name: "extract",
224224
Image: opmImage,
225-
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
225+
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
226226
Env: []corev1.EnvVar{
227227
{
228228
Name: configmap.EnvContainerImage,
@@ -399,7 +399,7 @@ func TestConfigMapUnpacker(t *testing.T) {
399399
{
400400
Name: "extract",
401401
Image: opmImage,
402-
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
402+
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
403403
Env: []corev1.EnvVar{
404404
{
405405
Name: configmap.EnvContainerImage,
@@ -616,7 +616,7 @@ func TestConfigMapUnpacker(t *testing.T) {
616616
{
617617
Name: "extract",
618618
Image: opmImage,
619-
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
619+
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
620620
Env: []corev1.EnvVar{
621621
{
622622
Name: configmap.EnvContainerImage,
@@ -828,7 +828,7 @@ func TestConfigMapUnpacker(t *testing.T) {
828828
{
829829
Name: "extract",
830830
Image: opmImage,
831-
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
831+
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
832832
Env: []corev1.EnvVar{
833833
{
834834
Name: configmap.EnvContainerImage,
@@ -1010,7 +1010,7 @@ func TestConfigMapUnpacker(t *testing.T) {
10101010
{
10111011
Name: "extract",
10121012
Image: opmImage,
1013-
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
1013+
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
10141014
Env: []corev1.EnvVar{
10151015
{
10161016
Name: configmap.EnvContainerImage,
@@ -1203,7 +1203,7 @@ func TestConfigMapUnpacker(t *testing.T) {
12031203
{
12041204
Name: "extract",
12051205
Image: opmImage,
1206-
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash},
1206+
Command: []string{"opm", "alpha", "bundle", "extract", "-m", "/bundle/", "-n", "ns-a", "-c", pathHash, "-z"},
12071207
Env: []corev1.EnvVar{
12081208
{
12091209
Name: configmap.EnvContainerImage,

0 commit comments

Comments
 (0)