Skip to content

Commit e8b9580

Browse files
committed
refactor(resolve): simplify bundle lookups
1 parent aee24f4 commit e8b9580

File tree

398 files changed

+29934
-4205
lines changed

Some content is hidden

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

398 files changed

+29934
-4205
lines changed

cmd/catalog/main.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ import (
77
"fmt"
88
"net/http"
99
"os"
10-
"strings"
1110
"time"
1211

1312
configv1client "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1"
1413
"github.com/prometheus/client_golang/prometheus/promhttp"
1514
log "github.com/sirupsen/logrus"
16-
v1 "k8s.io/api/core/v1"
1715
utilclock "k8s.io/apimachinery/pkg/util/clock"
1816
"k8s.io/client-go/tools/clientcmd"
1917

@@ -44,9 +42,6 @@ var (
4442
wakeupInterval = flag.Duration(
4543
"interval", defaultWakeupInterval, "wakeup interval")
4644

47-
watchedNamespaces = flag.String(
48-
"watchedNamespaces", "", "comma separated list of namespaces that catalog watches, leave empty to watch all namespaces")
49-
5045
catalogNamespace = flag.String(
5146
"namespace", defaultCatalogNamespace, "namespace where catalog will run and install catalog resources")
5247

@@ -91,16 +86,6 @@ func main() {
9186
os.Exit(0)
9287
}
9388

94-
// `namespaces` will always contain at least one entry: if `*watchedNamespaces` is
95-
// the empty string, the resulting array will be `[]string{""}`.
96-
namespaces := strings.Split(*watchedNamespaces, ",")
97-
for _, ns := range namespaces {
98-
if ns == v1.NamespaceAll {
99-
namespaces = []string{v1.NamespaceAll}
100-
break
101-
}
102-
}
103-
10489
logger := log.New()
10590
if *debug {
10691
logger.SetLevel(log.DebugLevel)
@@ -183,7 +168,7 @@ func main() {
183168
}
184169

185170
// Create a new instance of the operator.
186-
op, err := catalog.NewOperator(ctx, *kubeConfigPath, utilclock.RealClock{}, logger, *wakeupInterval, *configmapServerImage, *catalogNamespace, namespaces...)
171+
op, err := catalog.NewOperator(ctx, *kubeConfigPath, utilclock.RealClock{}, logger, *wakeupInterval, *configmapServerImage, *catalogNamespace)
187172
if err != nil {
188173
log.Panicf("error configuring operator: %s", err.Error())
189174
}

deploy/chart/templates/0000_50_olm_04-installplan.crd.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,87 @@ spec:
126126
uid:
127127
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
128128
type: string
129+
bundleLookups:
130+
type: array
131+
items:
132+
type: object
133+
required:
134+
- catalogSourceRef
135+
- path
136+
- replaces
137+
properties:
138+
catalogSourceRef:
139+
description: ObjectReference contains enough information to let
140+
you inspect or modify the referred object.
141+
type: object
142+
properties:
143+
apiVersion:
144+
description: API version of the referent.
145+
type: string
146+
fieldPath:
147+
description: 'If referring to a piece of an object instead
148+
of an entire object, this string should contain a valid
149+
JSON/Go field access statement, such as desiredState.manifest.containers[2].
150+
For example, if the object reference is to a container within
151+
a pod, this would take on a value like: "spec.containers{name}"
152+
(where "name" refers to the name of the container that triggered
153+
the event) or if no container name is specified "spec.containers[2]"
154+
(container with index 2 in this pod). This syntax is chosen
155+
only to have some well-defined way of referencing a part
156+
of an object. TODO: this design is not final and this field
157+
is subject to change in the future.'
158+
type: string
159+
kind:
160+
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
161+
type: string
162+
name:
163+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
164+
type: string
165+
namespace:
166+
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
167+
type: string
168+
resourceVersion:
169+
description: 'Specific resourceVersion to which this reference
170+
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
171+
type: string
172+
uid:
173+
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
174+
type: string
175+
conditions:
176+
type: array
177+
items:
178+
type: object
179+
required:
180+
- status
181+
- type
182+
properties:
183+
lastTransitionTime:
184+
description: Last time the condition transitioned from one
185+
status to another.
186+
type: string
187+
format: date-time
188+
lastUpdateTime:
189+
description: Last time the condition was probed
190+
type: string
191+
format: date-time
192+
message:
193+
description: A human readable message indicating details
194+
about the transition.
195+
type: string
196+
reason:
197+
description: The reason for the condition's last transition.
198+
type: string
199+
status:
200+
description: Status of the condition, one of True, False,
201+
Unknown.
202+
type: string
203+
type:
204+
description: Type of condition.
205+
type: string
206+
path:
207+
type: string
208+
replaces:
209+
type: string
129210
catalogSources:
130211
type: array
131212
items:

deploy/chart/templates/0000_50_olm_08-catalog-operator.deployment.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ spec:
2626
command:
2727
- /bin/catalog
2828
args:
29-
{{- if .Values.watchedNamespaces }}
30-
- -watchedNamespaces
31-
- {{ .Values.watchedNamespaces }}
32-
{{- end }}
3329
- '-namespace'
3430
- {{ .Values.catalog_namespace }}
3531
{{- if .Values.debug }}

go.mod

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@ require (
88
github.com/coreos/go-semver v0.3.0
99
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a // indirect
1010
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
11-
github.com/emicklei/go-restful v2.9.6+incompatible // indirect
12-
github.com/evanphx/json-patch v4.5.0+incompatible // indirect
1311
github.com/fsnotify/fsnotify v1.4.7
1412
github.com/ghodss/yaml v1.0.0
15-
github.com/go-openapi/spec v0.19.2
16-
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff // indirect
13+
github.com/go-openapi/spec v0.19.4
1714
github.com/golang/mock v1.3.1
18-
github.com/google/btree v1.0.0 // indirect
19-
github.com/googleapis/gnostic v0.3.0 // indirect
2015
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 // indirect
2116
github.com/grpc-ecosystem/grpc-gateway v1.9.4 // indirect
2217
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
@@ -25,18 +20,18 @@ require (
2520
github.com/munnerz/goautoneg v0.0.0-20190414153302-2ae31c8b6b30 // indirect
2621
github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible
2722
github.com/openshift/client-go v0.0.0-20190923180330-3b6373338c9b
28-
github.com/operator-framework/operator-registry v1.5.5
23+
github.com/operator-framework/operator-registry v1.5.6
2924
github.com/pkg/errors v0.8.1
30-
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
25+
github.com/prometheus/client_golang v1.2.1
3126
github.com/sirupsen/logrus v1.4.2
3227
github.com/soheilhy/cmux v0.1.4 // indirect
3328
github.com/spf13/cobra v0.0.5
3429
github.com/stretchr/testify v1.4.0
3530
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
3631
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
37-
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
32+
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
3833
gonum.org/v1/gonum v0.0.0-20190710053202-4340aa3071a0 // indirect
39-
google.golang.org/grpc v1.23.0
34+
google.golang.org/grpc v1.24.0
4035
k8s.io/api v0.17.0
4136
k8s.io/apiextensions-apiserver v0.0.0
4237
k8s.io/apimachinery v0.17.0
@@ -46,14 +41,16 @@ require (
4641
k8s.io/component-base v0.0.0
4742
k8s.io/klog v1.0.0
4843
k8s.io/kube-aggregator v0.0.0
49-
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf
44+
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d
5045
k8s.io/kubernetes v1.16.0
5146
sigs.k8s.io/controller-tools v0.2.4
5247
)
5348

5449
replace (
50+
github.com/docker/docker => github.com/moby/moby v0.7.3-0.20190826074503-38ab9da00309 // Required by Helm
5551
github.com/openshift/api => github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible
5652
github.com/openshift/client-go => github.com/openshift/client-go v0.0.0-20190923180330-3b6373338c9b
53+
github.com/prometheus/client_golang => github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
5754

5855
// Pin to kube 1.16
5956
k8s.io/api => k8s.io/api v0.0.0-20190918155943-95b840bb6a1f

0 commit comments

Comments
 (0)