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

Refactor: network.YAML → network.Config #2667

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jandubois
Copy link
Member

Because YAML is just the serialization format, and not what the data is used for.

@jandubois jandubois requested a review from a team September 29, 2024 01:59
@jandubois jandubois added this to the v1.0 milestone Sep 29, 2024
Because YAML is just the serialization format, and not what the data is used for.

Signed-off-by: Jan Dubois <[email protected]>
@@ -353,12 +353,12 @@ func attachNetwork(driver *driver.BaseDriver, vmConfig *vz.VirtualMachineConfigu
if runtime.GOOS != "darwin" {
return fmt.Errorf("networks.yaml '%s' configuration is only supported on macOS right now", nw.Lima)
}
socketVMNetOk, err := nwCfg.IsDaemonInstalled(networks.SocketVMNet)
socketVMNetOk, err := config.IsDaemonInstalled(networks.SocketVMNet)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nwCfg isn't fine?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was unsure about it, but then decided to change it for consistency. Any time networks.LoadConfig() is called, the return value is stored in config. This made more sense to me than using different names in different places.

But I agree it is confusing inside qemu, which has its own Config type. How about calling it config inside the networks package and nwConfig everywhere else?

I'm also fine with using cfg and nwCfg, but again would want to use these names then consistently everywhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nwCfg is more descriptive than config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants