Skip to content

Commit 8379cb1

Browse files
Merge pull request #89 from carbonin/add-acm-rbac
MGMT-20105: Add rbac for managedclustersets/join
2 parents 55ea6d3 + f26f08f commit 8379cb1

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed

Diff for: controlplane-components.yaml

+33-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ metadata:
1717
annotations:
1818
controller-gen.kubebuilder.io/version: v0.14.0
1919
labels:
20-
cluster.x-k8s.io/v1beta1: v1alpha1
20+
cluster.x-k8s.io/v1beta1: v1alpha2
2121
name: openshiftassistedcontrolplanes.controlplane.cluster.x-k8s.io
2222
spec:
2323
group: controlplane.cluster.x-k8s.io
@@ -70,10 +70,10 @@ spec:
7070
name: Age
7171
type: date
7272
- description: OpenShift version associated with this control plane
73-
jsonPath: .spec.version
74-
name: Version
73+
jsonPath: .spec.distributionVersion
74+
name: Distribution Version
7575
type: string
76-
name: v1alpha1
76+
name: v1alpha2
7777
schema:
7878
openAPIV3Schema:
7979
description: OpenshiftAssistedControlPlane is the Schema for the openshiftassistedcontrolplane
@@ -221,16 +221,17 @@ spec:
221221
type: string
222222
type: object
223223
x-kubernetes-map-type: atomic
224-
releaseImage:
225-
type: string
226224
sshAuthorizedKey:
227225
description: SSHAuthorizedKey ssh key for accessing the cluster
228226
nodes after reboot
229227
type: string
230228
required:
231229
- baseDomain
232-
- releaseImage
233230
type: object
231+
distributionVersion:
232+
description: DistributionVersion describes the targeted OpenShift
233+
version
234+
type: string
234235
machineTemplate:
235236
properties:
236237
infrastructureRef:
@@ -418,6 +419,19 @@ spec:
418419
type: object
419420
type: object
420421
x-kubernetes-map-type: atomic
422+
nodeRegistration:
423+
description: NodeRegistrationOption holds fields related to registering
424+
nodes to the cluster
425+
properties:
426+
kubeletExtraLabels:
427+
description: KubeletExtraLabels passes extra labels to kubelet.
428+
items:
429+
type: string
430+
type: array
431+
name:
432+
description: Defaults to the hostname of the node if not provided.
433+
type: string
434+
type: object
421435
osImageVersion:
422436
description: |-
423437
OSImageVersion is the version of OS image to use when generating the InfraEnv.
@@ -463,11 +477,9 @@ spec:
463477
replicas:
464478
format: int32
465479
type: integer
466-
version:
467-
type: string
468480
required:
481+
- distributionVersion
469482
- machineTemplate
470-
- version
471483
type: object
472484
status:
473485
description: OpenshiftAssistedControlPlaneStatus defines the observed
@@ -563,6 +575,11 @@ spec:
563575
- type
564576
type: object
565577
type: array
578+
distributionVersion:
579+
description: |-
580+
DistributionVersion represents the current OpenShift version installed on the
581+
control plane machines in the cluster.
582+
type: string
566583
failureMessage:
567584
description: |-
568585
ErrorMessage indicates that there is a terminal problem reconciling the
@@ -731,6 +748,12 @@ rules:
731748
- patch
732749
- update
733750
- watch
751+
- apiGroups:
752+
- cluster.open-cluster-management.io
753+
resources:
754+
- managedclustersets/join
755+
verbs:
756+
- create
734757
- apiGroups:
735758
- cluster.x-k8s.io
736759
resources:

Diff for: controlplane/config/rbac/role.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ rules:
3939
- patch
4040
- update
4141
- watch
42+
- apiGroups:
43+
- cluster.open-cluster-management.io
44+
resources:
45+
- managedclustersets/join
46+
verbs:
47+
- create
4248
- apiGroups:
4349
- cluster.x-k8s.io
4450
resources:

Diff for: controlplane/internal/controller/openshiftassistedcontrolplane_controller.go

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ var minVersion = semver.MustParse(minOpenShiftVersion)
9494
// +kubebuilder:rbac:groups=controlplane.cluster.x-k8s.io,resources=openshiftassistedcontrolplanes/finalizers,verbs=update
9595
// +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=machines;machines/status,verbs=get;list;watch;create;update;patch;delete
9696
// +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=machinepools,verbs=list
97+
// +kubebuilder:rbac:groups=cluster.open-cluster-management.io,resources=managedclustersets/join,verbs=create
9798
// +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;create;update;delete
9899
// +kubebuilder:rbac:groups="",resources=configmaps,verbs=get;list;watch;create;update;patch;delete
99100

0 commit comments

Comments
 (0)