Skip to content

Commit

Permalink
update dependency (Azure#575)
Browse files Browse the repository at this point in the history
* update golang and docker cli version

* update system images
  • Loading branch information
northtyphoon authored Apr 12, 2021
1 parent 524a80c commit e2cedca
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ linters:
issues:
exclude-rules:
- text: "Potential HTTP request made with variable url"
linters:
- gosec
- text: "SQL string concatenation"
linters:
- gosec
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG DOCKER_CLI_BASE_IMAGE=docker:19.03.6-git
ARG DOCKER_CLI_BASE_IMAGE=docker:20.10.5-git

FROM golang:1.14.2-alpine AS gobuild-base
FROM golang:1.16.3-alpine AS gobuild-base
RUN apk add --no-cache \
git \
make
Expand Down
2 changes: 1 addition & 1 deletion Windows.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \

# install go lang

ENV GOLANG_VERSION 1.14.2
ENV GOLANG_VERSION 1.16.3

RUN $url = ('https://golang.org/dl/go{0}.windows-amd64.zip' -f $env:GOLANG_VERSION); \
Write-Host ('Downloading {0} ...' -f $url); \
Expand Down
2 changes: 1 addition & 1 deletion baseimages/docker-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Required.
# docker build -f baseimages/docker-cli/Dockerfile -t docker .
ARG DOCKER_CLI_BASE_IMAGE=docker:19.03.6-git
ARG DOCKER_CLI_BASE_IMAGE=docker:20.10.5-git
FROM ${DOCKER_CLI_BASE_IMAGE}

ARG GIT_LFS_VERSION=2.5.2
Expand Down
6 changes: 3 additions & 3 deletions graph/global-defaults-linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Branch: "{{.Run.Branch}}"
# Default image aliases, can be used without $ directive in cmd
acr: mcr.microsoft.com/acr/acr-cli:0.4
az: mcr.microsoft.com/acr/azure-cli:b0352a7
bash: mcr.microsoft.com/acr/bash:b0352a7
curl: mcr.microsoft.com/acr/curl:b0352a7
az: mcr.microsoft.com/acr/azure-cli:e7bb27d
bash: mcr.microsoft.com/acr/bash:e7bb27d
curl: mcr.microsoft.com/acr/curl:e7bb27d
`
25 changes: 13 additions & 12 deletions scan/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ func TestCheckoutGit(t *testing.T) {
_, err = gitWithinDir(gitDir, "checkout", "-b", "default")
assert.NilError(t, err)

err = ioutil.WriteFile(filepath.Join(gitDir, "Dockerfile"), []byte("FROM scratch"), 0644)
err = ioutil.WriteFile(filepath.Join(gitDir, "Dockerfile"), []byte("FROM scratch"), 0600)
assert.NilError(t, err)

subDir := filepath.Join(gitDir, "subdir")
assert.NilError(t, os.Mkdir(subDir, 0755))

err = ioutil.WriteFile(filepath.Join(subDir, "Dockerfile"), []byte("FROM scratch\nEXPOSE 5000"), 0644)
err = ioutil.WriteFile(filepath.Join(subDir, "Dockerfile"), []byte("FROM scratch\nEXPOSE 5000"), 0600)
assert.NilError(t, err)

if runtime.GOOS != "windows" {
Expand All @@ -212,10 +212,10 @@ func TestCheckoutGit(t *testing.T) {
_, err = gitWithinDir(gitDir, "checkout", "-b", "test")
assert.NilError(t, err)

err = ioutil.WriteFile(filepath.Join(gitDir, "Dockerfile"), []byte("FROM scratch\nEXPOSE 3000"), 0644)
err = ioutil.WriteFile(filepath.Join(gitDir, "Dockerfile"), []byte("FROM scratch\nEXPOSE 3000"), 0600)
assert.NilError(t, err)

err = ioutil.WriteFile(filepath.Join(subDir, "Dockerfile"), []byte("FROM busybox\nEXPOSE 5000"), 0644)
err = ioutil.WriteFile(filepath.Join(subDir, "Dockerfile"), []byte("FROM busybox\nEXPOSE 5000"), 0600)
assert.NilError(t, err)

_, err = gitWithinDir(gitDir, "add", "-A")
Expand All @@ -238,7 +238,7 @@ func TestCheckoutGit(t *testing.T) {
_, err = gitWithinDir(subrepoDir, "config", "user.name", "Docker test")
assert.NilError(t, err)

err = ioutil.WriteFile(filepath.Join(subrepoDir, "subfile"), []byte("subcontents"), 0644)
err = ioutil.WriteFile(filepath.Join(subrepoDir, "subfile"), []byte("subcontents"), 0600)
assert.NilError(t, err)

_, err = gitWithinDir(subrepoDir, "add", "-A")
Expand Down Expand Up @@ -276,6 +276,7 @@ func TestCheckoutGit(t *testing.T) {
{"test", "FROM scratch" + eol + "EXPOSE 3000", false, false},
{"test:", "FROM scratch" + eol + "EXPOSE 3000", false, false},
{"test:subdir", "FROM busybox" + eol + "EXPOSE 5000", false, false},
{"nonexist:subdir", "FROM busybox" + eol + "EXPOSE 5000", true, false},
}

if runtime.GOOS != "windows" {
Expand All @@ -285,8 +286,8 @@ func TestCheckoutGit(t *testing.T) {
// error: unable to index file absolutelink
// fatal: adding files failed
fmt.Println("Windows!!!!!!!!!!")
cases = append(cases, singleCase{frag: "master:absolutelink", exp: "FROM scratch" + eol + "EXPOSE 5000", fail: false})
cases = append(cases, singleCase{frag: "master:parentlink", exp: "FROM scratch" + eol + "EXPOSE 5000", fail: false})
cases = append(cases, singleCase{frag: "default:absolutelink", exp: "FROM scratch" + eol + "EXPOSE 5000", fail: false})
cases = append(cases, singleCase{frag: "default:parentlink", exp: "FROM scratch" + eol + "EXPOSE 5000", fail: false})
}

for _, c := range cases {
Expand All @@ -304,13 +305,13 @@ func TestCheckoutGit(t *testing.T) {
assert.NilError(t, err)
defer os.RemoveAll(r)
if c.submodule {
b, err := ioutil.ReadFile(filepath.Join(r, "sub/subfile"))
assert.NilError(t, err)
b, innerErr := ioutil.ReadFile(filepath.Join(r, "sub/subfile"))
assert.NilError(t, innerErr)
assert.Check(t, is.Equal("subcontents", string(b)))
} else {
_, err := os.Stat(filepath.Join(r, "sub/subfile"))
assert.Assert(t, is.ErrorContains(err, ""))
assert.Assert(t, os.IsNotExist(err))
_, innerErr := os.Stat(filepath.Join(r, "sub/subfile"))
assert.Assert(t, is.ErrorContains(innerErr, ""))
assert.Assert(t, os.IsNotExist(innerErr))
}

b, err := ioutil.ReadFile(filepath.Join(r, "Dockerfile"))
Expand Down

0 comments on commit e2cedca

Please sign in to comment.