Skip to content

Commit affab7b

Browse files
authored
Merge pull request #361 from zdtsw-forking/feat/chore1
Update: rbac group, kubebuilder, Owns order and add recorder
2 parents 9b661d4 + 7b19f99 commit affab7b

File tree

10 files changed

+282
-74
lines changed

10 files changed

+282
-74
lines changed

apis/dscinitialization/v1alpha1/dscinitialization_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ type DSCInitializationSpec struct {
3030
ApplicationsNamespace string `json:"applicationsNamespace"`
3131
// Enable monitoring on specified namespace
3232
// +operator-sdk:csv:customresourcedefinitions:type=spec
33+
// +optional
3334
Monitoring Monitoring `json:"monitoring,omitempty"`
3435
// Internal development useful field
3536
// +operator-sdk:csv:customresourcedefinitions:type=spec
37+
// +optional
3638
ManifestsUri string `json:"manifestsUri,omitempty"`
3739
}
3840

bundle/manifests/opendatahub-operator.clusterserviceversion.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,28 @@ spec:
250250
spec:
251251
clusterPermissions:
252252
- rules:
253+
- apiGroups:
254+
- '*'
255+
resources:
256+
- '*'
257+
verbs:
258+
- '*'
259+
- apiGroups:
260+
- addons.managed.openshift.io
261+
resources:
262+
- addons
263+
verbs:
264+
- get
265+
- list
266+
- apiGroups:
267+
- apps
268+
resources:
269+
- daemonsets
270+
- deployments
271+
- replicasets
272+
- statefulsets
273+
verbs:
274+
- '*'
253275
- apiGroups:
254276
- ""
255277
resources:
@@ -278,28 +300,6 @@ spec:
278300
- patch
279301
- update
280302
- watch
281-
- apiGroups:
282-
- '*'
283-
resources:
284-
- '*'
285-
verbs:
286-
- '*'
287-
- apiGroups:
288-
- addons.managed.openshift.io
289-
resources:
290-
- addons
291-
verbs:
292-
- get
293-
- list
294-
- apiGroups:
295-
- apps
296-
resources:
297-
- daemonsets
298-
- deployments
299-
- replicasets
300-
- statefulsets
301-
verbs:
302-
- '*'
303303
- apiGroups:
304304
- datasciencecluster.opendatahub.io
305305
resources:

components/kserve/kserve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (d *Kserve) SetEnabled(enabled bool) {
3434
d.Enabled = enabled
3535
}
3636

37-
func (m *Kserve) ReconcileComponent(owner metav1.Object, cli client.Client, scheme *runtime.Scheme, enabled bool, namespace string) error {
37+
func (d *Kserve) ReconcileComponent(owner metav1.Object, cli client.Client, scheme *runtime.Scheme, enabled bool, namespace string) error {
3838

3939
// Update Default rolebinding
4040
err := common.UpdatePodSecurityRolebinding(cli, []string{"kserve-controller-manager"}, namespace)

components/modelmeshserving/modelmeshserving.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ type ModelMeshServing struct {
1919
components.Component `json:""`
2020
}
2121

22-
func (d *ModelMeshServing) GetComponentName() string {
22+
func (m *ModelMeshServing) GetComponentName() string {
2323
return ComponentName
2424
}
2525

2626
// Verifies that Dashboard implements ComponentInterface
2727
var _ components.ComponentInterface = (*ModelMeshServing)(nil)
2828

29-
func (d *ModelMeshServing) IsEnabled() bool {
30-
return d.Enabled
29+
func (m *ModelMeshServing) IsEnabled() bool {
30+
return m.Enabled
3131
}
3232

33-
func (d *ModelMeshServing) SetEnabled(enabled bool) {
34-
d.Enabled = enabled
33+
func (m *ModelMeshServing) SetEnabled(enabled bool) {
34+
m.Enabled = enabled
3535
}
3636

3737
func (m *ModelMeshServing) ReconcileComponent(owner metav1.Object, cli client.Client, scheme *runtime.Scheme, enabled bool, namespace string) error {

components/workbenches/workbenches.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ type Workbenches struct {
1919
components.Component `json:""`
2020
}
2121

22-
func (d *Workbenches) GetComponentName() string {
22+
func (w *Workbenches) GetComponentName() string {
2323
return ComponentName
2424
}
2525

2626
// Verifies that Dashboard implements ComponentInterface
2727
var _ components.ComponentInterface = (*Workbenches)(nil)
2828

29-
func (d *Workbenches) IsEnabled() bool {
30-
return d.Enabled
29+
func (w *Workbenches) IsEnabled() bool {
30+
return w.Enabled
3131
}
3232

33-
func (d *Workbenches) SetEnabled(enabled bool) {
34-
d.Enabled = enabled
33+
func (w *Workbenches) SetEnabled(enabled bool) {
34+
w.Enabled = enabled
3535
}
3636

37-
func (m *Workbenches) ReconcileComponent(owner metav1.Object, cli client.Client, scheme *runtime.Scheme, enabled bool, namespace string) error {
37+
func (w *Workbenches) ReconcileComponent(owner metav1.Object, cli client.Client, scheme *runtime.Scheme, enabled bool, namespace string) error {
3838
// Update Default rolebinding
3939
err := common.UpdatePodSecurityRolebinding(cli, []string{"notebook-controller-service-account"}, namespace)
4040
if err != nil {
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: v0.9.2
6+
operatorframework.io/required-by: "opendatahub-operator.v0.0.7"
7+
operatorframework.io/owning-operator: ""
8+
creationTimestamp: null
9+
name: kfdefs.kfdef.apps.kubeflow.org
10+
spec:
11+
group: kfdef.apps.kubeflow.org
12+
names:
13+
kind: KfDef
14+
listKind: KfDefList
15+
plural: kfdefs
16+
singular: kfdef
17+
scope: Namespaced
18+
versions:
19+
- name: v1
20+
schema:
21+
openAPIV3Schema:
22+
description: KfDef is the Schema for the kfdefs API
23+
properties:
24+
apiVersion:
25+
description: 'APIVersion defines the versioned schema of this representation
26+
of an object. Servers should convert recognized schemas to the latest
27+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
28+
type: string
29+
kind:
30+
description: 'Kind is a string value representing the REST resource this
31+
object represents. Servers may infer this from the endpoint the client
32+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
33+
type: string
34+
metadata:
35+
type: object
36+
spec:
37+
description: KfDefSpec defines the desired state of KfDef
38+
properties:
39+
applications:
40+
items:
41+
description: Application defines an application to install
42+
properties:
43+
kustomizeConfig:
44+
properties:
45+
overlays:
46+
items:
47+
type: string
48+
type: array
49+
parameters:
50+
items:
51+
properties:
52+
name:
53+
type: string
54+
value:
55+
type: string
56+
type: object
57+
type: array
58+
repoRef:
59+
properties:
60+
name:
61+
type: string
62+
path:
63+
type: string
64+
type: object
65+
type: object
66+
name:
67+
type: string
68+
type: object
69+
type: array
70+
plugins:
71+
items:
72+
description: Plugin can be used to customize the generation and
73+
deployment of Kubeflow
74+
properties:
75+
apiVersion:
76+
description: 'APIVersion defines the versioned schema of this
77+
representation of an object. Servers should convert recognized
78+
schemas to the latest internal value, and may reject unrecognized
79+
values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
80+
type: string
81+
kind:
82+
description: 'Kind is a string value representing the REST resource
83+
this object represents. Servers may infer this from the endpoint
84+
the client submits requests to. Cannot be updated. In CamelCase.
85+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
86+
type: string
87+
metadata:
88+
type: object
89+
spec:
90+
type: object
91+
type: object
92+
type: array
93+
repos:
94+
items:
95+
description: Repo provides information about a repository providing
96+
config (e.g. kustomize packages, Deployment manager configs, etc...)
97+
properties:
98+
name:
99+
description: Name is a name to identify the repository.
100+
type: string
101+
uri:
102+
description: 'URI where repository can be obtained. Can use
103+
any URI understood by go-getter: https://github.com/hashicorp/go-getter/blob/master/README.md#installation-and-usage'
104+
type: string
105+
type: object
106+
type: array
107+
secrets:
108+
items:
109+
description: Secret provides information about secrets needed to
110+
configure Kubeflow. Secrets can be provided via references.
111+
properties:
112+
name:
113+
type: string
114+
secretSource:
115+
properties:
116+
envSource:
117+
properties:
118+
name:
119+
type: string
120+
type: object
121+
literalSource:
122+
properties:
123+
value:
124+
type: string
125+
type: object
126+
type: object
127+
type: object
128+
type: array
129+
version:
130+
type: string
131+
type: object
132+
status:
133+
description: KfDefStatus defines the observed state of KfDef
134+
properties:
135+
conditions:
136+
items:
137+
properties:
138+
lastTransitionTime:
139+
description: Last time the condition transitioned from one status
140+
to another.
141+
format: date-time
142+
type: string
143+
lastUpdateTime:
144+
description: The last time this condition was updated.
145+
format: date-time
146+
type: string
147+
message:
148+
description: A human readable message indicating details about
149+
the transition.
150+
type: string
151+
reason:
152+
description: The reason for the condition's last transition.
153+
type: string
154+
status:
155+
description: Status of the condition, one of True, False, Unknown.
156+
type: string
157+
type:
158+
description: Type of deployment condition.
159+
type: string
160+
required:
161+
- status
162+
- type
163+
type: object
164+
type: array
165+
reposCache:
166+
description: ReposCache is used to cache information about local caching
167+
of the URIs.
168+
items:
169+
properties:
170+
localPath:
171+
type: string
172+
name:
173+
type: string
174+
required:
175+
- localPath
176+
type: object
177+
type: array
178+
type: object
179+
type: object
180+
served: true
181+
storage: true
182+
subresources:
183+
status: {}
184+
status:
185+
acceptedNames:
186+
kind: ""
187+
plural: ""
188+
conditions: null
189+
storedVersions: null

config/rbac/role.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ metadata:
55
creationTimestamp: null
66
name: controller-manager-role
77
rules:
8+
- apiGroups:
9+
- '*'
10+
resources:
11+
- '*'
12+
verbs:
13+
- '*'
14+
- apiGroups:
15+
- addons.managed.openshift.io
16+
resources:
17+
- addons
18+
verbs:
19+
- get
20+
- list
21+
- apiGroups:
22+
- apps
23+
resources:
24+
- daemonsets
25+
- deployments
26+
- replicasets
27+
- statefulsets
28+
verbs:
29+
- '*'
830
- apiGroups:
931
- ""
1032
resources:
@@ -33,28 +55,6 @@ rules:
3355
- patch
3456
- update
3557
- watch
36-
- apiGroups:
37-
- '*'
38-
resources:
39-
- '*'
40-
verbs:
41-
- '*'
42-
- apiGroups:
43-
- addons.managed.openshift.io
44-
resources:
45-
- addons
46-
verbs:
47-
- get
48-
- list
49-
- apiGroups:
50-
- apps
51-
resources:
52-
- daemonsets
53-
- deployments
54-
- replicasets
55-
- statefulsets
56-
verbs:
57-
- '*'
5858
- apiGroups:
5959
- datasciencecluster.opendatahub.io
6060
resources:

0 commit comments

Comments
 (0)