Skip to content

Commit

Permalink
Merge pull request #667 from praveenrewar/bump-go
Browse files Browse the repository at this point in the history
Bump go, golangci-lint, actions
  • Loading branch information
joaopapereira authored May 17, 2024
2 parents f99dae6 + eab14d3 commit d080918
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 31 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/gh-test-external-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
environment: TanzuNet Registry Dev e2e
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.22.2"
go-version: '1.22'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: src/github.com/${{ github.repository }}
Expand Down Expand Up @@ -61,11 +61,11 @@ jobs:
environment: GCR e2e
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.22.2"
go-version: '1.22'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: src/github.com/${{ github.repository }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/gh-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.22.2"
go-version: '1.22'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: src/github.com/${{ github.repository }}
- name: Run Tests
Expand All @@ -35,11 +35,11 @@ jobs:
runs-on: windows-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.22.2"
go-version: '1.22'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: src/github.com/${{ github.repository }}
- name: Install dependencies
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.22.2"
- uses: actions/checkout@v2
go-version: '1.22'
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.54
version: v1.58
args: -v
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.22.2
go-version: '1.22'
- name: Set up Cosign
uses: sigstore/cosign-installer@v3
- name: Retrieve version
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Trivy CVE Dependency Scanner

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

Expand All @@ -10,7 +11,7 @@ jobs:
with:
repo: carvel-dev/imgpkg
tool: imgpkg
goVersion: 1.22.2
goVersion: '1.22'
secrets:
githubToken: ${{ secrets.GITHUB_TOKEN }}
slackWebhookURL: ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion .github/workflows/windows-registry-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
packages: write
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module carvel.dev/imgpkg

go 1.22
go 1.22.3

require (
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20220517224237-e6f29200ae04
Expand Down
2 changes: 1 addition & 1 deletion pkg/imgpkg/bundle/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type uriMetrics struct {
}

func (u *uriMetrics) AddMetricsHandler(fakeRegistry *helpers.FakeTestRegistryBuilder) {
fakeRegistry.WithCustomHandler(func(writer http.ResponseWriter, request *http.Request) bool {
fakeRegistry.WithCustomHandler(func(_ http.ResponseWriter, request *http.Request) bool {
path := request.URL.Path
u.mutex.Lock()
defer u.mutex.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion pkg/imgpkg/image/dir_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestDirImage(t *testing.T) {
"folder_group/exec_perm_group.sh": "-rwxr-xr-x",
"folder_group/some_other.txt": "-rw-r--r--",
}
filepath.WalkDir(folder, func(path string, d fs.DirEntry, _ error) error {
filepath.WalkDir(folder, func(path string, _ fs.DirEntry, _ error) error {
if path == folder {
return nil
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/imgpkg/registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func TestInsecureRegistryFlag(t *testing.T) {

func TestBasicRegistry(t *testing.T) {
t.Run("When transport is provided it uses it", func(t *testing.T) {
rt := &notFoundRoundTripper{do: func(request *http.Request) (*http.Response, error) {
rt := &notFoundRoundTripper{do: func(_ *http.Request) (*http.Response, error) {
return &http.Response{
Status: "Not Found",
StatusCode: http.StatusNotFound,
Expand All @@ -305,7 +305,7 @@ func TestBasicRegistry(t *testing.T) {
})

t.Run("When cloned with CloneWithLogger it still uses initial transport", func(t *testing.T) {
rt := &notFoundRoundTripper{do: func(request *http.Request) (*http.Response, error) {
rt := &notFoundRoundTripper{do: func(_ *http.Request) (*http.Response, error) {
return &http.Response{
Status: "Not Found",
StatusCode: http.StatusNotFound,
Expand All @@ -323,7 +323,7 @@ func TestBasicRegistry(t *testing.T) {
})

t.Run("When cloned with CloneWithAuth it still uses initial transport", func(t *testing.T) {
rt := &notFoundRoundTripper{do: func(request *http.Request) (*http.Response, error) {
rt := &notFoundRoundTripper{do: func(_ *http.Request) (*http.Response, error) {
return &http.Response{
Status: "Not Found",
StatusCode: http.StatusNotFound,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestPushPull(t *testing.T) {

splits := strings.Split(digest, ":")
imageRefWithTag := env.Image + ":" + fmt.Sprintf("%s-%s.imgpkg", splits[0], splits[1])
t.Run("ensure all files are present in the pushed image", func(t *testing.T) {
t.Run("ensure all files are present in the pushed image", func(_ *testing.T) {
imgpkg.Run([]string{"pull", "-i", imageRefWithTag, "-o", testDir})

env.Assets.ValidateFilesAreEqual(env.Assets.SimpleAppDir(), testDir, []string{
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func TestPullImageFromSlowServerShouldTimeout(t *testing.T) {
registry.Build()
defer registry.ResetHandler()

registry.WithCustomHandler(func(writer http.ResponseWriter, request *http.Request) bool {
registry.WithCustomHandler(func(_ http.ResponseWriter, _ *http.Request) bool {
time.Sleep(5 * time.Second)
return false
})
Expand Down Expand Up @@ -275,7 +275,7 @@ func TestPullImageOfBundle(t *testing.T) {
assert.Contains(t, out.String(), "Cannot set --image-is-bundle-check while using -b flag")
})

t.Run("when --image-is-bundle-check=false is provided downloads the OCI Image of the bundle", func(t *testing.T) {
t.Run("when --image-is-bundle-check=false is provided downloads the OCI Image of the bundle", func(_ *testing.T) {
pullDir := env.Assets.CreateTempFolder("pull-bundle-image")
imgpkg.RunWithOpts([]string{"pull", "--tty", "-i", randomBundle.RefDigest, "-o", pullDir, "--image-is-bundle-check=false"}, helpers.RunOpts{})
})
Expand Down

0 comments on commit d080918

Please sign in to comment.