Skip to content

Commit 8f09c66

Browse files
Merge pull request #2240 from zcahana/bundle_gzip
Enable gzip compression when unpacking bundles to ConfigMap
2 parents f87b076 + 7c481a1 commit 8f09c66

File tree

100 files changed

+6483
-787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+6483
-787
lines changed

.github/workflows/test-scripts.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v2
26+
- uses: actions/setup-go@v2
27+
with:
28+
go-version: '~1.16'
2629
- run: |
2730
sudo apt-get install conntrack
2831
curl -sLo minikube "$(curl -sL https://api.github.com/repos/kubernetes/minikube/releases/latest | jq -r '[.assets[] | select(.name == "minikube-linux-amd64")] | first | .browser_download_url')"
@@ -34,6 +37,9 @@ jobs:
3437
runs-on: ubuntu-latest
3538
steps:
3639
- uses: actions/checkout@v2
40+
- uses: actions/setup-go@v2
41+
with:
42+
go-version: '~1.16'
3743
- run: |
3844
curl -sLo kind "$(curl -sL https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r '[.assets[] | select(.name == "kind-linux-amd64")] | first | .browser_download_url')"
3945
chmod +x kind

cmd/catalog/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ const (
2828
catalogNamespaceEnvVarName = "GLOBAL_CATALOG_NAMESPACE"
2929
defaultWakeupInterval = 15 * time.Minute
3030
defaultCatalogNamespace = "openshift-operator-lifecycle-manager"
31-
defaultConfigMapServerImage = "quay.io/operatorframework/configmap-operator-registry:latest"
31+
defaultConfigMapServerImage = "quay.io/operator-framework/configmap-operator-registry:latest"
32+
defaultOPMImage = "quay.io/operator-framework/upstream-opm-builder:latest"
3233
defaultUtilImage = "quay.io/operator-framework/olm:latest"
3334
defaultOperatorName = ""
3435
)
@@ -47,6 +48,9 @@ var (
4748
configmapServerImage = flag.String(
4849
"configmapServerImage", defaultConfigMapServerImage, "the image to use for serving the operator registry api for a configmap")
4950

51+
opmImage = flag.String(
52+
"opmImage", defaultOPMImage, "the image to use for unpacking bundle content with opm")
53+
5054
utilImage = flag.String(
5155
"util-image", defaultUtilImage, "an image containing custom olm utilities")
5256

@@ -131,7 +135,7 @@ func main() {
131135
}
132136

133137
// Create a new instance of the operator.
134-
op, err := catalog.NewOperator(ctx, *kubeConfigPath, utilclock.RealClock{}, logger, *wakeupInterval, *configmapServerImage, *utilImage, *catalogNamespace, k8sscheme.Scheme, *installPlanTimeout, *bundleUnpackTimeout)
138+
op, err := catalog.NewOperator(ctx, *kubeConfigPath, utilclock.RealClock{}, logger, *wakeupInterval, *configmapServerImage, *opmImage, *utilImage, *catalogNamespace, k8sscheme.Scheme, *installPlanTimeout, *bundleUnpackTimeout)
135139
if err != nil {
136140
log.Panicf("error configuring operator: %s", err.Error())
137141
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require (
2525
github.com/openshift/api v0.0.0-20200331152225-585af27e34fd
2626
github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0
2727
github.com/operator-framework/api v0.10.1
28-
github.com/operator-framework/operator-registry v1.13.6
28+
github.com/operator-framework/operator-registry v1.17.5
2929
github.com/otiai10/copy v1.2.0
3030
github.com/pkg/errors v0.9.1
3131
github.com/prometheus/client_golang v1.11.0

go.sum

Lines changed: 74 additions & 31 deletions
Large diffs are not rendered by default.

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,

pkg/controller/operators/catalog/operator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ type Operator struct {
115115
type CatalogSourceSyncFunc func(logger *logrus.Entry, in *v1alpha1.CatalogSource) (out *v1alpha1.CatalogSource, continueSync bool, syncError error)
116116

117117
// NewOperator creates a new Catalog Operator.
118-
func NewOperator(ctx context.Context, kubeconfigPath string, clock utilclock.Clock, logger *logrus.Logger, resync time.Duration, configmapRegistryImage, utilImage string, operatorNamespace string, scheme *runtime.Scheme, installPlanTimeout time.Duration, bundleUnpackTimeout time.Duration) (*Operator, error) {
118+
func NewOperator(ctx context.Context, kubeconfigPath string, clock utilclock.Clock, logger *logrus.Logger, resync time.Duration, configmapRegistryImage, opmImage, utilImage string, operatorNamespace string, scheme *runtime.Scheme, installPlanTimeout time.Duration, bundleUnpackTimeout time.Duration) (*Operator, error) {
119119
resyncPeriod := queueinformer.ResyncWithJitter(resync, 0.2)
120120
config, err := clientcmd.BuildConfigFromFlags("", kubeconfigPath)
121121
if err != nil {
@@ -351,7 +351,7 @@ func NewOperator(ctx context.Context, kubeconfigPath string, clock utilclock.Clo
351351
bundle.WithPodLister(podInformer.Lister()),
352352
bundle.WithRoleLister(roleInformer.Lister()),
353353
bundle.WithRoleBindingLister(roleBindingInformer.Lister()),
354-
bundle.WithOPMImage(configmapRegistryImage),
354+
bundle.WithOPMImage(opmImage),
355355
bundle.WithUtilImage(utilImage),
356356
bundle.WithNow(op.now),
357357
bundle.WithUnpackTimeout(op.bundleUnpackTimeout),

pkg/fakes/fake_registry_store.go

Lines changed: 158 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/h2non/filetype/.editorconfig

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/h2non/filetype/.gitignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/h2non/filetype/.travis.yml

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)