From aa604942090ba316571f5888f0a44eea67e62ec6 Mon Sep 17 00:00:00 2001 From: SataQiu Date: Fri, 19 Apr 2019 04:06:06 +0800 Subject: [PATCH] fix golint failures of pkg/apis/authorization --- hack/.golint_failures | 1 - pkg/apis/authorization/register.go | 4 +++- pkg/apis/authorization/types.go | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hack/.golint_failures b/hack/.golint_failures index 8ab29fc3b7a..f2b12903977 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -14,7 +14,6 @@ pkg/apis/apps/v1beta2 pkg/apis/apps/validation pkg/apis/auditregistration/v1alpha1 pkg/apis/authentication/v1 -pkg/apis/authorization pkg/apis/authorization/v1 pkg/apis/authorization/validation pkg/apis/autoscaling diff --git a/pkg/apis/authorization/register.go b/pkg/apis/authorization/register.go index 7ebf0322a53..3f91937ca26 100644 --- a/pkg/apis/authorization/register.go +++ b/pkg/apis/authorization/register.go @@ -38,8 +38,10 @@ func Resource(resource string) schema.GroupResource { } var ( + // SchemeBuilder points to a list of functions added to Scheme. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme + // AddToScheme applies all the stored functions to the scheme. + AddToScheme = SchemeBuilder.AddToScheme ) func addKnownTypes(scheme *runtime.Scheme) error { diff --git a/pkg/apis/authorization/types.go b/pkg/apis/authorization/types.go index e798ec2123e..fafd1800d2d 100644 --- a/pkg/apis/authorization/types.go +++ b/pkg/apis/authorization/types.go @@ -138,7 +138,7 @@ type SelfSubjectAccessReviewSpec struct { NonResourceAttributes *NonResourceAttributes } -// SubjectAccessReviewStatus +// SubjectAccessReviewStatus represents the current state of a SubjectAccessReview. type SubjectAccessReviewStatus struct { // Allowed is required. True if the action would be allowed, false otherwise. Allowed bool @@ -177,6 +177,7 @@ type SelfSubjectRulesReview struct { Status SubjectRulesReviewStatus } +// SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview. type SelfSubjectRulesReviewSpec struct { // Namespace to evaluate rules for. Required. Namespace string