Skip to content

Commit e168a0b

Browse files
committed
fix(ci): add go build tags
1 parent ee51e83 commit e168a0b

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

.github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ concurrency:
1414
group: ${{ github.ref }}
1515
cancel-in-progress: true
1616

17+
env:
18+
GOFLAGS: -tags=containers_image_openpgp,exclude_graphdriver_btrfs,btrfs_noversion,exclude_graphdriver_devicemapper
19+
1720
jobs:
1821

1922
lint:

.goreleaser.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ builds:
1717
mod_timestamp: '{{ .CommitTimestamp }}'
1818
flags:
1919
- -trimpath
20+
- -tags=containers_image_openpgp,exclude_graphdriver_btrfs,btrfs_noversion,exclude_graphdriver_devicemapper
2021
ldflags:
2122
- -s -w
2223

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ TEST_OPTIONS?=
77

88
export GO111MODULE := on
99
export GOPROXY = https://proxy.golang.org,direct
10+
export GOFLAGS ?= -tags=containers_image_openpgp,exclude_graphdriver_btrfs,btrfs_noversion,exclude_graphdriver_devicemapper
11+
export CGO_ENABLED ?=0
1012

1113
help: ## List targets & descriptions
1214
@cat Makefile* | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@@ -30,3 +32,6 @@ lint: ## Run linters
3032

3133
e2e: ## Run end-to-end tests
3234
go test -v -run TestHelmDeployment ./test
35+
36+
build: ## Run go build
37+
go build

cmd/root.go

-2
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,9 @@ A mutating webhook for Kubernetes, pointing the images to a new location.`,
6565
log.Trace().Interface("config", cfg).Msg("config")
6666

6767
var imageBackend backend.Backend = backend.NewSkopeo()
68-
6968
if cfg.NativeBackend {
7069
log.Warn().Msg("experimental native image backend enabled")
7170
imageBackend = backend.NewNative()
72-
7371
}
7472

7573
// Create registry clients for source registries

pkg/registry/ecr_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package registry
22

33
import (
44
"encoding/base64"
5-
"github.com/containers/image/v5/transports/alltransports"
65
"testing"
76

7+
"github.com/containers/image/v5/transports/alltransports"
8+
89
"github.com/estahn/k8s-image-swapper/pkg/config"
910
"github.com/stretchr/testify/assert"
1011
)

pkg/registry/gar_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package registry
22

33
import (
4-
"github.com/containers/image/v5/transports/alltransports"
54
"testing"
65

6+
"github.com/containers/image/v5/transports/alltransports"
7+
78
"github.com/stretchr/testify/assert"
89
)
910

0 commit comments

Comments
 (0)