Skip to content

Commit

Permalink
fix: refactor simplify struct init code
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Jun 11, 2024
1 parent b95621e commit 2dcd78c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
1 change: 1 addition & 0 deletions sztp-agent/cmd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Copyright (C) 2022-2023 Intel Corporation
Copyright (c) 2022 Dell Inc, or its subsidiaries.
Copyright (C) 2022 Red Hat.
*/

// Package cmd implements the CLI commands
package cmd

Expand Down
19 changes: 6 additions & 13 deletions sztp-agent/pkg/secureagent/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,13 @@ func (a *Agent) doReportProgress(s ProgressType) error {
if s == ProgressTypeBootstrapComplete {
// TODO: generate real key here
encodedKey := base64.StdEncoding.EncodeToString([]byte("mysshpass"))
p.IetfSztpBootstrapServerInput.SSHHostKeys = struct {
SSHHostKey []struct {
Algorithm string `json:"algorithm"`
KeyData string `json:"key-data"`
} `json:"ssh-host-key,omitempty"`
p.IetfSztpBootstrapServerInput.SSHHostKeys.SSHHostKey = []struct {
Algorithm string `json:"algorithm"`
KeyData string `json:"key-data"`
}{
SSHHostKey: []struct {
Algorithm string `json:"algorithm"`
KeyData string `json:"key-data"`
}{
{
Algorithm: "ssh-rsa",
KeyData: encodedKey,
},
{
Algorithm: "ssh-rsa",
KeyData: encodedKey,
},
}
}
Expand Down

0 comments on commit 2dcd78c

Please sign in to comment.