-
Notifications
You must be signed in to change notification settings - Fork 682
Fix: Pass SSHLocalPort
in Instance to configure driver
#3746
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: master
Are you sure you want to change the base?
Conversation
006b8ab
to
4ccf7d9
Compare
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 only meant to wrap the "int" second parameter in a struct, I think the first parameter was good as it was.
The name can be discussed, if it is ConfigOption or RuntimeOption or whatever it is actually referring to
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -41,8 +41,7 @@ message StartResponse { | |||
} | |||
|
|||
message SetConfigRequest { | |||
bytes instance_config_json = 1; | |||
int64 ssh_local_port = 3; | |||
bytes config_opts = 1; |
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.
might have to decide on a transport here
@@ -41,8 +41,7 @@ message StartResponse { | |||
} | |||
|
|||
message SetConfigRequest { | |||
bytes instance_config_json = 1; |
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 one should remain, I think?
4ccf7d9
to
b60a4c2
Compare
pkg/driver/external/driver.proto
Outdated
@@ -42,7 +42,7 @@ message StartResponse { | |||
|
|||
message SetConfigRequest { | |||
bytes instance_config_json = 1; | |||
int64 ssh_local_port = 3; | |||
bytes config_opts = 2; |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean to set it in Instance.SSHLocalPort
?
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.
Yes
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.
Then, is there a need for a ConfigOption?
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.
Probably no
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 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
This pull request refactors the configuration mechanism for drivers in the
pkg/driver
package, by passing theSSHLocalPort
directly through Instance struct.Closes #3703