Merge pull request #85046 from hvaara/fix-golint-pkg-registry--storage

Fix golint issues in pkg/registry/.../storage
This commit is contained in:
Kubernetes Prow Robot 2019-12-03 15:47:11 -08:00 committed by GitHub
commit bb9981e19f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 28 additions and 25 deletions

View File

@ -150,27 +150,18 @@ pkg/registry/autoscaling/rest
pkg/registry/batch/job
pkg/registry/batch/rest
pkg/registry/certificates/certificates
pkg/registry/certificates/certificates/storage
pkg/registry/certificates/rest
pkg/registry/coordination/rest
pkg/registry/core/componentstatus
pkg/registry/core/endpoint/storage
pkg/registry/core/event/storage
pkg/registry/core/limitrange/storage
pkg/registry/core/namespace
pkg/registry/core/namespace/storage
pkg/registry/core/node
pkg/registry/core/node/storage
pkg/registry/core/persistentvolume
pkg/registry/core/persistentvolume/storage
pkg/registry/core/persistentvolumeclaim
pkg/registry/core/persistentvolumeclaim/storage
pkg/registry/core/pod
pkg/registry/core/pod/rest
pkg/registry/core/podtemplate/storage
pkg/registry/core/replicationcontroller
pkg/registry/core/replicationcontroller/storage
pkg/registry/core/resourcequota/storage
pkg/registry/core/rest
pkg/registry/core/secret
pkg/registry/core/service
@ -185,10 +176,8 @@ pkg/registry/events/rest
pkg/registry/extensions/controller/storage
pkg/registry/extensions/rest
pkg/registry/flowcontrol/rest
pkg/registry/networking/networkpolicy/storage
pkg/registry/networking/rest
pkg/registry/node/rest
pkg/registry/policy/poddisruptionbudget/storage
pkg/registry/policy/rest
pkg/registry/rbac/clusterrole/policybased
pkg/registry/rbac/clusterrolebinding
@ -201,11 +190,9 @@ pkg/registry/rbac/rolebinding/policybased
pkg/registry/rbac/validation
pkg/registry/registrytest
pkg/registry/scheduling/rest
pkg/registry/settings/podpreset/storage
pkg/registry/settings/rest
pkg/registry/storage/rest
pkg/registry/storage/storageclass
pkg/registry/storage/storageclass/storage
pkg/scheduler/apis/config/v1alpha1
pkg/security/podsecuritypolicy
pkg/security/podsecuritypolicy/group

View File

@ -31,12 +31,12 @@ import (
csrregistry "k8s.io/kubernetes/pkg/registry/certificates/certificates"
)
// REST implements a RESTStorage for CertificateSigningRequest
// REST implements a RESTStorage for CertificateSigningRequest.
type REST struct {
*genericregistry.Store
}
// NewREST returns a registry which will store CertificateSigningRequest in the given helper
// NewREST returns a registry which will store CertificateSigningRequest in the given helper.
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, *ApprovalREST, error) {
store := &genericregistry.Store{
NewFunc: func() runtime.Object { return &certificates.CertificateSigningRequest{} },
@ -80,6 +80,7 @@ type StatusREST struct {
store *genericregistry.Store
}
// New creates a new CertificateSigningRequest object.
func (r *StatusREST) New() runtime.Object {
return &certificates.CertificateSigningRequest{}
}
@ -103,6 +104,7 @@ type ApprovalREST struct {
store *genericregistry.Store
}
// New creates a new CertificateSigningRequest object.
func (r *ApprovalREST) New() runtime.Object {
return &certificates.CertificateSigningRequest{}
}

View File

@ -28,6 +28,7 @@ import (
"k8s.io/kubernetes/pkg/registry/core/endpoint"
)
// REST implements a RESTStorage for endpoints.
type REST struct {
*genericregistry.Store
}

View File

@ -28,6 +28,7 @@ import (
"k8s.io/kubernetes/pkg/registry/core/event"
)
// REST implements a RESTStorage for events.
type REST struct {
*genericregistry.Store
}

View File

@ -25,11 +25,12 @@ import (
"k8s.io/kubernetes/pkg/registry/core/limitrange"
)
// REST implements a RESTStorage for limit ranges.
type REST struct {
*genericregistry.Store
}
// NewREST returns a RESTStorage object that will work against limitranges.
// NewREST returns a RESTStorage object that will work against limit ranges.
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, error) {
store := &genericregistry.Store{
NewFunc: func() runtime.Object { return &api.LimitRange{} },

View File

@ -22,7 +22,7 @@ import (
"net/http"
"net/url"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/registry/generic"
@ -39,7 +39,7 @@ import (
noderest "k8s.io/kubernetes/pkg/registry/core/node/rest"
)
// NodeStorage includes storage for nodes and all sub resources
// NodeStorage includes storage for nodes and all sub resources.
type NodeStorage struct {
Node *REST
Status *StatusREST
@ -48,6 +48,7 @@ type NodeStorage struct {
KubeletConnectionInfo client.ConnectionInfoGetter
}
// REST implements a RESTStorage for nodes.
type REST struct {
*genericregistry.Store
connection client.ConnectionInfoGetter
@ -59,6 +60,7 @@ type StatusREST struct {
store *genericregistry.Store
}
// New creates a new Node object.
func (r *StatusREST) New() runtime.Object {
return &api.Node{}
}

View File

@ -31,6 +31,7 @@ import (
"k8s.io/kubernetes/pkg/registry/core/persistentvolume"
)
// REST implements a RESTStorage for persistent volumes.
type REST struct {
*genericregistry.Store
}
@ -74,6 +75,7 @@ type StatusREST struct {
store *genericregistry.Store
}
// New creates a new PersistentVolume object.
func (r *StatusREST) New() runtime.Object {
return &api.PersistentVolume{}
}

View File

@ -31,6 +31,7 @@ import (
"k8s.io/kubernetes/pkg/registry/core/persistentvolumeclaim"
)
// REST implements a RESTStorage for persistent volume claims.
type REST struct {
*genericregistry.Store
}
@ -74,6 +75,7 @@ type StatusREST struct {
store *genericregistry.Store
}
// New creates a new PersistentVolumeClaim object.
func (r *StatusREST) New() runtime.Object {
return &api.PersistentVolumeClaim{}
}

View File

@ -27,6 +27,7 @@ import (
"k8s.io/kubernetes/pkg/registry/core/podtemplate"
)
// REST implements a RESTStorage for pod templates.
type REST struct {
*genericregistry.Store
}

View File

@ -31,6 +31,7 @@ import (
"k8s.io/kubernetes/pkg/registry/core/resourcequota"
)
// REST implements a RESTStorage for resource quotas.
type REST struct {
*genericregistry.Store
}
@ -73,6 +74,7 @@ type StatusREST struct {
store *genericregistry.Store
}
// New creates a new ResourceQuota object.
func (r *StatusREST) New() runtime.Object {
return &api.ResourceQuota{}
}

View File

@ -28,12 +28,12 @@ import (
"k8s.io/kubernetes/pkg/registry/networking/networkpolicy"
)
// rest implements a RESTStorage for NetworkPolicies against etcd
// REST implements a RESTStorage for NetworkPolicies against etcd.
type REST struct {
*genericregistry.Store
}
// NewREST returns a RESTStorage object that will work against NetworkPolicies
// NewREST returns a RESTStorage object that will work against NetworkPolicies.
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, error) {
store := &genericregistry.Store{
NewFunc: func() runtime.Object { return &networkingapi.NetworkPolicy{} },

View File

@ -31,7 +31,7 @@ import (
"k8s.io/kubernetes/pkg/registry/policy/poddisruptionbudget"
)
// rest implements a RESTStorage for pod disruption budgets against etcd
// REST implements a RESTStorage for pod disruption budgets against etcd.
type REST struct {
*genericregistry.Store
}
@ -64,11 +64,12 @@ func (r *REST) ShortNames() []string {
return []string{"pdb"}
}
// StatusREST implements the REST endpoint for changing the status of an podDisruptionBudget
// StatusREST implements the REST endpoint for changing the status of an podDisruptionBudget.
type StatusREST struct {
store *genericregistry.Store
}
// New creates a new PodDisruptionBudget object.
func (r *StatusREST) New() runtime.Object {
return &policyapi.PodDisruptionBudget{}
}

View File

@ -24,12 +24,12 @@ import (
"k8s.io/kubernetes/pkg/registry/settings/podpreset"
)
// rest implements a RESTStorage for replication controllers against etcd
// REST implements a RESTStorage for pod presets against etcd.
type REST struct {
*genericregistry.Store
}
// NewREST returns a RESTStorage object that will work against replication controllers.
// NewREST returns a RESTStorage object that will work against pod presets.
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, error) {
store := &genericregistry.Store{
NewFunc: func() runtime.Object { return &settingsapi.PodPreset{} },

View File

@ -28,11 +28,12 @@ import (
"k8s.io/kubernetes/pkg/registry/storage/storageclass"
)
// REST implements a RESTStorage for storage classes.
type REST struct {
*genericregistry.Store
}
// NewREST returns a RESTStorage object that will work against persistent volumes.
// NewREST returns a RESTStorage object that will work against storage classes.
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, error) {
store := &genericregistry.Store{
NewFunc: func() runtime.Object { return &storageapi.StorageClass{} },