Skip to content

Commit

Permalink
chore(deps): bump golang from 1.22.4 to 1.23.0 (#1359)
Browse files Browse the repository at this point in the history
* chore(deps): bump golang from 1.22.4 to 1.23.0

Bumps golang from 1.22.4 to 1.23.0.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: fix linter issues

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Patryk Małek <patryk.malek@konghq.com>
  • Loading branch information
dependabot[bot] and pmalek committed Aug 21, 2024
1 parent e66ed5e commit bbe779d
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 224 deletions.
6 changes: 4 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ linters:
- dogsled
- durationcheck
- exhaustive
- exportloopref
- copyloopvar
- gci
- goconst
- gofmt
Expand All @@ -19,7 +19,9 @@ linters:
- govet
- importas
- lll
- megacheck
- gosimple
- staticcheck
- unused
- misspell
- nakedret
- nilerr
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.4 AS build
FROM golang:1.23.0 AS build
WORKDIR /deck
COPY go.mod ./
COPY go.sum ./
Expand Down
8 changes: 4 additions & 4 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,11 @@ func checkForRBACResources(content reconcilerUtils.KongRawState,
common := "At a time, state file(s) must entirely consist of either proxy " +
"configuration or RBAC configuration."
if rbacResourcesOnly {
return fmt.Errorf("When --rbac-resources-only is used, state file(s) " +
"cannot contain any resources other than RBAC resources. " + common)
return fmt.Errorf("when --rbac-resources-only is used, state file(s) "+
"cannot contain any resources other than RBAC resources. %s", common)
}
return fmt.Errorf("State file(s) contains RBAC resources. " +
"Please use --rbac-resources-only flag to manage these resources. " + common)
return fmt.Errorf("state file(s) contains RBAC resources. "+
"Please use --rbac-resources-only flag to manage these resources. %s", common)
}
return nil
}
Expand Down
3 changes: 1 addition & 2 deletions convert/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,8 @@ func Test_Convert(t *testing.T) {

func wipeServiceID(content *file.Content) *file.Content {
result := content.DeepCopy()
result.ServicePackages = nil
result.ServicePackages = make([]file.FServicePackage, 0, len(content.ServicePackages))
for _, sp := range content.ServicePackages {
sp := sp
sp = zeroOutID(sp)
result.ServicePackages = append(result.ServicePackages, sp)
}
Expand Down
6 changes: 3 additions & 3 deletions kong2kic/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func populateKICIngressesWithAnnotations(content *file.Content, kicContent *KICC
Service: &k8snetv1.IngressServiceBackend{
Name: *service.Name,
Port: k8snetv1.ServiceBackendPort{
Number: int32(*service.Port),
Number: int32(*service.Port), //nolint:gosec
},
},
},
Expand Down Expand Up @@ -203,7 +203,7 @@ func populateKICIngressesWithAnnotations(content *file.Content, kicContent *KICC
Service: &k8snetv1.IngressServiceBackend{
Name: *service.Name,
Port: k8snetv1.ServiceBackendPort{
Number: int32(*service.Port),
Number: int32(*service.Port), //nolint:gosec
},
},
},
Expand Down Expand Up @@ -394,7 +394,7 @@ func populateKICIngressesWithGatewayAPI(content *file.Content, kicContent *KICCo
},
}
if service.Port != nil {
portNumber := k8sgwapiv1.PortNumber(*service.Port)
portNumber := k8sgwapiv1.PortNumber(*service.Port) //nolint:gosec
backendRef.Port = &portNumber
}

Expand Down
8 changes: 5 additions & 3 deletions kong2kic/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ func populateKICServicesWithAnnotations(content *file.Content, kicContent *KICCo

if service.Port != nil {
sPort := k8scorev1.ServicePort{
Protocol: protocol,
Port: int32(*service.Port),
TargetPort: intstr.IntOrString{IntVal: int32(*service.Port)},
Protocol: protocol,
Port: int32(*service.Port), //nolint:gosec
TargetPort: intstr.IntOrString{
IntVal: int32(*service.Port), //nolint:gosec
},
}
k8sService.Spec.Ports = append(k8sService.Spec.Ports, sPort)
}
Expand Down
2 changes: 1 addition & 1 deletion kong2kic/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func WriteContentToFile(content *file.Content, filename string, format file.Form
return err
}
default:
return fmt.Errorf("unknown file format: " + string(format))
return fmt.Errorf("unknown file format: %s", format)
}

if filename == "-" {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func Test_LintStructured(t *testing.T) {
cmpopts.EquateEmpty(),
}
if diff := cmp.Diff(outputErrors, expectedErrors, cmpOpts...); diff != "" {
t.Errorf(diff)
t.Errorf("got unexpected diff\n:%s", diff)
}
})
}
Expand Down
12 changes: 3 additions & 9 deletions tests/integration/reset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ u8S6yNlu2Q==
func Test_Reset_SkipCACert_2x(t *testing.T) {
// setup stage
client, err := getTestClient()
if err != nil {
t.Errorf(err.Error())
}
require.NoError(t, err)

tests := []struct {
name string
Expand Down Expand Up @@ -75,9 +73,7 @@ func Test_Reset_SkipCACert_2x(t *testing.T) {
func Test_Reset_SkipCACert_3x(t *testing.T) {
// setup stage
client, err := getTestClient()
if err != nil {
t.Errorf(err.Error())
}
require.NoError(t, err)

tests := []struct {
name string
Expand Down Expand Up @@ -113,9 +109,7 @@ func Test_Reset_ConsumerGroupConsumersWithCustomID(t *testing.T) {
setup(t)

client, err := getTestClient()
if err != nil {
t.Fatalf(err.Error())
}
require.NoError(t, err)

require.NoError(t, sync("testdata/sync/028-consumer-group-consumers-custom_id/kong.yaml"))
reset(t)
Expand Down
Loading

0 comments on commit bbe779d

Please sign in to comment.