-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reset config to nodes which support and add cli command #29
Conversation
Pull Request Test Coverage Report for Build 1148945467
💛 - Coveralls |
cmd/topology/topology.go
Outdated
} | ||
ctx := cmd.Context() | ||
t.Load(ctx) | ||
var nodes []*node.Node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should simplify this block a bit:
nodes := t.Nodes()
if len(args) > 1 {
n, err := t.Node(args[1])
if err != nil {
return err
}
nodes = []*node.Node{n}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
cmd/topology/topology.go
Outdated
} | ||
nodes = append(nodes, n) | ||
} | ||
var resetable []node.Reseter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: resettable and later in the interface its resetter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
return err | ||
} | ||
nodes = append(nodes, n) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will add the specified node to the entire collection of nodes a second time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grr this why i didn't want to have that pattern
This adds
kne_cli topology reset
to reset the configuration of the node to a default config
if no devices are provides all nodes in the topology will be attempted
--skip will skip nodes which don't support resetcfg but will continue through all nodes