refactor: drop custom package in favor of hcloud-go

This commit is contained in:
Julian Tölle 2024-06-23 16:47:57 +02:00
parent a07856317d
commit 4a54ff8834
3 changed files with 2 additions and 80 deletions

View file

@ -10,6 +10,7 @@ import (
"time"
"github.com/hetznercloud/hcloud-go/v2/hcloud"
"github.com/hetznercloud/hcloud-go/v2/hcloud/exp/kit/sshutils"
"golang.org/x/crypto/ssh"
"github.com/apricote/hcloud-upload-image/hcloudimages/contextlogger"
@ -17,7 +18,6 @@ import (
"github.com/apricote/hcloud-upload-image/hcloudimages/internal/control"
"github.com/apricote/hcloud-upload-image/hcloudimages/internal/labelutil"
"github.com/apricote/hcloud-upload-image/hcloudimages/internal/randomid"
"github.com/apricote/hcloud-upload-image/hcloudimages/internal/sshkey"
"github.com/apricote/hcloud-upload-image/hcloudimages/internal/sshsession"
)
@ -136,7 +136,7 @@ func (s *Client) Upload(ctx context.Context, options UploadOptions) (*hcloud.Ima
// 1. Create SSH Key
logger.InfoContext(ctx, "# Step 1: Generating SSH Key")
publicKey, privateKey, err := sshkey.GenerateKeyPair()
privateKey, publicKey, err := sshutils.GenerateKeyPair()
if err != nil {
return nil, fmt.Errorf("failed to generate temporary ssh key pair: %w", err)
}