Skip to content

Commit

Permalink
wip fix cherry-pick
Browse files Browse the repository at this point in the history
  • Loading branch information
jan--f committed Nov 15, 2021
1 parent 6f3ad38 commit 5ff3f13
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
15 changes: 15 additions & 0 deletions jsonnet/components/cluster-monitoring-operator.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,21 @@ function(params) {
resources: ['certificatesigningrequests/approval', 'certificatesigningrequests/status'],
verbs: ['get', 'list', 'watch'],
},
// The operator needs these permissions to cordon nodes when rebalancing
// pods.
{
apiGroups: [''],
resources: ['nodes'],
verbs: ['get', 'list', 'update', 'patch'],
},
// The operator needs to get PersistentVolumes to know their storage
// topology. Based on that information, it will only delete PVCs attached
// to volumes with a zonal topology when rebalancing pods.
{
apiGroups: [''],
resources: ['persistentvolumes'],
verbs: ['get'],
},
{
apiGroups: [''],
resources: ['events'],
Expand Down
15 changes: 15 additions & 0 deletions manifests/0000_50_cluster-monitoring-operator_02-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,21 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- update
- patch
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- apiGroups:
- ""
resources:
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ func New(kubeConfigPath string) (*Framework, cleanUpFunc, error) {
if err != nil {
return nil, nil, errors.Wrap(err, "creating kubeClient failed")
}
// Necessary to test the operator status.
openshiftConfigClient, err := openshiftconfigclientset.NewForConfig(config)
if err != nil {
return nil, nil, errors.Wrap(err, "creating openshiftConfigClient failed")
}

// So far only necessary for prometheusK8sClient.
openshiftRouteClient, err := routev1.NewForConfig(config)
Expand Down Expand Up @@ -130,6 +135,7 @@ func New(kubeConfigPath string) (*Framework, cleanUpFunc, error) {
f := &Framework{
RestConfig: config,
OperatorClient: operatorClient,
OpenShiftConfigClient: openshiftConfigClient,
OpenShiftRouteClient: openshiftRouteClient,
KubeClient: kubeClient,
APIServicesClient: apiServicesClient,
Expand Down

0 comments on commit 5ff3f13

Please sign in to comment.