Skip to content

Commit

Permalink
upgrading golangci-lint to v1.55.2
Browse files Browse the repository at this point in the history
  • Loading branch information
luthermonson committed Dec 2, 2023
1 parent 8086249 commit a6c0b3d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ codegen:
.PHONY: lint
lint:
docker run --rm -v "$(shell pwd):/var/work:ro" -w /var/work \
golangci/golangci-lint:v1.44.0 golangci-lint run -v --timeout=5m
golangci/golangci-lint:v1.55.2 golangci-lint run -v --timeout=5m

.PHONY: fmt
fmt:
Expand Down
2 changes: 1 addition & 1 deletion cloud/linode/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (c *linodeCloud) ProviderName() string {
return ProviderName
}

func (c *linodeCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {
func (c *linodeCloud) ScrubDNS(_, _ []string) (nsOut, srchOut []string) {
return nil, nil
}

Expand Down
23 changes: 10 additions & 13 deletions cloud/linode/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (l *loadbalancers) cleanupOldNodeBalancer(ctx context.Context, service *v1.
// GetLoadBalancerName returns the name of the load balancer.
//
// GetLoadBalancer will not modify service.
func (l *loadbalancers) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string {
func (l *loadbalancers) GetLoadBalancerName(_ context.Context, _ string, _ *v1.Service) string {
unixNano := strconv.FormatInt(time.Now().UnixNano(), 16)
return fmt.Sprintf("ccm-%s", unixNano[len(unixNano)-12:])
}
Expand Down Expand Up @@ -279,7 +279,7 @@ func (l *loadbalancers) updateNodeBalancer(ctx context.Context, service *v1.Serv
}
}

tags := l.getLoadbalancerTags(ctx, service)
tags := l.getLoadBalancerTags(ctx, service)
if !reflect.DeepEqual(nb.Tags, tags) {
update := nb.GetUpdateOptions()
update.Tags = &tags
Expand Down Expand Up @@ -504,7 +504,7 @@ func (l *loadbalancers) getNodeBalancerByID(ctx context.Context, service *v1.Ser
return nb, nil
}

func (l *loadbalancers) getLoadbalancerTags(ctx context.Context, service *v1.Service) []string {
func (l *loadbalancers) getLoadBalancerTags(_ context.Context, service *v1.Service) []string {
tagStr, ok := getServiceAnnotation(service, annLinodeLoadBalancerTags)
if ok {
return strings.Split(tagStr, ",")
Expand All @@ -516,7 +516,7 @@ func (l *loadbalancers) createNodeBalancer(ctx context.Context, clusterName stri
connThrottle := getConnectionThrottle(service)

label := l.GetLoadBalancerName(ctx, clusterName, service)
tags := l.getLoadbalancerTags(ctx, service)
tags := l.getLoadBalancerTags(ctx, service)
createOpts := linodego.NodeBalancerCreateOptions{
Label: &label,
Region: l.zone,
Expand Down Expand Up @@ -706,23 +706,20 @@ func getPortConfig(service *v1.Service, port int) (portConfig, error) {
}
protocol := portConfigAnnotation.Protocol
if protocol == "" {
var ok bool
protocol, ok = service.Annotations[annLinodeDefaultProtocol]
if !ok {
protocol = "tcp"
protocol = "tcp"
if p, ok := service.Annotations[annLinodeDefaultProtocol]; ok {
protocol = p
}
}
protocol = strings.ToLower(protocol)

proxyProtocol := portConfigAnnotation.ProxyProtocol
if proxyProtocol == "" {
var ok bool
proxyProtocol = string(linodego.ProxyProtocolNone)
for _, ann := range []string{annLinodeDefaultProxyProtocol, annLinodeProxyProtocolDeprecated} {
proxyProtocol, ok = service.Annotations[ann]
if ok {
if pp, ok := service.Annotations[ann]; ok {
proxyProtocol = pp
break
} else {
proxyProtocol = string(linodego.ProxyProtocolNone)
}
}
}
Expand Down

0 comments on commit a6c0b3d

Please sign in to comment.