c/a/api: reorganize and add AgentInit
Move hardware reporting-related data into a separate file for better
organization.
Also add an AgentInit message which will be used to pass data to the
Agent.
Change-Id: I1eecbd5a78da03170651f76f9f24e134dddaca4f
Reviewed-on: https://review.monogon.dev/c/monogon/+/1140
Reviewed-by: Leopold Schabel <leo@monogon.tech>
Tested-by: Leopold Schabel <leo@monogon.tech>
diff --git a/cloud/shepherd/equinix/manager/initializer_test.go b/cloud/shepherd/equinix/manager/initializer_test.go
index f07341c..6e82b98 100644
--- a/cloud/shepherd/equinix/manager/initializer_test.go
+++ b/cloud/shepherd/equinix/manager/initializer_test.go
@@ -21,11 +21,9 @@
// fakeSSHClient is an SSHClient that pretends to start an agent, but in reality
// just responds with what an agent would respond on every execution attempt.
-type fakeSSHClient struct {
-}
+type fakeSSHClient struct{}
-type fakeSSHConnection struct {
-}
+type fakeSSHConnection struct{}
func (f *fakeSSHClient) Dial(ctx context.Context, address, username string, sshkey ssh.Signer, timeout time.Duration) (SSHConnection, error) {
return &fakeSSHConnection{}, nil
@@ -43,8 +41,10 @@
return nil, nil, fmt.Errorf("while generating agent public key: %v", err)
}
arsp := apb.TakeoverResponse{
- InitMessage: &aim,
- Key: pub,
+ Result: &apb.TakeoverResponse_Success{Success: &apb.TakeoverSuccess{
+ InitMessage: &aim,
+ Key: pub,
+ }},
}
arspb, err := proto.Marshal(&arsp)
if err != nil {