diff --git a/Makefile b/Makefile index c9e202a556d5fb3ae8f1955ae8ae014518ae0758..76f24905e4aecb3776a984b8a080b5c86ff4372e 100755 --- a/Makefile +++ b/Makefile @@ -249,6 +249,8 @@ endif which go-bindata || GO111MODULE=off GOBIN="$(GOPATH)$(DIRSEP)bin" go get github.com/jteeuwen/go-bindata/... PATH="$(PATH)$(PATHSEP)$(GOPATH)$(DIRSEP)bin" go-bindata -nomemcopy -o $@ -pkg assets deploy/addons/... -gofmt -s -w $@ + @#golint: Dns should be DNS (compat sed) + @sed -i -e 's/Dns/DNS/g' $@ && rm -f ./-e pkg/minikube/translate/translations.go: $(shell find "translations/" -type f) ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) @@ -308,7 +310,7 @@ vet: @go vet $(SOURCE_PACKAGES) .PHONY: golint -golint: +golint: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go @golint -set_exit_status $(SOURCE_PACKAGES) .PHONY: gocyclo diff --git a/cmd/minikube/cmd/delete.go b/cmd/minikube/cmd/delete.go index a0b14ec63f33d529fc8aca085f58d28816aa0921..3bbd48df712c397d688ecaefef65f79fb9b047ee 100644 --- a/cmd/minikube/cmd/delete.go +++ b/cmd/minikube/cmd/delete.go @@ -56,11 +56,15 @@ associated files.`, type typeOfError int const ( - Fatal typeOfError = 0 + // Fatal is a type of DeletionError + Fatal typeOfError = 0 + // MissingProfile is a type of DeletionError MissingProfile typeOfError = 1 + // MissingCluster is a type of DeletionError MissingCluster typeOfError = 2 ) +// DeletionError can be returned from DeleteProfiles type DeletionError struct { Err error Errtype typeOfError @@ -118,7 +122,7 @@ func runDelete(cmd *cobra.Command, args []string) { } } -// Deletes one or more profiles +// DeleteProfiles deletes one or more profiles func DeleteProfiles(profiles []*pkg_config.Profile) []error { var errs []error for _, profile := range profiles { @@ -246,7 +250,7 @@ func uninstallKubernetes(api libmachine.API, kc pkg_config.KubernetesConfig, bsN return nil } -// Handles deletion error from DeleteProfiles +// HandleDeletionErrors handles deletion errors from DeleteProfiles func HandleDeletionErrors(errors []error) { if len(errors) == 1 { handleSingleDeletionError(errors[0]) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 74eba46dcf53104d0f2e626bbfdf28d6dc9a1419..91a59131c9dbfe449b535b1a906e6bb1f02b016f 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -137,6 +137,7 @@ type kubectlversion struct { SVersion VersionInfo `json:"serverVersion"` } +// VersionInfo holds version information type VersionInfo struct { Major string `json:"major"` Minor string `json:"minor"` diff --git a/pkg/minikube/bootstrapper/images/images.go b/pkg/minikube/bootstrapper/images/images.go index a8bc2b13e04731fa797d6f982ccb4a59dba239a1..b69d1160bd78c0be8e968c8ffc242ddf852d9830 100644 --- a/pkg/minikube/bootstrapper/images/images.go +++ b/pkg/minikube/bootstrapper/images/images.go @@ -26,7 +26,9 @@ import ( ) const ( - DefaultImageRepo = "k8s.gcr.io" + // DefaultImageRepo is the default repository for images + DefaultImageRepo = "k8s.gcr.io" + // DefaultMinikubeRepo is the default repository for minikube DefaultMinikubeRepo = "gcr.io/k8s-minikube" ) diff --git a/pkg/minikube/cluster/cluster.go b/pkg/minikube/cluster/cluster.go index 7526daf324f3a75ee7b4b1c73c415719ea4ac06f..7e3b611934228c3779f5f5c5277f928fc4b73203 100644 --- a/pkg/minikube/cluster/cluster.go +++ b/pkg/minikube/cluster/cluster.go @@ -604,8 +604,8 @@ func CreateSSHShell(api libmachine.API, args []string) error { return client.Shell(args...) } -// EnsureMinikubeRunningOrExit checks that minikube has a status available and that -// the status is `Running`, otherwise it will exit +// IsMinikubeRunning checks that minikube has a status available and that +// the status is `Running` func IsMinikubeRunning(api libmachine.API) bool { s, err := GetHostStatus(api) if err != nil { diff --git a/pkg/minikube/cluster/machine.go b/pkg/minikube/cluster/machine.go index 8a24b04e3c66fb90ade0d686146e1d6c034d9ad7..bb8e880389872b1747e461a2e886d5697dbf3010 100644 --- a/pkg/minikube/cluster/machine.go +++ b/pkg/minikube/cluster/machine.go @@ -26,6 +26,7 @@ import ( "k8s.io/minikube/pkg/minikube/machine" ) +// Machine contains information about a machine type Machine struct { *host.Host } @@ -58,7 +59,7 @@ func (h *Machine) IsValid() bool { return true } -// ListsMachines return all valid and invalid machines +// ListMachines return all valid and invalid machines // If a machine is valid or invalid is determined by the cluster.IsValid function func ListMachines(miniHome ...string) (validMachines []*Machine, inValidMachines []*Machine, err error) { pDirs, err := machineDirs(miniHome...) @@ -80,7 +81,7 @@ func ListMachines(miniHome ...string) (validMachines []*Machine, inValidMachines return validMachines, inValidMachines, nil } -// Loads a machine or throws an error if the machine could not be loadedG +// LoadMachine loads a machine or throws an error if the machine could not be loadedG func LoadMachine(name string) (*Machine, error) { api, err := machine.NewAPIClient() if err != nil { diff --git a/pkg/minikube/config/profile.go b/pkg/minikube/config/profile.go index 2c09f4b4462060a343e6329e2d60cd19aea698a1..1ee1bff6f200a40f09a4945631a7b749f0e844c2 100644 --- a/pkg/minikube/config/profile.go +++ b/pkg/minikube/config/profile.go @@ -136,7 +136,7 @@ func ListProfiles(miniHome ...string) (validPs []*Profile, inValidPs []*Profile, return validPs, inValidPs, nil } -// loadProfile loads type Profile based on its name +// LoadProfile loads type Profile based on its name func LoadProfile(name string, miniHome ...string) (*Profile, error) { cfg, err := DefaultLoader.LoadConfigFromFile(name, miniHome...) p := &Profile{