NodeActionsForNode filters registered actions by availability for the provided node.
(node *api.Node)
| 123 | // NodeActionsForNode filters registered actions by availability for the |
| 124 | // provided node. |
| 125 | func (r *pluginRegistry) NodeActionsForNode(node *api.Node) []NodeAction { |
| 126 | r.mu.RLock() |
| 127 | defer r.mu.RUnlock() |
| 128 | |
| 129 | if len(r.nodeActions) == 0 { |
| 130 | return nil |
| 131 | } |
| 132 | |
| 133 | var filtered []NodeAction |
| 134 | for _, action := range r.nodeActions { |
| 135 | if action.IsAvailable == nil || action.IsAvailable(node) { |
| 136 | filtered = append(filtered, action) |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | return filtered |
| 141 | } |
| 142 | |
| 143 | // GuestActions returns a snapshot of all registered guest actions. |
| 144 | func (r *pluginRegistry) GuestActions() []GuestAction { |
no outgoing calls