Add tests for supervisor request handlers

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
pull/11537/head
Brad Davidson 2024-12-16 22:18:48 +00:00 committed by Brad Davidson
parent e6327652f0
commit f345697c0a
2 changed files with 1508 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -224,6 +224,16 @@ func (m *NodeStore) Create(node *v1.Node) (*v1.Node, error) {
return node, nil return node, nil
} }
func (m *NodeStore) Get(name string) (*v1.Node, error) {
if m.nodes == nil {
return nil, ErrorNotFound("node", name)
}
if node, ok := m.nodes[name]; ok {
return &node, nil
}
return nil, ErrorNotFound("node", name)
}
func (m *NodeStore) List(ls labels.Selector) ([]v1.Node, error) { func (m *NodeStore) List(ls labels.Selector) ([]v1.Node, error) {
nodes := []v1.Node{} nodes := []v1.Node{}
if ls == nil { if ls == nil {