Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Mengqi Yu committed Aug 15, 2022
1 parent ab87e92 commit 76808e3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ on:
- "**.md"
push:

env:
GOPATH: ${{ github.workspace }}/go

jobs:
build-test-linux:
name: Build-test-kpt-CLI
Expand All @@ -47,8 +50,11 @@ jobs:
go-version: 1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
path: ${{ env.GOPATH }}/src/github.com/GoogleContainerTools/kpt
- name: Build, Test, Lint
working-directory: ${{ env.GOPATH }}/src/github.com/GoogleContainerTools/kpt
run: |
git config --global user.email you@example.com
git config --global user.name Your Name
Expand All @@ -66,8 +72,11 @@ jobs:
go-version: 1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
path: ${{ env.GOPATH }}/src/github.com/GoogleContainerTools/kpt
- name: Build
working-directory: ${{ env.GOPATH }}/src/github.com/GoogleContainerTools/kpt
run: |
make build
Expand All @@ -80,7 +89,10 @@ jobs:
go-version: 1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
path: ${{ env.GOPATH }}/src/github.com/GoogleContainerTools/kpt
- name: Build
working-directory: ${{ env.GOPATH }}/src/github.com/GoogleContainerTools/kpt
run: |
make build
6 changes: 2 additions & 4 deletions pkg/oci/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (r *Storage) ToRemoteImage(ctx context.Context, imageName imageName) (v1.Im
return nil, err
}
// TODO: Can we use a digest to save a lookup?
//imageRef = imageRef.Context().Digest(digest)
// imageRef = imageRef.Context().Digest(digest)

ociImage, err := remote.Image(imageRef, options...)
if err != nil {
Expand All @@ -163,9 +163,7 @@ func withCacheFile(cacheFilePath string, fetcher func() (io.ReadCloser, error))

f, err := os.Open(cacheFilePath)
if err != nil {
if errors.Is(err, fs.ErrNotExist) {
f = nil
} else {
if !errors.Is(err, fs.ErrNotExist) {
return nil, fmt.Errorf("error opening cache file %q: %w", cacheFilePath, err)
}
} else {
Expand Down

0 comments on commit 76808e3

Please sign in to comment.