Skip to content

Commit 1d0a923

Browse files
author
bowenislandsong
committedMay 12, 2020
Adding error message for more than one CSV in bundle dir
We assume a strict one CSV per bundle structure. Since there is a chance a bundle directly supplied contains more than one CSV, we output error messages to catch non-conforming bundles.
1 parent d21c6e7 commit 1d0a923

14 files changed

+1533
-20
lines changed
 

‎go.mod

+1-13
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,22 @@ module github.com/operator-framework/operator-registry
33
go 1.13
44

55
require (
6-
github.com/Microsoft/hcsshim v0.8.7 // indirect
76
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6
87
github.com/blang/semver v3.5.0+incompatible
98
github.com/containerd/containerd v1.3.2
10-
github.com/containerd/continuity v0.0.0-20200228182428-0f16d7a0959c // indirect
119
github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492
1210
github.com/docker/distribution v2.7.1+incompatible
1311
github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce
14-
github.com/docker/docker-credential-helpers v0.6.3 // indirect
15-
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
16-
github.com/docker/go-metrics v0.0.1 // indirect
17-
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
1812
github.com/ghodss/yaml v1.0.0
1913
github.com/golang-migrate/migrate/v4 v4.6.2
2014
github.com/golang/mock v1.3.1
2115
github.com/golang/protobuf v1.3.2
22-
github.com/google/go-cmp v0.4.0 // indirect
23-
github.com/gorilla/mux v1.7.4 // indirect
2416
github.com/grpc-ecosystem/grpc-health-probe v0.2.1-0.20181220223928-2bf0a5b182db
25-
github.com/imdario/mergo v0.3.8 // indirect
2617
github.com/mattn/go-sqlite3 v1.10.0
2718
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
28-
github.com/morikuni/aec v1.0.0 // indirect
2919
github.com/onsi/ginkgo v1.12.0
3020
github.com/onsi/gomega v1.9.0
3121
github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6
32-
github.com/opencontainers/runc v1.0.0-rc9 // indirect
33-
github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7 // indirect
3422
github.com/operator-framework/api v0.3.4
3523
github.com/otiai10/copy v1.0.2
3624
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
@@ -43,8 +31,8 @@ require (
4331
golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271
4432
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
4533
google.golang.org/grpc v1.26.0
46-
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
4734
gopkg.in/yaml.v2 v2.2.8
35+
gotest.tools/v3 v3.0.2 // indirect
4836
k8s.io/api v0.18.2
4937
k8s.io/apiextensions-apiserver v0.18.2
5038
k8s.io/apimachinery v0.18.2

‎go.sum

+3-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z
9090
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f h1:tSNMc+rJDfmYntojat8lljbt1mgKNpTxUZJsSzJ9Y1s=
9191
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
9292
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
93-
github.com/containerd/containerd v1.2.7/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
94-
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
95-
github.com/containerd/containerd v1.3.2 h1:ForxmXkA6tPIvffbrDAcPUIB32QgXkt2XFj+F0UxetA=
96-
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
9793
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
9894
github.com/containerd/continuity v0.0.0-20200228182428-0f16d7a0959c h1:8ahmSVELW1wghbjerVAyuEYD5+Dio66RYvSS0iGfL1M=
9995
github.com/containerd/continuity v0.0.0-20200228182428-0f16d7a0959c/go.mod h1:Dq467ZllaHgAtVp4p1xUQWBrFXR9s/wyoTpG8zOJGkY=
@@ -812,6 +808,7 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn
812808
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
813809
golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
814810
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
811+
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
815812
golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db h1:9hRk1xeL9LTT3yX/941DqeBz87XgHAQuj+TbimYJuiw=
816813
golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
817814
golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72 h1:bw9doJza/SFBEweII/rHQh338oozWyiFsBRHtrflcws=
@@ -890,6 +887,8 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
890887
gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
891888
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
892889
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
890+
gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E=
891+
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
893892
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
894893
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
895894
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

‎pkg/registry/csv.go

+11-3
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ type ClusterServiceVersion struct {
6565
Spec json.RawMessage `json:"spec"`
6666
}
6767

68-
// ReadCSVFromBundleDirectory tries to parse every YAML file in the directory and see if they are CSV.
69-
// According to the strict one CSV rule for every bundle, we return the first file that is considered a CSV type.
68+
// ReadCSVFromBundleDirectory tries to parse every YAML file in the directory without inspecting sub-directories and
69+
// returns a CSV. According to the strict one CSV per bundle rule, func returns an error if more than one CSV is found.
7070
func ReadCSVFromBundleDirectory(bundleDir string) (*ClusterServiceVersion, error) {
7171
dirContent, err := ioutil.ReadDir(bundleDir)
7272
if err != nil {
@@ -80,14 +80,15 @@ func ReadCSVFromBundleDirectory(bundleDir string) (*ClusterServiceVersion, error
8080
}
8181
}
8282

83+
csv := ClusterServiceVersion{}
84+
foundCSV := false
8385
for _, file := range files {
8486
yamlReader, err := os.Open(path.Join(bundleDir, file))
8587
if err != nil {
8688
continue
8789
}
8890

8991
unstructuredCSV := unstructured.Unstructured{}
90-
csv := ClusterServiceVersion{}
9192

9293
decoder := yaml.NewYAMLOrJSONDecoder(yamlReader, 30)
9394
if err = decoder.Decode(&unstructuredCSV); err != nil {
@@ -98,11 +99,18 @@ func ReadCSVFromBundleDirectory(bundleDir string) (*ClusterServiceVersion, error
9899
continue
99100
}
100101

102+
if foundCSV {
103+
return nil, fmt.Errorf("more than one ClusterServiceVersion is found in bundle")
104+
}
105+
101106
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(unstructuredCSV.UnstructuredContent(),
102107
&csv); err != nil {
103108
return nil, err
104109
}
110+
foundCSV = true
111+
}
105112

113+
if foundCSV {
106114
return &csv, nil
107115
}
108116
return nil, fmt.Errorf("no ClusterServiceVersion object found in %s", bundleDir)

‎pkg/registry/csv_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,10 @@ func TestLoadingCsvFromBundleDirectory(t *testing.T) {
802802
dir: "testdata/invalidPackges/3scale-community-operator/0.3.0",
803803
fail: true,
804804
},
805+
{
806+
dir: "testdata/invalidPackges/3scale-community-operator/0.4.0",
807+
fail: true,
808+
},
805809
}
806810

807811
for _, tt := range tests {

‎pkg/registry/testdata/invalidPackges/3scale-community-operator/0.4.0/3scale-community-operator.v0.4.0.clusterserviceversion.yaml

+292
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: apimanagers.apps.3scale.net
5+
spec:
6+
group: apps.3scale.net
7+
names:
8+
kind: APIManager
9+
listKind: APIManagerList
10+
plural: apimanagers
11+
singular: apimanager
12+
scope: Namespaced
13+
subresources:
14+
status: {}
15+
validation:
16+
openAPIV3Schema:
17+
properties:
18+
apiVersion:
19+
description: 'APIVersion defines the versioned schema of this representation
20+
of an object. Servers should convert recognized schemas to the latest
21+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
22+
type: string
23+
kind:
24+
description: 'Kind is a string value representing the REST resource this
25+
object represents. Servers may infer this from the endpoint the client
26+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
27+
type: string
28+
metadata:
29+
type: object
30+
spec:
31+
properties:
32+
apicast:
33+
properties:
34+
image:
35+
type: string
36+
managementAPI:
37+
type: string
38+
openSSLVerify:
39+
type: boolean
40+
productionSpec:
41+
properties:
42+
replicas:
43+
format: int64
44+
type: integer
45+
type: object
46+
registryURL:
47+
type: string
48+
responseCodes:
49+
type: boolean
50+
stagingSpec:
51+
properties:
52+
replicas:
53+
format: int64
54+
type: integer
55+
type: object
56+
type: object
57+
appLabel:
58+
type: string
59+
backend:
60+
properties:
61+
cronSpec:
62+
properties:
63+
replicas:
64+
format: int64
65+
type: integer
66+
type: object
67+
image:
68+
type: string
69+
listenerSpec:
70+
properties:
71+
replicas:
72+
format: int64
73+
type: integer
74+
type: object
75+
redisImage:
76+
type: string
77+
workerSpec:
78+
properties:
79+
replicas:
80+
format: int64
81+
type: integer
82+
type: object
83+
type: object
84+
highAvailability:
85+
properties:
86+
enabled:
87+
type: boolean
88+
type: object
89+
imageStreamTagImportInsecure:
90+
type: boolean
91+
resourceRequirementsEnabled:
92+
type: boolean
93+
system:
94+
properties:
95+
appSpec:
96+
properties:
97+
replicas:
98+
format: int64
99+
type: integer
100+
type: object
101+
database:
102+
properties:
103+
mysql:
104+
description: Union type. Only one of the fields can be set
105+
properties:
106+
image:
107+
type: string
108+
type: object
109+
postgresql:
110+
properties:
111+
image:
112+
type: string
113+
type: object
114+
type: object
115+
fileStorage:
116+
properties:
117+
amazonSimpleStorageService:
118+
properties:
119+
awsBucket:
120+
type: string
121+
awsCredentialsSecret:
122+
properties:
123+
name:
124+
type: string
125+
type: object
126+
awsRegion:
127+
type: string
128+
required:
129+
- awsBucket
130+
- awsRegion
131+
- awsCredentialsSecret
132+
type: object
133+
persistentVolumeClaim:
134+
description: Union type. Only one of the fields can be set.
135+
properties:
136+
storageClassName:
137+
type: string
138+
type: object
139+
type: object
140+
image:
141+
type: string
142+
memcachedImage:
143+
type: string
144+
redisImage:
145+
type: string
146+
sidekiqSpec:
147+
properties:
148+
replicas:
149+
format: int64
150+
type: integer
151+
type: object
152+
type: object
153+
tenantName:
154+
type: string
155+
wildcardDomain:
156+
type: string
157+
zync:
158+
properties:
159+
appSpec:
160+
properties:
161+
replicas:
162+
format: int64
163+
type: integer
164+
type: object
165+
image:
166+
type: string
167+
postgreSQLImage:
168+
type: string
169+
queSpec:
170+
properties:
171+
replicas:
172+
format: int64
173+
type: integer
174+
type: object
175+
type: object
176+
required:
177+
- wildcardDomain
178+
type: object
179+
status:
180+
properties:
181+
conditions:
182+
items:
183+
properties:
184+
status:
185+
type: string
186+
type:
187+
type: string
188+
required:
189+
- type
190+
- status
191+
type: object
192+
type: array
193+
deployments:
194+
properties:
195+
ready:
196+
description: Deployments are ready to serve requests
197+
items:
198+
type: string
199+
type: array
200+
starting:
201+
description: Deployments are starting, may or may not succeed
202+
items:
203+
type: string
204+
type: array
205+
stopped:
206+
description: Deployments are not starting, unclear what next step
207+
will be
208+
items:
209+
type: string
210+
type: array
211+
type: object
212+
required:
213+
- deployments
214+
type: object
215+
version: v1alpha1
216+
versions:
217+
- name: v1alpha1
218+
served: true
219+
storage: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,363 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: apis.capabilities.3scale.net
5+
spec:
6+
group: capabilities.3scale.net
7+
names:
8+
kind: API
9+
listKind: APIList
10+
plural: apis
11+
singular: api
12+
scope: Namespaced
13+
subresources:
14+
status: {}
15+
validation:
16+
openAPIV3Schema:
17+
properties:
18+
spec:
19+
properties:
20+
description:
21+
type: string
22+
integrationMethod:
23+
properties:
24+
apicastHosted:
25+
properties:
26+
apiTestGetRequest:
27+
type: string
28+
authenticationSettings:
29+
properties:
30+
credentials:
31+
properties:
32+
apiKey:
33+
properties:
34+
authParameterName:
35+
type: string
36+
credentialsLocation:
37+
type: string
38+
required:
39+
- authParameterName
40+
- credentialsLocation
41+
type: object
42+
appID:
43+
properties:
44+
appIDParameterName:
45+
type: string
46+
appKeyParameterName:
47+
type: string
48+
credentialsLocation:
49+
type: string
50+
required:
51+
- appIDParameterName
52+
- appKeyParameterName
53+
- credentialsLocation
54+
type: object
55+
openIDConnector:
56+
properties:
57+
credentialsLocation:
58+
type: string
59+
issuer:
60+
type: string
61+
required:
62+
- issuer
63+
- credentialsLocation
64+
type: object
65+
type: object
66+
errors:
67+
properties:
68+
authenticationFailed:
69+
properties:
70+
contentType:
71+
type: string
72+
responseBody:
73+
type: string
74+
responseCode:
75+
format: int64
76+
type: integer
77+
required:
78+
- responseCode
79+
- contentType
80+
- responseBody
81+
type: object
82+
authenticationMissing:
83+
properties:
84+
contentType:
85+
type: string
86+
responseBody:
87+
type: string
88+
responseCode:
89+
format: int64
90+
type: integer
91+
required:
92+
- responseCode
93+
- contentType
94+
- responseBody
95+
type: object
96+
required:
97+
- authenticationFailed
98+
- authenticationMissing
99+
type: object
100+
hostHeader:
101+
type: string
102+
secretToken:
103+
type: string
104+
required:
105+
- hostHeader
106+
- secretToken
107+
- credentials
108+
- errors
109+
type: object
110+
mappingRulesSelector:
111+
type: object
112+
properties:
113+
matchLabels:
114+
type: object
115+
matchExpressions:
116+
type: array
117+
items:
118+
properties:
119+
key:
120+
type: string
121+
operator:
122+
type: string
123+
values:
124+
type: array
125+
policiesSelector:
126+
type: object
127+
properties:
128+
matchLabels:
129+
type: object
130+
matchExpressions:
131+
type: array
132+
items:
133+
properties:
134+
key:
135+
type: string
136+
operator:
137+
type: string
138+
values:
139+
type: array
140+
privateBaseURL:
141+
type: string
142+
required:
143+
- privateBaseURL
144+
- apiTestGetRequest
145+
- authenticationSettings
146+
type: object
147+
apicastOnPrem:
148+
properties:
149+
apiTestGetRequest:
150+
type: string
151+
authenticationSettings:
152+
properties:
153+
credentials:
154+
properties:
155+
apiKey:
156+
properties:
157+
authParameterName:
158+
type: string
159+
credentialsLocation:
160+
type: string
161+
required:
162+
- authParameterName
163+
- credentialsLocation
164+
type: object
165+
appID:
166+
properties:
167+
appIDParameterName:
168+
type: string
169+
appKeyParameterName:
170+
type: string
171+
credentialsLocation:
172+
type: string
173+
required:
174+
- appIDParameterName
175+
- appKeyParameterName
176+
- credentialsLocation
177+
type: object
178+
openIDConnector:
179+
properties:
180+
credentialsLocation:
181+
type: string
182+
issuer:
183+
type: string
184+
required:
185+
- issuer
186+
- credentialsLocation
187+
type: object
188+
type: object
189+
errors:
190+
properties:
191+
authenticationFailed:
192+
properties:
193+
contentType:
194+
type: string
195+
responseBody:
196+
type: string
197+
responseCode:
198+
format: int64
199+
type: integer
200+
required:
201+
- responseCode
202+
- contentType
203+
- responseBody
204+
type: object
205+
authenticationMissing:
206+
properties:
207+
contentType:
208+
type: string
209+
responseBody:
210+
type: string
211+
responseCode:
212+
format: int64
213+
type: integer
214+
required:
215+
- responseCode
216+
- contentType
217+
- responseBody
218+
type: object
219+
required:
220+
- authenticationFailed
221+
- authenticationMissing
222+
type: object
223+
hostHeader:
224+
type: string
225+
secretToken:
226+
type: string
227+
required:
228+
- hostHeader
229+
- secretToken
230+
- credentials
231+
- errors
232+
type: object
233+
mappingRulesSelector:
234+
type: object
235+
properties:
236+
matchLabels:
237+
type: object
238+
matchExpressions:
239+
type: array
240+
items:
241+
properties:
242+
key:
243+
type: string
244+
operator:
245+
type: string
246+
values:
247+
type: array
248+
policiesSelector:
249+
type: object
250+
properties:
251+
matchLabels:
252+
type: object
253+
matchExpressions:
254+
type: array
255+
items:
256+
properties:
257+
key:
258+
type: string
259+
operator:
260+
type: string
261+
values:
262+
type: array
263+
privateBaseURL:
264+
type: string
265+
productionPublicBaseURL:
266+
type: string
267+
stagingPublicBaseURL:
268+
type: string
269+
required:
270+
- privateBaseURL
271+
- apiTestGetRequest
272+
- authenticationSettings
273+
- stagingPublicBaseURL
274+
- productionPublicBaseURL
275+
type: object
276+
codePlugin:
277+
properties:
278+
authenticationSettings:
279+
properties:
280+
credentials:
281+
properties:
282+
apiKey:
283+
properties:
284+
authParameterName:
285+
type: string
286+
credentialsLocation:
287+
type: string
288+
required:
289+
- authParameterName
290+
- credentialsLocation
291+
type: object
292+
appID:
293+
properties:
294+
appIDParameterName:
295+
type: string
296+
appKeyParameterName:
297+
type: string
298+
credentialsLocation:
299+
type: string
300+
required:
301+
- appIDParameterName
302+
- appKeyParameterName
303+
- credentialsLocation
304+
type: object
305+
openIDConnector:
306+
properties:
307+
credentialsLocation:
308+
type: string
309+
issuer:
310+
type: string
311+
required:
312+
- issuer
313+
- credentialsLocation
314+
type: object
315+
type: object
316+
required:
317+
- credentials
318+
type: object
319+
required:
320+
- authenticationSettings
321+
type: object
322+
type: object
323+
metricSelector:
324+
type: object
325+
properties:
326+
matchLabels:
327+
type: object
328+
matchExpressions:
329+
type: array
330+
items:
331+
properties:
332+
key:
333+
type: string
334+
operator:
335+
type: string
336+
values:
337+
type: array
338+
planSelector:
339+
type: object
340+
properties:
341+
matchLabels:
342+
type: object
343+
matchExpressions:
344+
type: array
345+
items:
346+
properties:
347+
key:
348+
type: string
349+
operator:
350+
type: string
351+
values:
352+
type: array
353+
required:
354+
- description
355+
- integrationMethod
356+
type: object
357+
status:
358+
type: object
359+
version: v1alpha1
360+
versions:
361+
- name: v1alpha1
362+
served: true
363+
storage: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: bindings.capabilities.3scale.net
5+
spec:
6+
group: capabilities.3scale.net
7+
names:
8+
kind: Binding
9+
listKind: BindingList
10+
plural: bindings
11+
singular: binding
12+
scope: Namespaced
13+
subresources:
14+
status: {}
15+
validation:
16+
openAPIV3Schema:
17+
properties:
18+
spec:
19+
properties:
20+
apiSelector:
21+
type: object
22+
properties:
23+
matchLabels:
24+
type: object
25+
matchExpressions:
26+
type: array
27+
items:
28+
properties:
29+
key:
30+
type: string
31+
operator:
32+
type: string
33+
values:
34+
type: array
35+
credentialsRef:
36+
type: object
37+
properties:
38+
name:
39+
type: string
40+
namespace:
41+
type: string
42+
required:
43+
- credentialsRef
44+
type: object
45+
status:
46+
properties:
47+
currentState:
48+
type: string
49+
desiredState:
50+
type: string
51+
lastSync:
52+
type: object
53+
properties:
54+
seconds:
55+
type: integer
56+
nanos:
57+
type: integer
58+
previousState:
59+
type: string
60+
type: object
61+
version: v1alpha1
62+
versions:
63+
- name: v1alpha1
64+
served: true
65+
storage: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: limits.capabilities.3scale.net
5+
spec:
6+
group: capabilities.3scale.net
7+
names:
8+
kind: Limit
9+
listKind: LimitList
10+
plural: limits
11+
singular: limit
12+
scope: Namespaced
13+
subresources:
14+
status: {}
15+
validation:
16+
openAPIV3Schema:
17+
properties:
18+
spec:
19+
type: object
20+
properties:
21+
maxValue:
22+
format: int64
23+
type: integer
24+
metricRef:
25+
type: object
26+
properties:
27+
kind:
28+
type: string
29+
namespace:
30+
type: string
31+
name:
32+
type: string
33+
uid:
34+
type: string
35+
apiVersion:
36+
type: string
37+
resourceVersion:
38+
type: string
39+
fieldPath:
40+
type: string
41+
period:
42+
type: string
43+
required:
44+
- period
45+
- maxValue
46+
- metricRef
47+
status:
48+
type: object
49+
version: v1alpha1
50+
versions:
51+
- name: v1alpha1
52+
served: true
53+
storage: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: mappingrules.capabilities.3scale.net
5+
spec:
6+
group: capabilities.3scale.net
7+
names:
8+
kind: MappingRule
9+
listKind: MappingRuleList
10+
plural: mappingrules
11+
singular: mappingrule
12+
scope: Namespaced
13+
subresources:
14+
status: {}
15+
validation:
16+
openAPIV3Schema:
17+
properties:
18+
spec:
19+
properties:
20+
increment:
21+
format: int64
22+
type: integer
23+
method:
24+
type: string
25+
metricRef:
26+
type: object
27+
properties:
28+
kind:
29+
type: string
30+
namespace:
31+
type: string
32+
name:
33+
type: string
34+
uid:
35+
type: string
36+
apiVersion:
37+
type: string
38+
resourceVersion:
39+
type: string
40+
fieldPath:
41+
type: string
42+
path:
43+
type: string
44+
required:
45+
- path
46+
- method
47+
- increment
48+
- metricRef
49+
type: object
50+
status:
51+
type: object
52+
version: v1alpha1
53+
versions:
54+
- name: v1alpha1
55+
served: true
56+
storage: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: metrics.capabilities.3scale.net
5+
spec:
6+
group: capabilities.3scale.net
7+
names:
8+
kind: Metric
9+
listKind: MetricList
10+
plural: metrics
11+
singular: metric
12+
scope: Namespaced
13+
subresources:
14+
status: {}
15+
validation:
16+
openAPIV3Schema:
17+
properties:
18+
spec:
19+
properties:
20+
description:
21+
type: string
22+
incrementHits:
23+
type: boolean
24+
unit:
25+
type: string
26+
required:
27+
- unit
28+
- description
29+
- incrementHits
30+
type: object
31+
status:
32+
type: object
33+
version: v1alpha1
34+
versions:
35+
- name: v1alpha1
36+
served: true
37+
storage: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: plans.capabilities.3scale.net
5+
spec:
6+
group: capabilities.3scale.net
7+
names:
8+
kind: Plan
9+
listKind: PlanList
10+
plural: plans
11+
singular: plan
12+
scope: Namespaced
13+
subresources:
14+
status: {}
15+
validation:
16+
openAPIV3Schema:
17+
properties:
18+
spec:
19+
properties:
20+
approvalRequired:
21+
type: boolean
22+
costs:
23+
properties:
24+
costMonth:
25+
format: double
26+
type: number
27+
setupFee:
28+
format: double
29+
type: number
30+
type: object
31+
default:
32+
type: boolean
33+
limitSelector:
34+
type: object
35+
properties:
36+
matchLabels:
37+
type: object
38+
matchExpressions:
39+
type: array
40+
items:
41+
properties:
42+
key:
43+
type: string
44+
operator:
45+
type: string
46+
values:
47+
type: array
48+
trialPeriod:
49+
format: int64
50+
type: integer
51+
required:
52+
- default
53+
- trialPeriod
54+
- approvalRequired
55+
- limitSelector
56+
type: object
57+
status:
58+
type: object
59+
version: v1alpha1
60+
versions:
61+
- name: v1alpha1
62+
served: true
63+
storage: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: tenants.capabilities.3scale.net
5+
spec:
6+
group: capabilities.3scale.net
7+
names:
8+
kind: Tenant
9+
listKind: TenantList
10+
plural: tenants
11+
singular: tenant
12+
scope: Namespaced
13+
subresources:
14+
status: {}
15+
validation:
16+
openAPIV3Schema:
17+
properties:
18+
spec:
19+
properties:
20+
email:
21+
type: string
22+
masterCredentialsRef:
23+
type: object
24+
properties:
25+
name:
26+
type: string
27+
namespace:
28+
type: string
29+
organizationName:
30+
type: string
31+
passwordCredentialsRef:
32+
type: object
33+
properties:
34+
name:
35+
type: string
36+
namespace:
37+
type: string
38+
systemMasterUrl:
39+
type: string
40+
tenantSecretRef:
41+
type: object
42+
properties:
43+
name:
44+
type: string
45+
namespace:
46+
type: string
47+
username:
48+
type: string
49+
required:
50+
- username
51+
- email
52+
- organizationName
53+
- systemMasterUrl
54+
- tenantSecretRef
55+
- passwordCredentialsRef
56+
- masterCredentialsRef
57+
type: object
58+
status:
59+
properties:
60+
adminId:
61+
format: int64
62+
type: integer
63+
tenantId:
64+
format: int64
65+
type: integer
66+
required:
67+
- tenantId
68+
- adminId
69+
type: object
70+
version: v1alpha1
71+
versions:
72+
- name: v1alpha1
73+
served: true
74+
storage: true

‎pkg/registry/testdata/invalidPackges/3scale-community-operator/0.4.0/duplicate.csv.yaml

+292
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.