-
Notifications
You must be signed in to change notification settings - Fork 3
Minor nodeletctl code reorg #86
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
base: main
Are you sure you want to change the base?
Conversation
d935416 to
0147ca8
Compare
0147ca8 to
02fc4ff
Compare
| ServicesCidr string | ||
| } | ||
|
|
||
| func setNodeletClusterCfg(cfg *BootstrapConfig, nodelet *NodeletConfig) { |
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.
Why not just return the config object instead of pointer? It makes the function much more readable from the definition.
| if _, err := os.Stat(nodeStateDir); os.IsNotExist(err) { | ||
| zap.S().Infof("Creating node state dir: %s\n", nodeStateDir) | ||
| if err := os.MkdirAll(nodeStateDir, 0777); err != nil { | ||
| return "", fmt.Errorf("Failed to create node state dir for host %s: %s", host.HostId, err) |
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.
Error strings should not start with upper case letters. General go convention.
| func GenNodeletConfigLocal(host *NodeletConfig, templateName string) (string, error) { | ||
| nodeStateDir := filepath.Join(ClusterStateDir, host.ClusterId, host.HostId) | ||
| if _, err := os.Stat(nodeStateDir); os.IsNotExist(err) { | ||
| zap.S().Infof("Creating node state dir: %s\n", nodeStateDir) |
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.
\n should not be needed.
Just mvoed some functions around, changed ordering. Moved the flat nodelet config struct and generation to a new file called config.go