Skip to content

Commit

Permalink
Merge pull request #2870 from rewantsoni/mmode-rpc
Browse files Browse the repository at this point in the history
rpc: add rpc calls to create the maintenance mode reconciler in ocs-operator
  • Loading branch information
openshift-merge-bot[bot] authored Nov 20, 2024
2 parents d486fab + fdc4a8f commit 2e7cf01
Show file tree
Hide file tree
Showing 13 changed files with 1,198 additions and 553 deletions.
2 changes: 2 additions & 0 deletions controllers/util/k8sutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const (
ExitCodeThatShouldRestartTheProcess = 42

BlockPoolMirroringTargetIDAnnotation = "ocs.openshift.io/mirroring-target-id"
RequestMaintenanceModeAnnotation = "ocs.openshift.io/request-maintenance-mode"
CephRBDMirrorName = "cephrbdmirror"
)

var podNamespace = os.Getenv(PodNamespaceEnvVar)
Expand Down
1 change: 1 addition & 0 deletions deploy/ocs-operator/manifests/provider-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ rules:
- cephfilesystemsubvolumegroups
- cephblockpoolradosnamespaces
- cephblockpools
- cephrbdmirrors
verbs:
- get
- list
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rbac/provider-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ rules:
- cephfilesystemsubvolumegroups
- cephblockpoolradosnamespaces
- cephblockpools
- cephrbdmirrors
verbs:
- get
- list
Expand Down
16 changes: 16 additions & 0 deletions services/provider/api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,19 @@ func (cc *OCSProviderClient) PeerStorageCluster(ctx context.Context, onboardingT

return cc.Client.PeerStorageCluster(apiCtx, req)
}

func (cc *OCSProviderClient) RequestMaintenanceMode(ctx context.Context, consumerUUID string, enable bool) (*pb.RequestMaintenanceModeResponse, error) {
if cc.Client == nil || cc.clientConn == nil {
return nil, fmt.Errorf("provider client is closed")
}

req := &pb.RequestMaintenanceModeRequest{
StorageConsumerUUID: consumerUUID,
Enable: enable,
}

apiCtx, cancel := context.WithTimeout(ctx, cc.timeout)
defer cancel()

return cc.Client.RequestMaintenanceMode(apiCtx, req)
}
Loading

0 comments on commit 2e7cf01

Please sign in to comment.