Skip to content
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

DefaultConfigPath not consistent with GetConfigPath and SetConfigPath #129

Closed
xmcqueen opened this issue Jun 9, 2019 · 1 comment
Closed

Comments

@xmcqueen
Copy link

xmcqueen commented Jun 9, 2019

DefaultConfigPath in the lxc-binding is setting the path to the container root.

func DefaultConfigPath() string {
	return GlobalConfigItem("lxc.lxcpath")
} 

It seems to be used consistently for this purpose, its in all the examples and seems to be working perfectly. However, its confusing because in container.go I'm seeing SetConfigPath described as being used to set the configuration file's path - not the container root - which it does via go_lxc_set_config_path, which is described as being used to set the path to the containers's config file here:

https://linuxcontainers.org/lxc/apidoc/structlxc__container.html#ad140523960327ab5537629ee8dc62dd3

ConfigPath is used in the same way in container.go via the lxc-binding call to go_lxc_get_config_path. So the getter and the setter seem to be consistent. But the DefaultConfigPath seems to be confusingly misnamed. It should probably be DefaultContainerRoot.

get_config_path is described here:

https://linuxcontainers.org/lxc/apidoc/structlxc__container.html#a3cdd629f0b11a313938178a46b18a263

I'm not sure about advice, because changing that would break things. Its used in the Hashicorp nomad driver.

Should I put up a pr to rename it? It just sounds too hazardous.

@xmcqueen
Copy link
Author

xmcqueen commented Jun 9, 2019

I see, there's another config in the container root.

@xmcqueen xmcqueen closed this as completed Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant