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

upgrading golangci-lint to v1.55.2 #148

Merged
merged 1 commit into from
Dec 2, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
luthermonson marked this conversation as resolved.
Show resolved Hide resolved
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
Loading