Skip to content

Commit aafac3c

Browse files
authored
Merge pull request kubernetes#77380 from SataQiu/fix-golint-apis-20190503
Fix golint failures of pkg/apis/scheduling, pkg/apis/storage/util, etc
2 parents 56ceba5 + ed04c5f commit aafac3c

File tree

7 files changed

+17
-11
lines changed

7 files changed

+17
-11
lines changed

hack/.golint_failures

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,9 @@ pkg/apis/rbac/v1
4747
pkg/apis/rbac/v1alpha1
4848
pkg/apis/rbac/v1beta1
4949
pkg/apis/rbac/validation
50-
pkg/apis/scheduling
5150
pkg/apis/storage
52-
pkg/apis/storage/util
5351
pkg/apis/storage/v1
54-
pkg/apis/storage/v1/util
5552
pkg/apis/storage/v1beta1
56-
pkg/apis/storage/v1beta1/util
5753
pkg/cloudprovider/providers/fake
5854
pkg/cloudprovider/providers/photon
5955
pkg/controller

pkg/apis/scheduling/register.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ func Resource(resource string) schema.GroupResource {
3838
}
3939

4040
var (
41+
// SchemeBuilder points to a list of functions added to Scheme.
4142
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
42-
AddToScheme = SchemeBuilder.AddToScheme
43+
// AddToScheme applies all the stored functions to the scheme.
44+
AddToScheme = SchemeBuilder.AddToScheme
4345
)
4446

4547
func addKnownTypes(scheme *runtime.Scheme) error {

pkg/apis/scheduling/types.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ const (
2929
SystemCriticalPriority = 2 * HighestUserDefinablePriority
3030
// SystemPriorityClassPrefix is the prefix reserved for system priority class names. Other priority
3131
// classes are not allowed to start with this prefix.
32-
SystemPriorityClassPrefix = "system-"
3332
// NOTE: In order to avoid conflict of names with user-defined priority classes, all the names must
3433
// start with SystemPriorityClassPrefix.
34+
SystemPriorityClassPrefix = "system-"
35+
// SystemClusterCritical is the system priority class name that represents cluster-critical.
3536
SystemClusterCritical = SystemPriorityClassPrefix + "cluster-critical"
36-
SystemNodeCritical = SystemPriorityClassPrefix + "node-critical"
37+
// SystemNodeCritical is the system priority class name that represents node-critical.
38+
SystemNodeCritical = SystemPriorityClassPrefix + "node-critical"
3739
)
3840

3941
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

pkg/apis/storage/util/helpers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2020

2121
// IsDefaultStorageClassAnnotation represents a StorageClass annotation that
2222
// marks a class as the default StorageClass
23-
//TODO: remove Beta when no longer used
2423
const IsDefaultStorageClassAnnotation = "storageclass.kubernetes.io/is-default-class"
24+
25+
// BetaIsDefaultStorageClassAnnotation is the beta version of IsDefaultStorageClassAnnotation.
26+
// TODO: remove Beta when no longer used
2527
const BetaIsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
2628

2729
// IsDefaultAnnotationText returns a pretty Yes/No String if

pkg/apis/storage/v1/util/helpers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ import (
2222

2323
// IsDefaultStorageClassAnnotation represents a StorageClass annotation that
2424
// marks a class as the default StorageClass
25-
//TODO: remove Beta when no longer used
2625
const IsDefaultStorageClassAnnotation = "storageclass.kubernetes.io/is-default-class"
26+
27+
// BetaIsDefaultStorageClassAnnotation is the beta version of IsDefaultStorageClassAnnotation.
28+
// TODO: remove Beta when no longer used
2729
const BetaIsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
2830

2931
// IsDefaultAnnotationText returns a pretty Yes/No String if

pkg/apis/storage/v1beta1/util/helpers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2020

2121
// IsDefaultStorageClassAnnotation represents a StorageClass annotation that
2222
// marks a class as the default StorageClass
23-
//TODO: remove Beta when no longer used
2423
const IsDefaultStorageClassAnnotation = "storageclass.kubernetes.io/is-default-class"
24+
25+
// BetaIsDefaultStorageClassAnnotation is the beta version of IsDefaultStorageClassAnnotation.
26+
// TODO: remove Beta when no longer used
2527
const BetaIsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
2628

2729
// IsDefaultAnnotationText returns a pretty Yes/No String if

pkg/kubectl/util/storage/storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
// marks a class as the default StorageClass
2929
const IsDefaultStorageClassAnnotation = "storageclass.kubernetes.io/is-default-class"
3030

31-
// BetaIsDefaultStorageClassAnnotation is the beta version of BetaIsDefaultStorageClassAnnotation.
31+
// BetaIsDefaultStorageClassAnnotation is the beta version of IsDefaultStorageClassAnnotation.
3232
const BetaIsDefaultStorageClassAnnotation = "storageclass.beta.kubernetes.io/is-default-class"
3333

3434
// IsDefaultAnnotationText returns a pretty Yes/No String if

0 commit comments

Comments
 (0)