Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove golint failures from pkg/apis/admissionregistration #77033

Merged
merged 1 commit into from
Apr 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion hack/.golint_failures
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmd/kube-controller-manager/app
cmd/kubeadm/app/apis/kubeadm/v1beta1
pkg/apis/abac/latest
pkg/apis/admission
pkg/apis/admissionregistration
pkg/apis/admissionregistration/v1beta1
pkg/apis/admissionregistration/validation
pkg/apis/apps
Expand Down
5 changes: 4 additions & 1 deletion pkg/apis/admissionregistration/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
)

// GroupName is the name used for this API group
const GroupName = "admissionregistration.k8s.io"

// SchemeGroupVersion is group version used to register these objects
Expand All @@ -37,8 +38,10 @@ func Resource(resource string) schema.GroupResource {
}

var (
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
// AddToScheme is a global function that registers this API group & version to a scheme
AddToScheme = SchemeBuilder.AddToScheme
)

// Adds the list of known types to scheme.
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/admissionregistration/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type Rule struct {
Scope *ScopeType
}

// ScopeType specifies the type of scope being used
type ScopeType string

const (
Expand All @@ -75,6 +76,7 @@ const (
AllScopes ScopeType = "*"
)

// FailurePolicyType specifies the type of failure policy
type FailurePolicyType string

const (
Expand All @@ -84,6 +86,7 @@ const (
Fail FailurePolicyType = "Fail"
)

// SideEffectClass denotes the type of side effects resulting from calling the webhook
type SideEffectClass string

const (
Expand Down Expand Up @@ -263,6 +266,7 @@ type RuleWithOperations struct {
Rule
}

// OperationType specifies what type of operation the admission hook cares about.
type OperationType string

// The constants should be kept in sync with those defined in k8s.io/kubernetes/pkg/admission/interface.go.
Expand Down