Skip to content

Commit

Permalink
Add support for socketless image copy (#63)
Browse files Browse the repository at this point in the history
* add support for socketless image copy

* enable golang compile without gpgme

* fix containers/image/v5 pipeline build

* fix go test for opengpg

* tidy up
  • Loading branch information
hassenius authored May 20, 2022
1 parent db30d0e commit 31de589
Show file tree
Hide file tree
Showing 7 changed files with 1,037 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
uses: actions/checkout@v2

- name: build
run: go build -o sinker main.go
run: go build -tags 'containers_image_openpgp' -o sinker main.go

- name: lint go
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.43.0
./bin/golangci-lint run --timeout=5m --color=always --max-same-issues=0 --max-issues-per-linter=0
- name: unit tests
run: go test -v ./...
run: go test -tags 'containers_image_openpgp' -v ./...
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ ENV CGO_ENABLED=0

WORKDIR /build
COPY . /build

# SINKER_VERSION is set during the release process
ARG SINKER_VERSION=0.0.0
RUN go build -ldflags="-X 'github.com/plexsystems/sinker/internal/commands.sinkerVersion=${SINKER_VERSION}'"
RUN go build -tags 'containers_image_openpgp' -ldflags="-X 'github.com/plexsystems/sinker/internal/commands.sinkerVersion=${SINKER_VERSION}'"

FROM alpine:3.14.3

Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
GO_TAGS=-tags 'containers_image_openpgp'
.PHONY: build
build:
@go build -ldflags="-X 'github.com/plexsystems/sinker/internal/commands.sinkerVersion=$$(git describe --tags --always --dirty)'"
@go build $(GO_TAGS) -ldflags="-X 'github.com/plexsystems/sinker/internal/commands.sinkerVersion=$$(git describe --tags --always --dirty)'"

.PHONY: test
test:
Expand All @@ -23,6 +24,6 @@ all: build test acceptance
release:
@test $(version)
@docker build --build-arg SINKER_VERSION=$(version) -t plexsystems/sinker:$(version) .
@GOOS=darwin GOARCH=amd64 go build -o sinker-darwin-amd64 -ldflags="-X 'github.com/plexsystems/sinker/internal/commands.sinkerVersion=$(version)'"
@GOOS=windows GOARCH=amd64 go build -o sinker-windows-amd64 -ldflags="-X 'github.com/plexsystems/sinker/internal/commands.sinkerVersion=$(version)'"
@GOOS=linux GOARCH=amd64 go build -o sinker-linux-amd64 -ldflags="-X 'github.com/plexsystems/sinker/internal/commands.sinkerVersion=$(version)'"
@GOOS=darwin GOARCH=amd64 go build $(GO_TAGS) -o sinker-darwin-amd64 -ldflags="-X 'github.com/plexsystems/sinker/internal/commands.sinkerVersion=$(version)'"
@GOOS=windows GOARCH=amd64 go build $(GO_TAGS) -o sinker-windows-amd64 -ldflags="-X 'github.com/plexsystems/sinker/internal/commands.sinkerVersion=$(version)'"
@GOOS=linux GOARCH=amd64 go build $(GO_TAGS) -o sinker-linux-amd64 -ldflags="-X 'github.com/plexsystems/sinker/internal/commands.sinkerVersion=$(version)'"
52 changes: 41 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
module github.com/plexsystems/sinker

go 1.14
go 1.15

require (
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 // indirect
github.com/Djarvur/go-err113 v0.1.0 // indirect
github.com/apex/log v1.3.0 // indirect
github.com/avast/retry-go v2.6.0+incompatible
github.com/containerd/containerd v1.3.6 // indirect
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c // indirect
github.com/bombsimon/wsl/v2 v2.2.0 // indirect
github.com/bombsimon/wsl/v3 v3.1.0 // indirect
github.com/containers/image v1.5.1 // indirect
github.com/containers/image/v5 v5.20.0
// github.com/containers/image/v5/docker v5.20.0
github.com/coreos/prometheus-operator v0.40.0
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7
github.com/docker/docker v20.10.12+incompatible
github.com/ghodss/yaml v1.0.0
github.com/google/go-containerregistry v0.1.1
github.com/go-critic/go-critic v0.4.3 // indirect
github.com/go-toolsmith/typep v1.0.2 // indirect
github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d // indirect
github.com/golangci/misspell v0.3.5 // indirect
github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039 // indirect
github.com/google/go-containerregistry v0.5.1
github.com/google/wire v0.4.0 // indirect
github.com/goreleaser/goreleaser v0.136.0 // indirect
github.com/goreleaser/nfpm v1.3.0 // indirect
github.com/gostaticanalysis/analysisutil v0.0.3 // indirect
github.com/hashicorp/go-retryablehttp v0.6.6 // indirect
github.com/hashicorp/go-version v1.2.1
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect
github.com/mattn/go-ieproxy v0.0.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.7.0
google.golang.org/grpc v1.30.0 // indirect
gopkg.in/yaml.v2 v2.3.0
k8s.io/api v0.18.6
k8s.io/apimachinery v0.18.6
github.com/ryancurrah/gomodguard v1.1.0 // indirect
github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/sourcegraph/go-diff v0.5.3 // indirect
github.com/spf13/cobra v1.3.0
github.com/spf13/viper v1.10.0
github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b // indirect
github.com/tetafro/godot v0.4.2 // indirect
github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94 // indirect
github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4 // indirect
github.com/xanzy/go-gitlab v0.32.0 // indirect
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e // indirect
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.20.6
k8s.io/apimachinery v0.20.6
mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7 // indirect
sourcegraph.com/sqs/pbtypes v1.0.0 // indirect
)
Loading

0 comments on commit 31de589

Please sign in to comment.