Skip to content

Commit

Permalink
Merge pull request #10401 from afbjorklund/lint-cleanup
Browse files Browse the repository at this point in the history
Clean up accumulated golint with missing godoc
  • Loading branch information
medyagh authored Feb 8, 2021
2 parents d6f7f69 + f316c0f commit e2f3a9f
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions pkg/drivers/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,22 @@ func (d *Driver) DriverName() string {
return "ssh"
}

// GetSSHHostname returns hostname for use with ssh
func (d *Driver) GetSSHHostname() (string, error) {
return d.GetIP()
}

// GetSSHUsername returns username for use with ssh
func (d *Driver) GetSSHUsername() string {
return d.SSHUser
}

// GetSSHKeyPath returns the key path for SSH
func (d *Driver) GetSSHKeyPath() string {
return d.SSHKeyPath
}

// PreCreateCheck checks for correct privileges and dependencies
func (d *Driver) PreCreateCheck() error {
if d.SSHKey != "" {
if _, err := os.Stat(d.SSHKey); os.IsNotExist(err) {
Expand All @@ -107,6 +111,7 @@ func (d *Driver) PreCreateCheck() error {
return nil
}

// Create a host using the driver's config
func (d *Driver) Create() error {
if d.SSHKey == "" {
log.Info("No SSH key specified. Assuming an existing key at the default location.")
Expand Down Expand Up @@ -134,6 +139,7 @@ func (d *Driver) Create() error {
return nil
}

// GetURL returns a Docker URL inside this host
func (d *Driver) GetURL() (string, error) {
if err := drivers.MustBeRunning(d); err != nil {
return "", err
Expand All @@ -147,6 +153,7 @@ func (d *Driver) GetURL() (string, error) {
return fmt.Sprintf("tcp://%s", net.JoinHostPort(ip, strconv.Itoa(d.EnginePort))), nil
}

// GetState returns the state that the host is in (running, stopped, etc)
func (d *Driver) GetState() (state.State, error) {
address := net.JoinHostPort(d.IPAddress, strconv.Itoa(d.SSHPort))

Expand Down Expand Up @@ -224,6 +231,7 @@ func (d *Driver) Kill() error {
return nil
}

// Remove a host, including any data which may have been written by it.
func (d *Driver) Remove() error {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/bootstrapper/bsutil/kverify/kverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
AppsRunningKey = "apps_running"
// NodeReadyKey is the name used in the flags for waiting for the node status to be ready
NodeReadyKey = "node_ready"
// NodeReadyKey is the name used in the flags for waiting for the node status to be ready
// KubeletKey is the name used in the flags for waiting for the kubelet status to be ready
KubeletKey = "kubelet"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/cni/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func New(cc config.ClusterConfig) (Manager, error) {
}
}

// IsDisabled checks if CNI is disabled
func IsDisabled(cc config.ClusterConfig) bool {
if cc.KubernetesConfig.NetworkPlugin != "" && cc.KubernetesConfig.NetworkPlugin != "cni" {
return true
Expand Down
5 changes: 4 additions & 1 deletion pkg/minikube/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ const (
TestDiskUsedEnv = "MINIKUBE_TEST_STORAGE_CAPACITY"

// scheduled stop constants
ScheduledStopEnvFile = "/var/lib/minikube/scheduled-stop/environment"

// ScheduledStopEnvFile is the environment file for scheduled-stop
ScheduledStopEnvFile = "/var/lib/minikube/scheduled-stop/environment"
// ScheduledStopSystemdService is the service file for scheduled-stop
ScheduledStopSystemdService = "minikube-scheduled-stop"

// MinikubeExistingPrefix is used to save the original environment when executing docker-env
Expand Down
2 changes: 2 additions & 0 deletions pkg/minikube/kubeconfig/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// implementing the runtime.Object internally so we can write extensions to kubeconfig

// Extension represents information to identify clusters and contexts
type Extension struct {
runtime.TypeMeta `json:",inline"`
Version string `json:"version"`
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/machine/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func CreateSSHShell(api libmachine.API, cc config.ClusterConfig, n config.Node,
return client.Shell(args...)
}

// GetSSHHostAddrPort returns the host address and port for ssh
func GetSSHHostAddrPort(api libmachine.API, cc config.ClusterConfig, n config.Node) (string, int, error) {
host, err := getHost(api, cc, n)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/sshutil/sshutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func newSSHHost(d drivers.Driver) (*sshHost, error) {
}, nil
}

// KnownHost checks if this host is in the knownHosts file
func KnownHost(host string, knownHosts string) bool {
fd, err := os.Open(knownHosts)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/style/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Options struct {
Spinner bool
}

// SpinnerCharacter is which of the spinner.CharSets to use
const SpinnerCharacter = 9

// Config is a map of style name to style struct
Expand Down

0 comments on commit e2f3a9f

Please sign in to comment.