-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97a9aab
commit f3231ea
Showing
14 changed files
with
390 additions
and
340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package engine | ||
|
||
import "github.com/nicklasfrahm/k3se/pkg/sshx" | ||
|
||
const ( | ||
// Program is used to configure the name of the configuration file. | ||
Program = "k3se" | ||
) | ||
|
||
// Node describes the configuration of a node. | ||
type Node struct { | ||
Role Role `yaml:"role"` | ||
SSH sshx.Config `yaml:"ssh"` | ||
NodeLabel []string `yaml:"node-label"` | ||
|
||
*sshx.Client `yaml:"-"` | ||
} | ||
|
||
// Connect establishes a connection to the node. | ||
func (node *Node) Connect(options ...Option) error { | ||
opts, err := GetDefaultOptions().Apply(options...) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
node.Client, err = sshx.NewClient(&node.SSH, | ||
sshx.WithProxy(opts.SSHProxy), | ||
sshx.WithLogger(opts.Logger), | ||
sshx.WithTimeout(opts.Timeout), | ||
) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} | ||
|
||
// Disconnect closes the connection to the node. | ||
func (node *Node) Disconnect() error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package k3se | ||
package ops | ||
|
||
import ( | ||
"errors" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.