mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Fixes golint errors in pkg/api
This commit is contained in:
parent
0748ac39e8
commit
6914681ed0
@ -104,6 +104,7 @@ type EnvVar struct {
|
|||||||
Value string `yaml:"value,omitempty" json:"value,omitempty"`
|
Value string `yaml:"value,omitempty" json:"value,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HTTPGetProbe describes a liveness probe based on HTTP Get requests.
|
||||||
type HTTPGetProbe struct {
|
type HTTPGetProbe struct {
|
||||||
// Path to access on the http server
|
// Path to access on the http server
|
||||||
Path string `yaml:"path,omitempty" json:"path,omitempty"`
|
Path string `yaml:"path,omitempty" json:"path,omitempty"`
|
||||||
@ -113,6 +114,7 @@ type HTTPGetProbe struct {
|
|||||||
Host string `yaml:"host,omitempty" json:"host,omitempty"`
|
Host string `yaml:"host,omitempty" json:"host,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LivenessProbe describes a liveness probe to be examined to the container.
|
||||||
type LivenessProbe struct {
|
type LivenessProbe struct {
|
||||||
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
|
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
|
||||||
// Type of liveness probe. Current legal values "http"
|
// Type of liveness probe. Current legal values "http"
|
||||||
|
@ -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.
|
// 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) {
|
func (list *errorList) Append(errs ...error) {
|
||||||
*list = append(*list, errs...)
|
*list = append(*list, errs...)
|
||||||
@ -87,7 +87,7 @@ func validateVolumes(volumes []Volume) (util.StringSet, errorList) {
|
|||||||
return allNames, allErrs
|
return allNames, allErrs
|
||||||
}
|
}
|
||||||
|
|
||||||
var supportedPortProtocols util.StringSet = util.NewStringSet("TCP", "UDP")
|
var supportedPortProtocols = util.NewStringSet("TCP", "UDP")
|
||||||
|
|
||||||
func validatePorts(ports []Port) errorList {
|
func validatePorts(ports []Port) errorList {
|
||||||
allErrs := 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.
|
// every Port.HostPort across the whole pod must be unique.
|
||||||
allErrs.Append(checkHostPortConflicts(containers)...)
|
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.
|
// ValidateManifest tests that the specified ContainerManifest has valid data.
|
||||||
// This includes checking formatting and uniqueness. It also canonicalizes the
|
// This includes checking formatting and uniqueness. It also canonicalizes the
|
||||||
|
Loading…
Reference in New Issue
Block a user