Skip to content

Commit

Permalink
Merge pull request #46 from syseleven/remove-ssh-connection-test
Browse files Browse the repository at this point in the history
Remove SSH connection test since Gitlab Runner provides this feature already
  • Loading branch information
vooon authored Dec 13, 2024
2 parents bc04acb + 14d53b7 commit 6dc5c56
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions provider.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package fpoc

import (
"bytes"
"context"
"errors"
"fmt"
Expand All @@ -14,7 +13,6 @@ import (
"github.com/jinzhu/copier"
"github.com/sardinasystems/fleeting-plugin-openstack/internal/openstackclient"

"gitlab.com/gitlab-org/fleeting/fleeting/connector"
"gitlab.com/gitlab-org/fleeting/fleeting/provider"
)

Expand Down Expand Up @@ -320,28 +318,6 @@ func (g *InstanceGroup) ConnectInfo(ctx context.Context, instanceID string) (pro
info.Arch = "amd64"
}

// g.log.Debug("Info", "info", info)

inp := bytes.NewBuffer(nil)
combinedOut := bytes.NewBuffer(nil)

ropts := connector.ConnectorOptions{
DialOptions: connector.DialOptions{
// UseExternalAddr: true,
},
RunOptions: connector.RunOptions{
Command: `echo "ok"`,
Stdin: inp,
Stdout: combinedOut,
Stderr: combinedOut,
},
}
err = connector.Run(ctx, info, ropts)
if err != nil {
return provider.ConnectInfo{}, fmt.Errorf("Failed to test ssh: %w", err)
}
g.log.Debug("SSH test result", "out", combinedOut.String())

return info, nil
}

Expand Down

0 comments on commit 6dc5c56

Please sign in to comment.