Skip to content

Commit cd0f8e8

Browse files
njhaleecordell
authored andcommitted
chore(make): copy crd manifests from apis repo
1 parent 9e26850 commit cd0f8e8

File tree

66 files changed

+16081
-4425
lines changed

Some content is hidden

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

66 files changed

+16081
-4425
lines changed

Makefile

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ undefine GOFLAGS
99
endif
1010

1111
SHELL := /bin/bash
12-
PKG := github.com/operator-framework/operator-lifecycle-manager
12+
ORG := github.com/operator-framework
13+
PKG := $(ORG)/operator-lifecycle-manager
14+
OS := $(shell go env GOOS)
15+
ARCH := $(shell go env GOARCH)
1316
MOD_FLAGS := $(shell (go version | grep -q -E "1\.1[1-9]") && echo -mod=vendor)
1417
CMDS := $(shell go list $(MOD_FLAGS) ./cmd/...)
1518
TCMDS := $(shell go list $(MOD_FLAGS) ./test/e2e/...)
@@ -39,8 +42,16 @@ all: test build
3942

4043
test: clean cover.out
4144

42-
unit:
43-
go test $(MOD_FLAGS) $(SPECIFIC_UNIT_TEST) -v -race -count=1 ./pkg/...
45+
unit: kubebuilder
46+
$(KUBEBUILDER_ENV) go test $(MOD_FLAGS) $(SPECIFIC_UNIT_TEST) -v -race -count=1 ./pkg/...
47+
48+
# Install kubebuilder if not found
49+
KUBEBUILDER_DIR := /tmp/kubebuilder_2.3.1_$(OS)_$(ARCH)/bin
50+
kubebuilder:
51+
ifeq (, $(shell which kubebuilder))
52+
[ ! -d "$(KUBEBUILDER_DIR)" ] && (curl -sL https://go.kubebuilder.io/dl/2.3.1/$(OS)/$(ARCH) | tar -xz -C /tmp/)
53+
KUBEBUILDER_ENV := KUBEBUILDER_ASSETS=$(KUBEBUILDER_DIR)
54+
endif
4455

4556
schema-check:
4657

@@ -154,17 +165,13 @@ clean:
154165
@rm -rf e2e.namespace
155166

156167

157-
# Generate manifests for CRDs
168+
# Copy CRD manifests
158169
manifests: vendor
159-
$(CONTROLLER_GEN) schemapatch:manifests=./deploy/chart/crds paths=./pkg/api/apis/operators/... output:dir=./deploy/chart/crds
160-
161-
$(YQ_INTERNAL) w --inplace deploy/chart/crds/0000_50_olm_03-clusterserviceversion.crd.yaml spec.validation.openAPIV3Schema.properties.spec.properties.install.properties.spec.properties.deployments.items.properties.spec.properties.template.properties.metadata.x-kubernetes-preserve-unknown-fields true
170+
./scripts/copy_crds.sh
162171

163172
# Generate deepcopy, conversion, clients, listers, and informers
164173
codegen:
165-
# Deepcopy
166-
$(CONTROLLER_GEN) object:headerFile=./boilerplate.go.txt paths=./pkg/api/apis/operators/...i
167-
# Conversion, clients, listers, and informers
174+
# Clients, listers, and informers
168175
$(CODEGEN)
169176

170177
# Generate mock types.
@@ -182,11 +189,10 @@ verify-mockgen: mockgen diff
182189
verify-manifests: manifests diff
183190
verify: verify-codegen verify-mockgen verify-manifests
184191

185-
186192
# before running release, bump the version in OLM_VERSION and push to master,
187193
# then tag those builds in quay with the version in OLM_VERSION
188194
release: ver=$(shell cat OLM_VERSION)
189-
release:
195+
release: manifests
190196
docker pull quay.io/operator-framework/olm:$(ver)
191197
$(MAKE) target=upstream ver=$(ver) quickstart=true package
192198
$(MAKE) target=ocp ver=$(ver) package
@@ -220,3 +226,4 @@ endif
220226
run-console-local:
221227
@echo Running script to run the OLM console locally:
222228
. ./scripts/run_console_local.sh
229+

deploy/chart/crds/0000_50_olm_03-clusterserviceversion.crd.yaml renamed to deploy/chart/crds/0000_50_olm_00-clusterserviceversions.yaml

Lines changed: 77 additions & 13 deletions
Large diffs are not rendered by default.
Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: operatorgroups.operators.coreos.com
5+
spec:
6+
group: operators.coreos.com
7+
version: v1
8+
versions:
9+
- name: v1
10+
served: true
11+
storage: true
12+
"schema":
13+
"openAPIV3Schema":
14+
description: OperatorGroup is the unit of multitenancy for OLM managed operators.
15+
It constrains the installation of operators in its namespace to a specified
16+
set of target namespaces.
17+
type: object
18+
required:
19+
- metadata
20+
properties:
21+
apiVersion:
22+
description: 'APIVersion defines the versioned schema of this representation
23+
of an object. Servers should convert recognized schemas to the latest
24+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
25+
type: string
26+
kind:
27+
description: 'Kind is a string value representing the REST resource this
28+
object represents. Servers may infer this from the endpoint the client
29+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
30+
type: string
31+
metadata:
32+
type: object
33+
spec:
34+
description: OperatorGroupSpec is the spec for an OperatorGroup resource.
35+
type: object
36+
properties:
37+
selector:
38+
description: Selector selects the OperatorGroup's target namespaces.
39+
type: object
40+
properties:
41+
matchExpressions:
42+
description: matchExpressions is a list of label selector requirements.
43+
The requirements are ANDed.
44+
type: array
45+
items:
46+
description: A label selector requirement is a selector that
47+
contains values, a key, and an operator that relates the key
48+
and values.
49+
type: object
50+
required:
51+
- key
52+
- operator
53+
properties:
54+
key:
55+
description: key is the label key that the selector applies
56+
to.
57+
type: string
58+
operator:
59+
description: operator represents a key's relationship to
60+
a set of values. Valid operators are In, NotIn, Exists
61+
and DoesNotExist.
62+
type: string
63+
values:
64+
description: values is an array of string values. If the
65+
operator is In or NotIn, the values array must be non-empty.
66+
If the operator is Exists or DoesNotExist, the values
67+
array must be empty. This array is replaced during a strategic
68+
merge patch.
69+
type: array
70+
items:
71+
type: string
72+
matchLabels:
73+
description: matchLabels is a map of {key,value} pairs. A single
74+
{key,value} in the matchLabels map is equivalent to an element
75+
of matchExpressions, whose key field is "key", the operator
76+
is "In", and the values array contains only "value". The requirements
77+
are ANDed.
78+
type: object
79+
additionalProperties:
80+
type: string
81+
serviceAccountName:
82+
description: ServiceAccountName is the admin specified service account
83+
which will be used to deploy operator(s) in this operator group.
84+
type: string
85+
staticProvidedAPIs:
86+
description: Static tells OLM not to update the OperatorGroup's providedAPIs
87+
annotation
88+
type: boolean
89+
targetNamespaces:
90+
description: TargetNamespaces is an explicit set of namespaces to
91+
target. If it is set, Selector is ignored.
92+
type: array
93+
items:
94+
type: string
95+
x-kubernetes-list-type: set
96+
status:
97+
description: OperatorGroupStatus is the status for an OperatorGroupResource.
98+
type: object
99+
required:
100+
- lastUpdated
101+
properties:
102+
lastUpdated:
103+
description: LastUpdated is a timestamp of the last time the OperatorGroup's
104+
status was Updated.
105+
type: string
106+
format: date-time
107+
namespaces:
108+
description: Namespaces is the set of target namespaces for the OperatorGroup.
109+
type: array
110+
items:
111+
type: string
112+
x-kubernetes-list-type: set
113+
serviceAccountRef:
114+
description: ServiceAccountRef references the service account object
115+
specified.
116+
type: object
117+
properties:
118+
apiVersion:
119+
description: API version of the referent.
120+
type: string
121+
fieldPath:
122+
description: 'If referring to a piece of an object instead of
123+
an entire object, this string should contain a valid JSON/Go
124+
field access statement, such as desiredState.manifest.containers[2].
125+
For example, if the object reference is to a container within
126+
a pod, this would take on a value like: "spec.containers{name}"
127+
(where "name" refers to the name of the container that triggered
128+
the event) or if no container name is specified "spec.containers[2]"
129+
(container with index 2 in this pod). This syntax is chosen
130+
only to have some well-defined way of referencing a part of
131+
an object. TODO: this design is not final and this field is
132+
subject to change in the future.'
133+
type: string
134+
kind:
135+
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
136+
type: string
137+
name:
138+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
139+
type: string
140+
namespace:
141+
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
142+
type: string
143+
resourceVersion:
144+
description: 'Specific resourceVersion to which this reference
145+
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
146+
type: string
147+
uid:
148+
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
149+
type: string
150+
- name: v1alpha2
151+
served: true
152+
storage: false
153+
"schema":
154+
"openAPIV3Schema":
155+
description: OperatorGroup is the unit of multitenancy for OLM managed operators.
156+
It constrains the installation of operators in its namespace to a specified
157+
set of target namespaces.
158+
type: object
159+
required:
160+
- metadata
161+
properties:
162+
apiVersion:
163+
description: 'APIVersion defines the versioned schema of this representation
164+
of an object. Servers should convert recognized schemas to the latest
165+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
166+
type: string
167+
kind:
168+
description: 'Kind is a string value representing the REST resource this
169+
object represents. Servers may infer this from the endpoint the client
170+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
171+
type: string
172+
metadata:
173+
type: object
174+
spec:
175+
description: OperatorGroupSpec is the spec for an OperatorGroup resource.
176+
type: object
177+
properties:
178+
selector:
179+
description: Selector selects the OperatorGroup's target namespaces.
180+
type: object
181+
properties:
182+
matchExpressions:
183+
description: matchExpressions is a list of label selector requirements.
184+
The requirements are ANDed.
185+
type: array
186+
items:
187+
description: A label selector requirement is a selector that
188+
contains values, a key, and an operator that relates the key
189+
and values.
190+
type: object
191+
required:
192+
- key
193+
- operator
194+
properties:
195+
key:
196+
description: key is the label key that the selector applies
197+
to.
198+
type: string
199+
operator:
200+
description: operator represents a key's relationship to
201+
a set of values. Valid operators are In, NotIn, Exists
202+
and DoesNotExist.
203+
type: string
204+
values:
205+
description: values is an array of string values. If the
206+
operator is In or NotIn, the values array must be non-empty.
207+
If the operator is Exists or DoesNotExist, the values
208+
array must be empty. This array is replaced during a strategic
209+
merge patch.
210+
type: array
211+
items:
212+
type: string
213+
matchLabels:
214+
description: matchLabels is a map of {key,value} pairs. A single
215+
{key,value} in the matchLabels map is equivalent to an element
216+
of matchExpressions, whose key field is "key", the operator
217+
is "In", and the values array contains only "value". The requirements
218+
are ANDed.
219+
type: object
220+
additionalProperties:
221+
type: string
222+
serviceAccountName:
223+
description: ServiceAccountName is the admin specified service account
224+
which will be used to deploy operator(s) in this operator group.
225+
type: string
226+
staticProvidedAPIs:
227+
description: Static tells OLM not to update the OperatorGroup's providedAPIs
228+
annotation
229+
type: boolean
230+
targetNamespaces:
231+
description: TargetNamespaces is an explicit set of namespaces to
232+
target. If it is set, Selector is ignored.
233+
type: array
234+
items:
235+
type: string
236+
status:
237+
description: OperatorGroupStatus is the status for an OperatorGroupResource.
238+
type: object
239+
required:
240+
- lastUpdated
241+
properties:
242+
lastUpdated:
243+
description: LastUpdated is a timestamp of the last time the OperatorGroup's
244+
status was Updated.
245+
type: string
246+
format: date-time
247+
namespaces:
248+
description: Namespaces is the set of target namespaces for the OperatorGroup.
249+
type: array
250+
items:
251+
type: string
252+
serviceAccountRef:
253+
description: ServiceAccountRef references the service account object
254+
specified.
255+
type: object
256+
properties:
257+
apiVersion:
258+
description: API version of the referent.
259+
type: string
260+
fieldPath:
261+
description: 'If referring to a piece of an object instead of
262+
an entire object, this string should contain a valid JSON/Go
263+
field access statement, such as desiredState.manifest.containers[2].
264+
For example, if the object reference is to a container within
265+
a pod, this would take on a value like: "spec.containers{name}"
266+
(where "name" refers to the name of the container that triggered
267+
the event) or if no container name is specified "spec.containers[2]"
268+
(container with index 2 in this pod). This syntax is chosen
269+
only to have some well-defined way of referencing a part of
270+
an object. TODO: this design is not final and this field is
271+
subject to change in the future.'
272+
type: string
273+
kind:
274+
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
275+
type: string
276+
name:
277+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
278+
type: string
279+
namespace:
280+
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
281+
type: string
282+
resourceVersion:
283+
description: 'Specific resourceVersion to which this reference
284+
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
285+
type: string
286+
uid:
287+
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
288+
type: string
289+
names:
290+
plural: operatorgroups
291+
singular: operatorgroup
292+
kind: OperatorGroup
293+
listKind: OperatorGroupList
294+
shortNames:
295+
- og
296+
categories:
297+
- olm
298+
scope: Namespaced
299+
preserveUnknownFields: false
300+
subresources:
301+
# status enables the status subresource.
302+
status: {}

0 commit comments

Comments
 (0)