Skip to content

Commit

Permalink
Merge pull request #149 from radiofrance/renovate/minor-updates
Browse files Browse the repository at this point in the history
chore(deps): update minor-updates
  • Loading branch information
graillus authored Aug 23, 2022
2 parents f01d4e2 + 55d1aea commit 529b7b6
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 54 deletions.
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. run command '...'
4. See error

Expand All @@ -22,8 +23,9 @@ The configuration used to reproduce the error
A clear and concise description of what you expected to happen.

**System (please complete the following information):**

- OS: [e.g. osx]
- Go version [e.g. 1.18]
- Go version [e.g. 1.19]
- dib version [e.g. 1.0.0]

**Additional context**
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@ jobs:
name: Go lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # renovate: tag=v3.0.2
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
- uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # tag=v3.2.1
with:
go-version: 1.18
- uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc # renovate: tag=v3.2.0
# renovate: datasource=golang-versions depName=golang/go versioning=semver
go-version: 1.19.0
- uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc # tag=v3.2.0
with:
# renovate: datasource=github-tags depName=golangci/golangci-lint versioning=semver
version: v1.46.2
version: v1.48.0

test:
name: Go test & coverage
needs: [lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # renovate: tag=v3.0.2
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
with:
fetch-depth: 2 # See https://community.codecov.com/t/issue-detecting-commit-sha-please-run-actions-checkout-with-fetch-depth-1-or-set-to-0/2571
- uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # tag=v3.2.1
with:
go-version: 1.18
# renovate: datasource=golang-versions depName=golang/go versioning=semver
go-version: 1.19.0
- run: go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
5 changes: 3 additions & 2 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # renovate: tag=v3.0.2
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # tag=v3.2.1
with:
go-version: 1.18
# renovate: datasource=golang-versions depName=golang/go versioning=semver
go-version: 1.19.0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@68acf3b1adf004ac9c2f0a4259e85c5f66e99bef # tag=v3.0.0
with:
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ linters:
- scopelint # Disable because they are deprecated and throw warning in logs
- golint # Disable because they are deprecated and throw warning in logs
- exhaustivestruct # Disable because they are deprecated and throw warning in logs
- ifshort # Disable because they are deprecated and throw warning in logs
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/radiofrance/dib

go 1.18
go 1.19

require (
github.com/aws/aws-sdk-go-v2 v1.16.11
github.com/aws/aws-sdk-go-v2/config v1.16.1
github.com/aws/aws-sdk-go-v2/config v1.17.1
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.5
github.com/docker/cli v20.10.17+incompatible
github.com/docker/docker v20.10.17+incompatible
Expand Down Expand Up @@ -37,7 +37,7 @@ require (
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/andybalholm/brotli v1.0.3 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.4 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.12.13 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.12.14 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12 // indirect
Expand All @@ -47,7 +47,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.13 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.12 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.16 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.17 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 // indirect
github.com/aws/smithy-go v1.12.1 // indirect
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ github.com/aws/aws-sdk-go-v2 v1.16.11 h1:xM1ZPSvty3xVmdxiGr7ay/wlqv+MWhH0rMlyLdb
github.com/aws/aws-sdk-go-v2 v1.16.11/go.mod h1:WTACcleLz6VZTp7fak4EO5b9Q4foxbn+8PIz3PmyKlo=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.4 h1:zfT11pa7ifu/VlLDpmc5OY2W4nYmnKkFDGeMVnmqAI0=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.4/go.mod h1:ES0I1GBs+YYgcDS1ek47Erbn4TOL811JKqBXtgzqyZ8=
github.com/aws/aws-sdk-go-v2/config v1.16.1 h1:jasqFPOoNPXHOYGEEuvyT87ACiXhD3OkQckIm5uqi5I=
github.com/aws/aws-sdk-go-v2/config v1.16.1/go.mod h1:4SKzBMiB8lV0fw2w7eDBo/LjQyHFITN4vUUuqpurFmI=
github.com/aws/aws-sdk-go-v2/credentials v1.12.13 h1:cuPzIsjKAWBUAAk8ZUR2l02Sxafl9hiaMsc7tlnjwAY=
github.com/aws/aws-sdk-go-v2/credentials v1.12.13/go.mod h1:9fDEemXizwXrxPU1MTzv69LP/9D8HVl5qHAQO9A9ikY=
github.com/aws/aws-sdk-go-v2/config v1.17.1 h1:BWxTjokU/69BZ4DnLrZco6OvBDii6ToEdfBL/y5I1nA=
github.com/aws/aws-sdk-go-v2/config v1.17.1/go.mod h1:uOxDHjBemNTF2Zos+fgG0NNfE86wn1OAHDTGxjMEYi0=
github.com/aws/aws-sdk-go-v2/credentials v1.12.14 h1:AtVG/amkjbDBfnPr/tuW2IG18HGNznP6L12Dx0rLz+Q=
github.com/aws/aws-sdk-go-v2/credentials v1.12.14/go.mod h1:opAndTyq+YN7IpVG57z2CeNuXSQMqTYxGGlYH0m0RMY=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 h1:wgJBHO58Pc1V1QAnzdVM3JK3WbE/6eUF0JxCZ+/izz0=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12/go.mod h1:aZ4vZnyUuxedC7eD4JyEHpGnCz+O2sHQEx3VvAwklSE=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 h1:OmiwoVyLKEqqD5GvB683dbSqxiOfvx4U2lDZhG2Esc4=
Expand All @@ -253,8 +253,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.12 h1:QFjSOmHSb77qR
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.12/go.mod h1:MADjAN0GHFDuc5lRa5Y5ki+oIO/w7X4qczHy+OUx0IA=
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.5 h1:h9qqTedYnA9JcWjKyLV6UYIMSdp91ExLCUbjbpDLH7A=
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.5/go.mod h1:J8SS5Tp/zeLxaubB0xGfKnVrvssNBNLwTipreTKLhjQ=
github.com/aws/aws-sdk-go-v2/service/sso v1.11.16 h1:YK8L7TNlGwMWHYqLs+i6dlITpxqzq08FqQUy26nm+T8=
github.com/aws/aws-sdk-go-v2/service/sso v1.11.16/go.mod h1:mS5xqLZc/6kc06IpXn5vRxdLaED+jEuaSRv5BxtnsiY=
github.com/aws/aws-sdk-go-v2/service/sso v1.11.17 h1:pXxu9u2z1UqSbjO9YA8kmFJBhFc1EVTDaf7A+S+Ivq8=
github.com/aws/aws-sdk-go-v2/service/sso v1.11.17/go.mod h1:mS5xqLZc/6kc06IpXn5vRxdLaED+jEuaSRv5BxtnsiY=
github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 h1:dl8T0PJlN92rvEGOEUiD0+YPYdPEaCZK0TqHukvSfII=
github.com/aws/aws-sdk-go-v2/service/sts v1.16.13/go.mod h1:Ru3QVMLygVs/07UQ3YDur1AQZZp2tUNje8wfloFttC0=
github.com/aws/smithy-go v1.12.1 h1:yQRC55aXN/y1W10HgwHle01DRuV9Dpf31iGkotjt3Ag=
Expand Down
11 changes: 5 additions & 6 deletions pkg/dib/generate_dag_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dib_test

import (
"io/ioutil"
"os"
"path"
"testing"
Expand Down Expand Up @@ -77,7 +76,7 @@ func Test_GenerateDAG_HashesChangeWhenImageContextChanges(t *testing.T) {
require.True(t, exists)

// When I add a new file in bullseye/multistage/ (child node)
err := ioutil.WriteFile(
err := os.WriteFile(
path.Join(dockerDir, testcase.AddFileAtPath),
[]byte("file contents"),
os.ModePerm,
Expand Down Expand Up @@ -129,7 +128,7 @@ func setupFixtures(t *testing.T) string {
require.NoError(t, err)
err = os.MkdirAll(path.Join(tmpDockerDir, "bullseye/skipbuild"), os.ModePerm)
require.NoError(t, err)
err = ioutil.WriteFile(
err = os.WriteFile(
path.Join(tmpDockerDir, "bullseye/Dockerfile"),
[]byte(`
FROM debian:bullseye
Expand All @@ -140,7 +139,7 @@ LABEL version="v1"
os.ModePerm,
)
require.NoError(t, err)
err = ioutil.WriteFile(
err = os.WriteFile(
path.Join(tmpDockerDir, "bullseye/sub-image/Dockerfile"),
[]byte(`
FROM eu.gcr.io/my-test-repository/bullseye:v1
Expand All @@ -151,7 +150,7 @@ LABEL version="v1"
os.ModePerm,
)
require.NoError(t, err)
err = ioutil.WriteFile(
err = os.WriteFile(
path.Join(tmpDockerDir, "bullseye/multistage/Dockerfile"),
[]byte(`
FROM eu.gcr.io/my-test-repository/bullseye:v1 as builder
Expand All @@ -163,7 +162,7 @@ LABEL dib.extra-tags="latest"
os.ModePerm,
)
require.NoError(t, err)
err = ioutil.WriteFile(
err = os.WriteFile(
path.Join(tmpDockerDir, "bullseye/skipbuild/Dockerfile"),
[]byte(`
FROM eu.gcr.io/my-test-repository/bullseye:v1
Expand Down
4 changes: 2 additions & 2 deletions pkg/dib/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ func renderConsoleOutput(imagesList []dag.Image) {
table := tablewriter.NewWriter(os.Stdout)
table.SetAutoWrapText(false)
table.SetAutoFormatHeaders(true)
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
table.SetAlignment(tablewriter.ALIGN_LEFT)
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) //nolint:nosnakecase
table.SetAlignment(tablewriter.ALIGN_LEFT) //nolint:nosnakecase
table.SetCenterSeparator("")
table.SetColumnSeparator("")
table.SetRowSeparator("")
Expand Down
2 changes: 1 addition & 1 deletion pkg/dib/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func Test_GenerateList_Console(t *testing.T) {
assert.NoError(t, err)
}

// nolint:lll
//nolint:lll
func Test_GenerateList_GoTemplateFile(t *testing.T) {
t.Parallel()

Expand Down
17 changes: 7 additions & 10 deletions pkg/dib/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import (
"github.com/stretchr/testify/require"
)

//nolint: paralleltest
func Test_LabelsFromGitHubMetadata(t *testing.T) {
func Test_LabelsFromGitHubMetadata(t *testing.T) { //nolint:paralleltest
now := time.Now()
cwd, err := os.Getwd()
require.NoError(t, err)
Expand Down Expand Up @@ -50,17 +49,16 @@ func Test_LabelsFromGitHubMetadata(t *testing.T) {
"org.opencontainers.image.created": now.Format(time.RFC3339),
"org.opencontainers.image.revision": "e6d0536487b24c11ca8675cbf8e1b015f843bd26",
"org.opencontainers.image.title": "dib",
"org.opencontainers.image.source": "https://github.com/organization/repository/blob/e6d0536487b24c11ca8675cbf8e1b015f843bd26/context/subdir/Dockerfile", //nolint: lll
"org.opencontainers.image.url": "https://github.com/organization/repository/blob/main/context/subdir/Dockerfile", //nolint: lll
"org.opencontainers.image.source": "https://github.com/organization/repository/blob/e6d0536487b24c11ca8675cbf8e1b015f843bd26/context/subdir/Dockerfile", //nolint:lll
"org.opencontainers.image.url": "https://github.com/organization/repository/blob/main/context/subdir/Dockerfile", //nolint:lll
"org.opencontainers.image.version": "1.0.0",
"org.opencontainers.image.ref.name": "silver-august-sierra-washington",
"org.opencontainers.image.base.name": "debian",
}
assert.Equal(t, expected, actual)
}

//nolint: paralleltest
func Test_LabelsFromGitLabMetadata(t *testing.T) {
func Test_LabelsFromGitLabMetadata(t *testing.T) { //nolint:paralleltest
now := time.Now()
cwd, err := os.Getwd()
require.NoError(t, err)
Expand Down Expand Up @@ -93,17 +91,16 @@ func Test_LabelsFromGitLabMetadata(t *testing.T) {
"org.opencontainers.image.created": now.Format(time.RFC3339),
"org.opencontainers.image.revision": "e6d0536487b24c11ca8675cbf8e1b015f843bd26",
"org.opencontainers.image.title": "dib",
"org.opencontainers.image.source": "https://gitlab.com/project/repository/-/blob/e6d0536487b24c11ca8675cbf8e1b015f843bd26/context/subdir/Dockerfile", //nolint: lll
"org.opencontainers.image.url": "https://gitlab.com/project/repository/-/blob/main/context/subdir/Dockerfile", //nolint: lll
"org.opencontainers.image.source": "https://gitlab.com/project/repository/-/blob/e6d0536487b24c11ca8675cbf8e1b015f843bd26/context/subdir/Dockerfile", //nolint:lll
"org.opencontainers.image.url": "https://gitlab.com/project/repository/-/blob/main/context/subdir/Dockerfile", //nolint:lll
"org.opencontainers.image.version": "1.0.0",
"org.opencontainers.image.ref.name": "silver-august-sierra-washington",
"org.opencontainers.image.base.name": "debian",
}
assert.Equal(t, expected, actual)
}

//nolint: paralleltest
func Test_LabelsFromGitMetadata(t *testing.T) {
func Test_LabelsFromGitMetadata(t *testing.T) { //nolint:paralleltest
// Since we run our CI on GitHub, we need to reset this variable to make the test pass.
t.Setenv("GITHUB_REPOSITORY", "")

Expand Down
5 changes: 2 additions & 3 deletions pkg/dockerfile/dockerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package dockerfile
import (
"bufio"
"fmt"
"io/ioutil"
"os"
"path"
"regexp"
Expand Down Expand Up @@ -104,12 +103,12 @@ func ResetTags(d Dockerfile, diff map[string]string) error {
}

func replace(path string, previous string, next string) error {
read, err := ioutil.ReadFile(path)
read, err := os.ReadFile(path)
if err != nil {
return err
}
newContents := strings.ReplaceAll(string(read), previous, next)
if err = ioutil.WriteFile(path, []byte(newContents), 0); err != nil {
if err = os.WriteFile(path, []byte(newContents), 0); err != nil {
return err
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/goss/executor_dgoss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
)

// nolint:paralleltest
//nolint:paralleltest
func Test_DGossExecutor_NewDGossExecutorUsesDefaultShell(t *testing.T) {
err := os.Unsetenv("SHELL")
require.NoError(t, err)
Expand All @@ -19,7 +19,7 @@ func Test_DGossExecutor_NewDGossExecutorUsesDefaultShell(t *testing.T) {
assert.Equal(t, "/bin/bash", executor.Shell)
}

// nolint:paralleltest
//nolint:paralleltest
func Test_DGossExecutor_NewDGossExecutorDetectsShellFromEnv(t *testing.T) {
t.Setenv("SHELL", "/path/to/shell")

Expand Down
3 changes: 1 addition & 2 deletions pkg/goss/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"strings"
Expand Down Expand Up @@ -99,7 +98,7 @@ func (b TestRunner) exportJunitReport(opts types.RunTestOptions, stdout string,

junitFilename := path.Join(testRunner.ReportsDirectory,
fmt.Sprintf("junit-%s.xml", strings.ReplaceAll(opts.ImageName, "/", "_")))
if err := ioutil.WriteFile(junitFilename, []byte(stdout), 0o644); err != nil { // nolint: gosec
if err := os.WriteFile(junitFilename, []byte(stdout), 0o644); err != nil { //nolint:gosec
return fmt.Errorf("could not write junit report to file %s: %w", junitFilename, err)
}
return nil
Expand Down
5 changes: 2 additions & 3 deletions pkg/graphviz/graphviz_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package graphviz_test

import (
"io/ioutil"
"log"
"os"
"path"
Expand All @@ -24,7 +23,7 @@ func Test_GenerateDotviz(t *testing.T) {

DAG := dib.GenerateDAG(path.Join(cwd, "../../test/fixtures/docker"), "eu.gcr.io/my-test-repository")

dir, err := ioutil.TempDir("/tmp", "dib-test")
dir, err := os.MkdirTemp("/tmp", "dib-test")
if err != nil {
log.Fatal(err)
}
Expand All @@ -35,7 +34,7 @@ func Test_GenerateDotviz(t *testing.T) {
require.NoError(t, err)
assert.FileExists(t, dotFile)

content, err := ioutil.ReadFile(dotFile)
content, err := os.ReadFile(dotFile)
require.NoError(t, err)
assert.Len(t, content, 647)
assert.Contains(t, string(content),
Expand Down
3 changes: 1 addition & 2 deletions pkg/kaniko/context_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package kaniko
import (
"compress/gzip"
"fmt"
"io/ioutil"
"os"
"path"
"strings"
Expand Down Expand Up @@ -68,7 +67,7 @@ func createArchive(buildContextDir string, tarGzPath string) error {

var filesToArchive []string

fileOrDirInfos, err := ioutil.ReadDir(buildContextDir)
fileOrDirInfos, err := os.ReadDir(buildContextDir)
if err != nil {
return fmt.Errorf("can't access directory %s, err is : %w", buildContextDir, err)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/kubernetes/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package kubernetes
import (
"fmt"
"io"
"io/ioutil"
"os"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -90,7 +89,7 @@ func CopyToContainer(opts ExecOptions, src string, dest string) error {
opts.Command = []string{"tee", dest}

opts.StreamOptions.IOStreams.In = file
opts.StreamOptions.IOStreams.Out = ioutil.Discard
opts.StreamOptions.IOStreams.Out = io.Discard
opts.StreamOptions.Stdin = true
opts.Executor = &exec.DefaultRemoteExecutor{}

Expand Down
2 changes: 1 addition & 1 deletion pkg/kubernetes/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func WaitPodReady(ctx context.Context, watcher watch.Interface) (chan struct{},
return
}

switch pod.Status.Phase { //nolint: exhaustive
switch pod.Status.Phase { //nolint:exhaustive
case corev1.PodRunning:
if running {
break
Expand Down
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"\\.github/workflows/.*\\.ya?ml"
],
"matchStrings": [
"datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\sversion: (?<currentValue>.*)\\s"
"datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.*version: (?<currentValue>.*)\\s"
],
"versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}"
}
Expand Down

0 comments on commit 529b7b6

Please sign in to comment.