Skip to content

Add support for collecting instance IP address #3696

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/guestagent/api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,11 @@ func (c *GuestAgentClient) Tunnel(ctx context.Context) (api.GuestService_TunnelC
}
return stream, nil
}

func (c *GuestAgentClient) IPv4(ctx context.Context) (*api.CommandOutput, error) {
return c.cli.GetIPv4(ctx, &emptypb.Empty{})
}

func (c *GuestAgentClient) IPv6(ctx context.Context) (*api.CommandOutput, error) {
return c.cli.GetIPv6(ctx, &emptypb.Empty{})
}
13 changes: 9 additions & 4 deletions pkg/guestagent/api/guestservice.pb.desc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

ô
ž
guestservice.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto"0
Info(
local_ports ( 2.IPPortR
Expand All @@ -12,7 +12,10 @@ localPorts"
IPPort
protocol ( Rprotocol
ip ( Rip
port (Rport"X
port (Rport"B
CommandOutput
is_json (RisJson
payload ( Rpayload"X
Inotify

mount_path ( R mountPath.
Expand All @@ -22,9 +25,11 @@ mount_path ( R mountPath.
protocol ( Rprotocol
data ( Rdata
guestAddr ( R guestAddr$
udpTargetAddr ( RudpTargetAddr2È
udpTargetAddr ( RudpTargetAddr2®
GuestService(
GetInfo.google.protobuf.Empty.Info-
GetEvents.google.protobuf.Empty.Event01
PostInotify.Inotify.google.protobuf.Empty(,
Tunnel.TunnelMessage.TunnelMessage(0B!Zgithub.com/lima-vm/lima/pkg/apibproto3
Tunnel.TunnelMessage.TunnelMessage(01
GetIPv4.google.protobuf.Empty.CommandOutput1
GetIPv6.google.protobuf.Empty.CommandOutputB!Zgithub.com/lima-vm/lima/pkg/apibproto3
Expand Down
208 changes: 145 additions & 63 deletions pkg/guestagent/api/guestservice.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/guestagent/api/guestservice.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ service GuestService {
rpc PostInotify(stream Inotify) returns (google.protobuf.Empty);

rpc Tunnel(stream TunnelMessage) returns (stream TunnelMessage);
rpc GetIPv4(google.protobuf.Empty) returns (CommandOutput);
rpc GetIPv6(google.protobuf.Empty) returns (CommandOutput);
}

message Info {
Expand All @@ -29,6 +31,11 @@ message IPPort {
int32 port = 3;
}

message CommandOutput {
bool is_json = 1;
bytes payload = 2;
}

message Inotify {
string mount_path = 1;
google.protobuf.Timestamp time = 2;
Expand Down
Loading
Loading