Skip to content

Fix: Pass SSHLocalPort as an option 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

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

Conversation

unsuman
Copy link
Contributor

@unsuman unsuman commented Jul 17, 2025

This pull request refactors the configuration mechanism for drivers in the pkg/driver package, replacing the previous method of passing individual parameters with a more flexible options-based approach. The changes introduce a new Options struct and ConfigOption type, enabling dynamic configuration and improving code maintainability and extensibility.

Closes #3703

@unsuman unsuman force-pushed the fix/rm-sshlocalport branch 3 times, most recently from 6a71b1b to 006b8ab Compare July 17, 2025 16:54
@unsuman unsuman force-pushed the fix/rm-sshlocalport branch from 006b8ab to 4ccf7d9 Compare July 17, 2025 17:11
Copy link
Member

@afbjorklund afbjorklund left a 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

// 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
Copy link
Member

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

@afbjorklund afbjorklund requested a review from AkihiroSuda July 17, 2025 18:23
@@ -41,8 +41,7 @@ message StartResponse {
}

message SetConfigRequest {
bytes instance_config_json = 1;
int64 ssh_local_port = 3;
bytes config_opts = 1;
Copy link
Member

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;
Copy link
Member

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?

@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Jul 17, 2025
@AkihiroSuda AkihiroSuda added the gsoc/2025 Google Summer of Code 2025 label Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc/2025 Google Summer of Code 2025
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSHLocalPort should be in instance, and not as a parameter
3 participants