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 7926449
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: kusionstack/operating
newName: coldsteelrail/kusion-operating
newTag: test
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 7926449

Please sign in to comment.