Fix: Pass SSHLocalPort in Instance to configure driver#3746
Fix: Pass SSHLocalPort in Instance to configure driver#3746AkihiroSuda merged 1 commit intolima-vm:masterfrom
SSHLocalPort in Instance to configure driver#3746Conversation
006b8ab to
4ccf7d9
Compare
pkg/driver/driver.go
Outdated
| // SetConfig sets the configuration for the instance. | ||
| Configure(inst *store.Instance, sshLocalPort int) *ConfiguredDriver | ||
| // Configure sets the configuration for the instance. | ||
| Configure(opts ...ConfigOption) *ConfiguredDriver |
There was a problem hiding this comment.
I think we want to keep the instance, since that will always be there.
Configure(inst *store.Instance, opts ...ConfigOption) *ConfiguredDriver
pkg/driver/external/driver.proto
Outdated
| message SetConfigRequest { | ||
| bytes instance_config_json = 1; | ||
| int64 ssh_local_port = 3; | ||
| bytes config_opts = 1; |
There was a problem hiding this comment.
might have to decide on a transport here
| } | ||
|
|
||
| message SetConfigRequest { | ||
| bytes instance_config_json = 1; |
There was a problem hiding this comment.
this one should remain, I think?
4ccf7d9 to
b60a4c2
Compare
pkg/driver/external/driver.proto
Outdated
| message SetConfigRequest { | ||
| bytes instance_config_json = 1; | ||
| int64 ssh_local_port = 3; | ||
| bytes config_opts = 2; |
There was a problem hiding this comment.
Why do we need two jsons ?
Can't we just set the SSH port in the instance_config_json ?
There was a problem hiding this comment.
Do you mean to set it in Instance.SSHLocalPort?
There was a problem hiding this comment.
Then, is there a need for a ConfigOption?
There was a problem hiding this comment.
I thought the lima.yaml (config) said "0" for the port, and then the other parameter passed the current random port?
But if we edit the instance config in the store each time, then we don't need any runtime parameters
b60a4c2 to
9ea8cda
Compare
SSHLocalPort as an option to configure driverSSHLocalPort in Instance to configure driver
Signed-off-by: Ansuman Sahoo <[email protected]>
9ea8cda to
a680340
Compare
|
I don't understand how it separates the fixed port, versus the dynamic port? Or are we relying on that it is only changed while loading the yaml, not on disk? |
This pull request refactors the configuration mechanism for drivers in the
pkg/driverpackage, by passing theSSHLocalPortdirectly through Instance struct.Closes #3703