Skip to content

Commit

Permalink
Merge pull request #396 from carvel-dev/bump-go-0.11.x
Browse files Browse the repository at this point in the history
Bump go 1.20.5 and updated golint in line 0.11.x
  • Loading branch information
kumaritanushree authored Jun 15, 2023
2 parents e773a81 + 4299495 commit e86823d
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.19.6"
- uses: actions/checkout@v3.0.1
go-version: 1.20.5
- uses: actions/checkout@v3.3.0
with:
fetch-depth: '0'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v3.4.0
with:
version: v1.50.1
version: v1.52.2
args: -v
2 changes: 1 addition & 1 deletion .github/workflows/kind-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v3 # default version of go is 1.10
with:
go-version: "1.19.6"
go-version: 1.20.5
- name: Install Carvel Tools
uses: vmware-tanzu/carvel-setup-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19.6
go-version: 1.20.5
- name: Install Carvel Tools
uses: vmware-tanzu/carvel-setup-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-gh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: "1.19.6"
go-version: 1.20.5
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: "1.19.6"
go-version: 1.20.5
- name: Build the secretgen-controller artifacts
run: |
curl -L https://carvel.dev/install.sh | bash
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.19.6 AS deps
FROM --platform=$BUILDPLATFORM golang:1.20.5 AS deps

ARG TARGETOS TARGETARCH SGCTRL_VER=development
WORKDIR /workspace
Expand Down
12 changes: 6 additions & 6 deletions pkg/generator/jsonpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

const (
openPrefix = "$"
open = "("
close = ")"
openBracket = "("
closeBracket = ")"
jsonPathOpen = "{"
jsonPathClose = "}"
)
Expand Down Expand Up @@ -46,14 +46,14 @@ func (p JSONPath) ToK8sJSONPath() string {

for i := 0; i < len(newPath); i++ {
switch string(newPath[i]) {
case open:
case openBracket:
openPositions = openPositions.push(i)
case close:
case closeBracket:
d := openPositions.peek()
if d > 0 && string(newPath[d-1]) == openPrefix {
newPath = replace(newPath, d-1, openPrefix+open, jsonPathOpen)
newPath = replace(newPath, d-1, openPrefix+openBracket, jsonPathOpen)
i = i - 1 //Removed a character, fix i
newPath = replace(newPath, i, close, jsonPathClose)
newPath = replace(newPath, i, closeBracket, jsonPathClose)
}

openPositions = openPositions.pop()
Expand Down
2 changes: 1 addition & 1 deletion pkg/generator/secret_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,6 @@ type fakeClientLoader struct {
client client.Client
}

func (f *fakeClientLoader) Client(ctx context.Context, saName, saNamespace string) (client.Client, error) {
func (f *fakeClientLoader) Client(_ context.Context, _, _ string) (client.Client, error) {
return f.client, nil
}
4 changes: 2 additions & 2 deletions pkg/satoken/token_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ type fakeTokenGetter struct {
err error
}

func (ftg *fakeTokenGetter) getToken(ctx context.Context, name, namespace string, tr *authenticationv1.TokenRequest) (*authenticationv1.TokenRequest, error) {
func (ftg *fakeTokenGetter) getToken(_ context.Context, _, _ string, _ *authenticationv1.TokenRequest) (*authenticationv1.TokenRequest, error) {
ftg.count++
return ftg.request, ftg.err
}
Expand All @@ -254,7 +254,7 @@ type fakeTokenReviewer struct {
err error
}

func (ftr *fakeTokenReviewer) reviewToken(ctx context.Context, tr *authenticationv1.TokenReview) (*authenticationv1.TokenReview, error) {
func (ftr *fakeTokenReviewer) reviewToken(_ context.Context, _ *authenticationv1.TokenReview) (*authenticationv1.TokenReview, error) {
ftr.count++
return ftr.review, ftr.err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/sharing/namespace_wildcard_exclusions.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type enqueueDueToNamespaceChange struct {
}

// Create doesn't do anything
func (e *enqueueDueToNamespaceChange) Create(evt event.CreateEvent, q workqueue.RateLimitingInterface) {
func (e *enqueueDueToNamespaceChange) Create(_ event.CreateEvent, _ workqueue.RateLimitingInterface) {
}

// Update checks whether the exclusion annotation has been added or removed and then queues the secrets in that namespace
Expand All @@ -63,11 +63,11 @@ func (e *enqueueDueToNamespaceChange) Update(evt event.UpdateEvent, q workqueue.
}

// Delete doesn't do anything
func (e *enqueueDueToNamespaceChange) Delete(evt event.DeleteEvent, q workqueue.RateLimitingInterface) {
func (e *enqueueDueToNamespaceChange) Delete(_ event.DeleteEvent, _ workqueue.RateLimitingInterface) {
}

// Generic doesn't do anything
func (e *enqueueDueToNamespaceChange) Generic(evt event.GenericEvent, q workqueue.RateLimitingInterface) {
func (e *enqueueDueToNamespaceChange) Generic(_ event.GenericEvent, _ workqueue.RateLimitingInterface) {
}

func (e *enqueueDueToNamespaceChange) mapAndEnqueue(q workqueue.RateLimitingInterface, object client.Object) {
Expand Down

0 comments on commit e86823d

Please sign in to comment.