Skip to content

Commit

Permalink
add note for register
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdsteelRail committed Jul 16, 2024
1 parent af2f0c7 commit 6a4f0d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/controllers/operationjob/opscontrol/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ package opscontrol

import "kusionstack.io/operating/pkg/controllers/utils/podopslifecycle"

// registry of operationjob.spec.action handler
// registry map of operationjob.spec.action to actionHandler
var actionRegistry map[string]ActionHandler

// registry of operationjob.spec.action podOpsLifecycle
// registry map of operationjob.spec.action to lifecycleAdapter
var lifecycleAdapterRegistry map[string]podopslifecycle.LifecycleAdapter

// RegisterAction will register an operationJob action with handler and lifecycleAdapter
// NOTE: if the operation can be done without protection of podOpsLifecycle, just register lifecycleAdapter with 'nil'
func RegisterAction(action string, handler ActionHandler, lifecycleAdapter podopslifecycle.LifecycleAdapter) {
if actionRegistry == nil {
actionRegistry = make(map[string]ActionHandler)
Expand Down

0 comments on commit 6a4f0d0

Please sign in to comment.