Skip to content

Commit f15f752

Browse files
committed
fix(install): namespaced openshift resources
1 parent 1d74661 commit f15f752

File tree

4 files changed

+75
-14
lines changed

4 files changed

+75
-14
lines changed

pkg/install/operator.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -467,13 +467,13 @@ func installClusterRoleBinding(ctx context.Context, c client.Client, collection
467467
func installOpenShiftRoles(ctx context.Context, c client.Client, namespace string, customizer ResourceCustomizer, collection *kubernetes.Collection, force bool, global bool) error {
468468
if global {
469469
return ResourcesOrCollect(ctx, c, namespace, collection, force, customizer,
470-
"/config/rbac/openshift/descoped/operator-cluster-role-openshift.yaml",
471-
"/config/rbac/openshift/descoped/operator-cluster-role-binding-openshift.yaml",
470+
"/config/rbac/descoped/operator-cluster-role-openshift.yaml",
471+
"/config/rbac/descoped/operator-cluster-role-binding-openshift.yaml",
472472
)
473473
} else {
474474
return ResourcesOrCollect(ctx, c, namespace, collection, force, customizer,
475-
"/config/rbac/openshift/namespaced/operator-role-openshift.yaml",
476-
"/config/rbac/openshift/namespaced/operator-role-binding-openshift.yaml",
475+
"/config/rbac/namespaced/operator-role-openshift.yaml",
476+
"/config/rbac/namespaced/operator-role-binding-openshift.yaml",
477477
)
478478
}
479479
}

pkg/resources/config/rbac/namespaced/operator-cluster-role-console-binding-openshift.yaml pkg/resources/config/rbac/namespaced/operator-role-binding-openshift.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
# limitations under the License.
1616
# ---------------------------------------------------------------------------
1717

18-
kind: ClusterRoleBinding
18+
kind: RoleBinding
1919
apiVersion: rbac.authorization.k8s.io/v1
2020
metadata:
21-
name: camel-k-operator-console-openshift
21+
name: camel-k-operator-openshift
2222
labels:
2323
app: "camel-k"
2424
subjects:
2525
- kind: ServiceAccount
2626
name: camel-k-operator
2727
roleRef:
28-
kind: ClusterRole
29-
name: camel-k-operator-console-openshift
30-
apiGroup: rbac.authorization.k8s.io
28+
kind: Role
29+
name: camel-k-operator-openshift
30+
apiGroup: rbac.authorization.k8s.io

pkg/resources/config/rbac/namespaced/operator-cluster-role-console-openshift.yaml pkg/resources/config/rbac/namespaced/operator-role-openshift.yaml

+66-4
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,31 @@
1515
# limitations under the License.
1616
# ---------------------------------------------------------------------------
1717

18-
kind: ClusterRole
18+
kind: Role
1919
apiVersion: rbac.authorization.k8s.io/v1
2020
metadata:
21-
name: camel-k-operator-console-openshift
21+
name: camel-k-operator-openshift
2222
labels:
2323
app: "camel-k"
2424
rules:
2525
- apiGroups:
26-
- console.openshift.io
26+
- camel.apache.org
2727
resources:
28-
- consoleclidownloads
28+
- builds/finalizers
29+
- integrationkits/finalizers
30+
- integrationplatforms/finalizers
31+
- integrationprofiles/finalizers
32+
- integrations/finalizers
33+
- pipes/finalizers
34+
verbs:
35+
- update
36+
- apiGroups:
37+
- ""
38+
- "build.openshift.io"
39+
resources:
40+
- buildconfigs
41+
- buildconfigs/webhooks
42+
- builds
2943
verbs:
3044
- create
3145
- delete
@@ -35,3 +49,51 @@ rules:
3549
- patch
3650
- update
3751
- watch
52+
- apiGroups:
53+
- ""
54+
- "image.openshift.io"
55+
resources:
56+
- imagestreamimages
57+
- imagestreammappings
58+
- imagestreams
59+
- imagestreams/secrets
60+
- imagestreamtags
61+
verbs:
62+
- create
63+
- delete
64+
- deletecollection
65+
- get
66+
- list
67+
- patch
68+
- update
69+
- watch
70+
- apiGroups:
71+
- ""
72+
- build.openshift.io
73+
resources:
74+
- buildconfigs/instantiate
75+
- buildconfigs/instantiatebinary
76+
- builds/clone
77+
verbs:
78+
- create
79+
- apiGroups:
80+
- ""
81+
- "route.openshift.io"
82+
resources:
83+
- routes
84+
verbs:
85+
- create
86+
- delete
87+
- deletecollection
88+
- get
89+
- list
90+
- patch
91+
- update
92+
- watch
93+
- apiGroups:
94+
- ""
95+
- route.openshift.io
96+
resources:
97+
- routes/custom-host
98+
verbs:
99+
- create

script/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,6 @@ ifdef OPERATOR_ID
743743
@sed -i 's/value: .*/value: $(OPERATOR_ID)/' $(KUST_TMP)/$(KUSTOMIZE_DIR)/patch-operator-id.yaml
744744
@echo "INFO: adding a suffix for ClusterRoleBindings $(OPERATOR_ID)"
745745
cd $(KUST_TMP)/install/base/config/rbac/descoped && kustomize edit set namesuffix -- -$(OPERATOR_ID)
746-
cd $(KUST_TMP)/install/base/config/rbac/openshift/descoped && kustomize edit set namesuffix -- -$(OPERATOR_ID)
747746
else
748747
@echo "INFO: no operator ID variable \"OPERATOR_ID\" provided. Keeping default."
749748
endif

0 commit comments

Comments
 (0)