Skip to content

Commit

Permalink
Bump golangci-lint to v1.52.2 (#181)
Browse files Browse the repository at this point in the history
* ci: bump golangci-lint to v1.52.2

Signed-off-by: Jose Valdes <[email protected]>

* controllers: Remove unused parameters

This change removes unused parameters detected by golangci-lint.

Ran:
```
  golangci-lint run
```

Signed-off-by: Jose Valdes <[email protected]>

---------

Signed-off-by: Jose Valdes <[email protected]>
  • Loading branch information
jrvaldes authored Apr 25, 2023
1 parent 1fecacd commit 09127f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
with:
go-version: 1.18
- name: Get golangci
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2
- uses: pre-commit/[email protected]
10 changes: 5 additions & 5 deletions controllers/keda/kedacontroller_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@ func (r *KedaControllerReconciler) installMetricsServer(ctx context.Context, log
newArgs := []string{"/cabundle/service-ca.crt", "/certs/tls.crt", "/certs/tls.key"}

transforms = append(transforms,
transform.EnsureCertInjectionForAPIService(injectCABundleAnnotation, injectCABundleAnnotationValue, r.Scheme, logger),
transform.EnsureCertInjectionForService(metricsServcerServiceName, injectservingCertAnnotation, injectservingCertAnnotationValue, r.Scheme, logger),
transform.EnsureCertInjectionForDeployment(metricsServerConfigMapName, metricsServcerServiceName, r.Scheme, logger),
transform.EnsureCertInjectionForAPIService(injectCABundleAnnotation, injectCABundleAnnotationValue, r.Scheme),
transform.EnsureCertInjectionForService(metricsServcerServiceName, injectservingCertAnnotation, injectservingCertAnnotationValue),
transform.EnsureCertInjectionForDeployment(metricsServerConfigMapName, metricsServcerServiceName, r.Scheme),
)
transforms = append(transforms, transform.EnsurePathsToCertsInDeployment(newArgs, argsPrefixes, r.Scheme, logger)...)
} else {
Expand All @@ -465,7 +465,7 @@ func (r *KedaControllerReconciler) installMetricsServer(ctx context.Context, log
logger.Error(err, "unable to check Metrics Server Auditlog Policy ConfigMap is present")
return err
}
transforms = append(transforms, transform.EnsureAuditPolicyConfigMapMountsVolume(auditlogPolicyConfigMap, r.Scheme, logger))
transforms = append(transforms, transform.EnsureAuditPolicyConfigMapMountsVolume(auditlogPolicyConfigMap, r.Scheme))
// add mounted policy file path to MetricsServer arguments
auditFilePath := path.Join(auditlogPolicyMountPath, auditPolicyFile)
transforms = append(transforms, transform.ReplaceAuditConfig(auditFilePath, "policyfile", r.Scheme, logger))
Expand All @@ -489,7 +489,7 @@ func (r *KedaControllerReconciler) installMetricsServer(ctx context.Context, log
return err
}
logVolumePath = "/var/audit-policy/log-" + time.Now().Format("2006.01.02-15:04")
transforms = append(transforms, transform.EnsureAuditLogMount(logOutVolumeClaim, logVolumePath, r.Scheme, logger))
transforms = append(transforms, transform.EnsureAuditLogMount(logOutVolumeClaim, logVolumePath, r.Scheme))
}

// add audit log output volume path to arguments of keda-adapter
Expand Down
10 changes: 5 additions & 5 deletions controllers/keda/transform/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func ReplaceWatchNamespace(watchNamespace string, containerName string, scheme *
}
}

func EnsureCertInjectionForAPIService(annotation string, annotationValue string, scheme *runtime.Scheme, logger logr.Logger) mf.Transformer {
func EnsureCertInjectionForAPIService(annotation string, annotationValue string, scheme *runtime.Scheme) mf.Transformer {
return func(u *unstructured.Unstructured) error {
if u.GetKind() == "APIService" {
apiService := &apiregistrationv1.APIService{}
Expand All @@ -114,7 +114,7 @@ func EnsureCertInjectionForAPIService(annotation string, annotationValue string,
}
}

func EnsureCertInjectionForService(serviceName string, annotation string, annotationValue string, scheme *runtime.Scheme, logger logr.Logger) mf.Transformer {
func EnsureCertInjectionForService(serviceName string, annotation string, annotationValue string) mf.Transformer {
return func(u *unstructured.Unstructured) error {
if u.GetKind() == "Service" && u.GetName() == serviceName {
annotations := u.GetAnnotations()
Expand All @@ -128,7 +128,7 @@ func EnsureCertInjectionForService(serviceName string, annotation string, annota
}
}

func EnsureCertInjectionForDeployment(configMapName string, secretName string, scheme *runtime.Scheme, logger logr.Logger) mf.Transformer {
func EnsureCertInjectionForDeployment(configMapName string, secretName string, scheme *runtime.Scheme) mf.Transformer {
return func(u *unstructured.Unstructured) error {
if u.GetKind() == "Deployment" {
deploy := &appsv1.Deployment{}
Expand Down Expand Up @@ -230,7 +230,7 @@ func EnsurePathsToCertsInDeployment(values []string, prefixes []Prefix, scheme *
return transforms
}

func EnsureAuditPolicyConfigMapMountsVolume(configMapName string, scheme *runtime.Scheme, logger logr.Logger) mf.Transformer {
func EnsureAuditPolicyConfigMapMountsVolume(configMapName string, scheme *runtime.Scheme) mf.Transformer {
return func(u *unstructured.Unstructured) error {
if u.GetKind() == "Deployment" {
deploy := &appsv1.Deployment{}
Expand Down Expand Up @@ -709,7 +709,7 @@ func replaceContainerImage(image string, containerName string, scheme *runtime.S
}
}

func EnsureAuditLogMount(pvc string, path string, scheme *runtime.Scheme, logger logr.Logger) mf.Transformer {
func EnsureAuditLogMount(pvc string, path string, scheme *runtime.Scheme) mf.Transformer {
const logOutputVolumeName = "audit-log"
return func(u *unstructured.Unstructured) error {
// ensure mountVolume exists when volume exists
Expand Down

0 comments on commit 09127f7

Please sign in to comment.