Add golangci-lint workflow (#4999)
* fix lint workflow * add golang lint * close http response body
This commit is contained in:
@@ -179,7 +179,7 @@ func (p *pvcEvaluator) UsageStats(options quota.UsageStatsOptions) (quota.UsageS
|
||||
var _ quota.Evaluator = &pvcEvaluator{}
|
||||
|
||||
func toExternalPersistentVolumeClaimOrError(obj runtime.Object) (*corev1.PersistentVolumeClaim, error) {
|
||||
pvc := &corev1.PersistentVolumeClaim{}
|
||||
var pvc *corev1.PersistentVolumeClaim
|
||||
switch t := obj.(type) {
|
||||
case *corev1.PersistentVolumeClaim:
|
||||
pvc = t
|
||||
|
||||
@@ -144,10 +144,7 @@ func (p *podEvaluator) GroupResource() schema.GroupResource {
|
||||
// Handles returns true if the evaluator should handle the specified attributes.
|
||||
func (p *podEvaluator) Handles(a admission.Attributes) bool {
|
||||
op := a.GetOperation()
|
||||
if op == admission.Create {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return op == admission.Create
|
||||
}
|
||||
|
||||
// Matches returns true if the evaluator matches the specified quota with the provided input item
|
||||
@@ -276,7 +273,7 @@ func podComputeUsageHelper(requests corev1.ResourceList, limits corev1.ResourceL
|
||||
}
|
||||
|
||||
func toExternalPodOrError(obj runtime.Object) (*corev1.Pod, error) {
|
||||
pod := &corev1.Pod{}
|
||||
var pod *corev1.Pod
|
||||
switch t := obj.(type) {
|
||||
case *corev1.Pod:
|
||||
pod = t
|
||||
|
||||
@@ -94,7 +94,7 @@ func (p *serviceEvaluator) UncoveredQuotaScopes(limitedScopes []corev1.ScopedRes
|
||||
|
||||
// convert the input object to an internal service object or error.
|
||||
func toExternalServiceOrError(obj runtime.Object) (*corev1.Service, error) {
|
||||
svc := &corev1.Service{}
|
||||
var svc *corev1.Service
|
||||
switch t := obj.(type) {
|
||||
case *corev1.Service:
|
||||
svc = t
|
||||
|
||||
Reference in New Issue
Block a user