From 6914681ed0a8faf5b4893ce9f98d6af3511cc6f6 Mon Sep 17 00:00:00 2001 From: "Yuki Sonoda (Yugui)" Date: Thu, 10 Jul 2014 20:46:35 +0900 Subject: [PATCH] Fixes golint errors in pkg/api --- pkg/api/types.go | 2 ++ pkg/api/validation.go | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/api/types.go b/pkg/api/types.go index aa79e0c0087..4f48d488143 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -104,6 +104,7 @@ type EnvVar struct { Value string `yaml:"value,omitempty" json:"value,omitempty"` } +// HTTPGetProbe describes a liveness probe based on HTTP Get requests. type HTTPGetProbe struct { // Path to access on the http server Path string `yaml:"path,omitempty" json:"path,omitempty"` @@ -113,6 +114,7 @@ type HTTPGetProbe struct { Host string `yaml:"host,omitempty" json:"host,omitempty"` } +// LivenessProbe describes a liveness probe to be examined to the container. type LivenessProbe struct { Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"` // Type of liveness probe. Current legal values "http" diff --git a/pkg/api/validation.go b/pkg/api/validation.go index aa090551900..d58cbdf0521 100644 --- a/pkg/api/validation.go +++ b/pkg/api/validation.go @@ -64,7 +64,7 @@ func makeNotFoundError(field string, value interface{}) ValidationError { } // A helper for accumulating errors. This could be moved to util if anyone else needs it. -type errorList []error; +type errorList []error func (list *errorList) Append(errs ...error) { *list = append(*list, errs...) @@ -87,7 +87,7 @@ func validateVolumes(volumes []Volume) (util.StringSet, errorList) { return allNames, allErrs } -var supportedPortProtocols util.StringSet = util.NewStringSet("TCP", "UDP") +var supportedPortProtocols = util.NewStringSet("TCP", "UDP") func validatePorts(ports []Port) errorList { allErrs := errorList{} @@ -219,10 +219,10 @@ func validateContainers(containers []Container, volumes util.StringSet) errorLis // every Port.HostPort across the whole pod must be unique. allErrs.Append(checkHostPortConflicts(containers)...) - return allErrs; + return allErrs } -var supportedManifestVersions util.StringSet = util.NewStringSet("v1beta1", "v1beta2") +var supportedManifestVersions = util.NewStringSet("v1beta1", "v1beta2") // ValidateManifest tests that the specified ContainerManifest has valid data. // This includes checking formatting and uniqueness. It also canonicalizes the