mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 12:18:16 +00:00 
			
		
		
		
	Fix golint issues in api/admission and api/admissionregistration
This commit is contained in:
		@@ -191,10 +191,6 @@ plugin/pkg/admission/eventratelimit/apis/eventratelimit/v1alpha1
 | 
				
			|||||||
plugin/pkg/admission/limitranger
 | 
					plugin/pkg/admission/limitranger
 | 
				
			||||||
plugin/pkg/auth/authorizer/node
 | 
					plugin/pkg/auth/authorizer/node
 | 
				
			||||||
plugin/pkg/auth/authorizer/rbac
 | 
					plugin/pkg/auth/authorizer/rbac
 | 
				
			||||||
staging/src/k8s.io/api/admission/v1
 | 
					 | 
				
			||||||
staging/src/k8s.io/api/admission/v1beta1
 | 
					 | 
				
			||||||
staging/src/k8s.io/api/admissionregistration/v1
 | 
					 | 
				
			||||||
staging/src/k8s.io/api/admissionregistration/v1beta1
 | 
					 | 
				
			||||||
staging/src/k8s.io/api/apiserverinternal/v1alpha1
 | 
					staging/src/k8s.io/api/apiserverinternal/v1alpha1
 | 
				
			||||||
staging/src/k8s.io/api/apps/v1
 | 
					staging/src/k8s.io/api/apps/v1
 | 
				
			||||||
staging/src/k8s.io/api/apps/v1beta1
 | 
					staging/src/k8s.io/api/apps/v1beta1
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,12 +33,14 @@ func Resource(resource string) schema.GroupResource {
 | 
				
			|||||||
	return SchemeGroupVersion.WithResource(resource).GroupResource()
 | 
						return SchemeGroupVersion.WithResource(resource).GroupResource()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
 | 
				
			||||||
 | 
					// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
	// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
 | 
						// SchemeBuilder points to a list of functions added to Scheme.
 | 
				
			||||||
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
 | 
					 | 
				
			||||||
	SchemeBuilder      = runtime.NewSchemeBuilder(addKnownTypes)
 | 
						SchemeBuilder      = runtime.NewSchemeBuilder(addKnownTypes)
 | 
				
			||||||
	localSchemeBuilder = &SchemeBuilder
 | 
						localSchemeBuilder = &SchemeBuilder
 | 
				
			||||||
	AddToScheme        = localSchemeBuilder.AddToScheme
 | 
						// AddToScheme is a common registration function for mapping packaged scoped group & version keys to a scheme.
 | 
				
			||||||
 | 
						AddToScheme = localSchemeBuilder.AddToScheme
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Adds the list of known types to the given scheme.
 | 
					// Adds the list of known types to the given scheme.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,12 +33,14 @@ func Resource(resource string) schema.GroupResource {
 | 
				
			|||||||
	return SchemeGroupVersion.WithResource(resource).GroupResource()
 | 
						return SchemeGroupVersion.WithResource(resource).GroupResource()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
 | 
				
			||||||
 | 
					// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
	// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
 | 
						// SchemeBuilder points to a list of functions added to Scheme.
 | 
				
			||||||
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
 | 
					 | 
				
			||||||
	SchemeBuilder      = runtime.NewSchemeBuilder(addKnownTypes)
 | 
						SchemeBuilder      = runtime.NewSchemeBuilder(addKnownTypes)
 | 
				
			||||||
	localSchemeBuilder = &SchemeBuilder
 | 
						localSchemeBuilder = &SchemeBuilder
 | 
				
			||||||
	AddToScheme        = localSchemeBuilder.AddToScheme
 | 
						// AddToScheme is a common registration function for mapping packaged scoped group & version keys to a scheme.
 | 
				
			||||||
 | 
						AddToScheme = localSchemeBuilder.AddToScheme
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Adds the list of known types to the given scheme.
 | 
					// Adds the list of known types to the given scheme.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,7 @@ import (
 | 
				
			|||||||
	"k8s.io/apimachinery/pkg/runtime/schema"
 | 
						"k8s.io/apimachinery/pkg/runtime/schema"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// GroupName is the group name for this API.
 | 
				
			||||||
const GroupName = "admissionregistration.k8s.io"
 | 
					const GroupName = "admissionregistration.k8s.io"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// SchemeGroupVersion is group version used to register these objects
 | 
					// SchemeGroupVersion is group version used to register these objects
 | 
				
			||||||
@@ -32,12 +33,14 @@ func Resource(resource string) schema.GroupResource {
 | 
				
			|||||||
	return SchemeGroupVersion.WithResource(resource).GroupResource()
 | 
						return SchemeGroupVersion.WithResource(resource).GroupResource()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
 | 
				
			||||||
 | 
					// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
	// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
 | 
						// SchemeBuilder points to a list of functions added to Scheme.
 | 
				
			||||||
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
 | 
					 | 
				
			||||||
	SchemeBuilder      = runtime.NewSchemeBuilder(addKnownTypes)
 | 
						SchemeBuilder      = runtime.NewSchemeBuilder(addKnownTypes)
 | 
				
			||||||
	localSchemeBuilder = &SchemeBuilder
 | 
						localSchemeBuilder = &SchemeBuilder
 | 
				
			||||||
	AddToScheme        = localSchemeBuilder.AddToScheme
 | 
						// AddToScheme is a common registration function for mapping packaged scoped group & version keys to a scheme.
 | 
				
			||||||
 | 
						AddToScheme = localSchemeBuilder.AddToScheme
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Adds the list of known types to scheme.
 | 
					// Adds the list of known types to scheme.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -63,6 +63,7 @@ type Rule struct {
 | 
				
			|||||||
	Scope *ScopeType `json:"scope,omitempty" protobuf:"bytes,4,rep,name=scope"`
 | 
						Scope *ScopeType `json:"scope,omitempty" protobuf:"bytes,4,rep,name=scope"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ScopeType specifies a scope for a Rule.
 | 
				
			||||||
type ScopeType string
 | 
					type ScopeType string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -75,6 +76,7 @@ const (
 | 
				
			|||||||
	AllScopes ScopeType = "*"
 | 
						AllScopes ScopeType = "*"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// FailurePolicyType specifies a failure policy that defines how unrecognized errors from the admission endpoint are handled.
 | 
				
			||||||
type FailurePolicyType string
 | 
					type FailurePolicyType string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -84,16 +86,17 @@ const (
 | 
				
			|||||||
	Fail FailurePolicyType = "Fail"
 | 
						Fail FailurePolicyType = "Fail"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// MatchPolicyType specifies the type of match policy
 | 
					// MatchPolicyType specifies the type of match policy.
 | 
				
			||||||
type MatchPolicyType string
 | 
					type MatchPolicyType string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
	// Exact means requests should only be sent to the webhook if they exactly match a given rule
 | 
						// Exact means requests should only be sent to the webhook if they exactly match a given rule.
 | 
				
			||||||
	Exact MatchPolicyType = "Exact"
 | 
						Exact MatchPolicyType = "Exact"
 | 
				
			||||||
	// Equivalent means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version.
 | 
						// Equivalent means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version.
 | 
				
			||||||
	Equivalent MatchPolicyType = "Equivalent"
 | 
						Equivalent MatchPolicyType = "Equivalent"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// SideEffectClass specifies the types of side effects a webhook may have.
 | 
				
			||||||
type SideEffectClass string
 | 
					type SideEffectClass string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -472,6 +475,7 @@ type RuleWithOperations struct {
 | 
				
			|||||||
	Rule `json:",inline" protobuf:"bytes,2,opt,name=rule"`
 | 
						Rule `json:",inline" protobuf:"bytes,2,opt,name=rule"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// OperationType specifies an operation for a request.
 | 
				
			||||||
type OperationType string
 | 
					type OperationType string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// The constants should be kept in sync with those defined in k8s.io/kubernetes/pkg/admission/interface.go.
 | 
					// The constants should be kept in sync with those defined in k8s.io/kubernetes/pkg/admission/interface.go.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,7 @@ import (
 | 
				
			|||||||
	"k8s.io/apimachinery/pkg/runtime/schema"
 | 
						"k8s.io/apimachinery/pkg/runtime/schema"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// GroupName is the group name for this API.
 | 
				
			||||||
const GroupName = "admissionregistration.k8s.io"
 | 
					const GroupName = "admissionregistration.k8s.io"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// SchemeGroupVersion is group version used to register these objects
 | 
					// SchemeGroupVersion is group version used to register these objects
 | 
				
			||||||
@@ -32,12 +33,14 @@ func Resource(resource string) schema.GroupResource {
 | 
				
			|||||||
	return SchemeGroupVersion.WithResource(resource).GroupResource()
 | 
						return SchemeGroupVersion.WithResource(resource).GroupResource()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
 | 
				
			||||||
 | 
					// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
	// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
 | 
						// SchemeBuilder points to a list of functions added to Scheme.
 | 
				
			||||||
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
 | 
					 | 
				
			||||||
	SchemeBuilder      = runtime.NewSchemeBuilder(addKnownTypes)
 | 
						SchemeBuilder      = runtime.NewSchemeBuilder(addKnownTypes)
 | 
				
			||||||
	localSchemeBuilder = &SchemeBuilder
 | 
						localSchemeBuilder = &SchemeBuilder
 | 
				
			||||||
	AddToScheme        = localSchemeBuilder.AddToScheme
 | 
						// AddToScheme is a common registration function for mapping packaged scoped group & version keys to a scheme.
 | 
				
			||||||
 | 
						AddToScheme = localSchemeBuilder.AddToScheme
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Adds the list of known types to scheme.
 | 
					// Adds the list of known types to scheme.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -63,6 +63,7 @@ type Rule struct {
 | 
				
			|||||||
	Scope *ScopeType `json:"scope,omitempty" protobuf:"bytes,4,rep,name=scope"`
 | 
						Scope *ScopeType `json:"scope,omitempty" protobuf:"bytes,4,rep,name=scope"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ScopeType specifies a scope for a Rule.
 | 
				
			||||||
type ScopeType string
 | 
					type ScopeType string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -75,6 +76,7 @@ const (
 | 
				
			|||||||
	AllScopes ScopeType = "*"
 | 
						AllScopes ScopeType = "*"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// FailurePolicyType specifies a failure policy that defines how unrecognized errors from the admission endpoint are handled.
 | 
				
			||||||
type FailurePolicyType string
 | 
					type FailurePolicyType string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -94,6 +96,7 @@ const (
 | 
				
			|||||||
	Equivalent MatchPolicyType = "Equivalent"
 | 
						Equivalent MatchPolicyType = "Equivalent"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// SideEffectClass specifies the types of side effects a webhook may have.
 | 
				
			||||||
type SideEffectClass string
 | 
					type SideEffectClass string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -496,6 +499,7 @@ type RuleWithOperations struct {
 | 
				
			|||||||
	Rule `json:",inline" protobuf:"bytes,2,opt,name=rule"`
 | 
						Rule `json:",inline" protobuf:"bytes,2,opt,name=rule"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// OperationType specifies an operation for a request.
 | 
				
			||||||
type OperationType string
 | 
					type OperationType string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// The constants should be kept in sync with those defined in k8s.io/kubernetes/pkg/admission/interface.go.
 | 
					// The constants should be kept in sync with those defined in k8s.io/kubernetes/pkg/admission/interface.go.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user