Commit 04b9e4b Priya Wadhwa
committed
1 parent 98826ef commit 04b9e4b Copy full SHA for 04b9e4b
File tree 3 files changed +11
-21
lines changed
3 files changed +11
-21
lines changed Original file line number Diff line number Diff line change @@ -29,17 +29,17 @@ REPOPATH ?= $(ORG)/$(PROJECT)
29
29
30
30
GO_FILES := $(shell find . -type f -name '* .go' -not -path "./vendor/* ")
31
31
GO_LDFLAGS := '-extldflags "-static"'
32
- GO_BUILD_TAGS := "containers_image_ostree_stub containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs"
32
+ GO_BUILD_TAGS := "containers_image_ostree_stub containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs exclude_graphdriver_overlay "
33
33
34
34
EXECUTOR_PACKAGE = $(REPOPATH ) /executor
35
35
KBUILD_PACKAGE = $(REPOPATH ) /kbuild
36
36
37
37
out/executor : $(GO_FILES )
38
- GOOS=$* GOARCH=$(GOARCH ) CGO_ENABLED=1 go build -ldflags $(GO_LDFLAGS ) -tags $(GO_BUILD_TAGS ) -o $@ $(EXECUTOR_PACKAGE )
38
+ GOOS=$* GOARCH=$(GOARCH ) CGO_ENABLED=0 go build -ldflags $(GO_LDFLAGS ) -tags $(GO_BUILD_TAGS ) -o $@ $(EXECUTOR_PACKAGE )
39
39
40
40
41
41
out/kbuild : $(GO_FILES )
42
- GOOS=$* GOARCH=$(GOARCH ) CGO_ENABLED=1 go build -ldflags $(GO_LDFLAGS ) -tags $(GO_BUILD_TAGS ) -o $@ $(KBUILD_PACKAGE )
42
+ GOOS=$* GOARCH=$(GOARCH ) CGO_ENABLED=0 go build -ldflags $(GO_LDFLAGS ) -tags $(GO_BUILD_TAGS ) -o $@ $(KBUILD_PACKAGE )
43
43
44
44
.PHONY : test
45
45
test : out/executor out/kbuild
Original file line number Diff line number Diff line change @@ -83,12 +83,13 @@ func execute() error {
83
83
}
84
84
85
85
// Initialize source image
86
- if err := image .InitializeSourceImage (baseImage ); err != nil {
86
+ sourceImage , err := image .NewSourceImage (baseImage )
87
+ if err != nil {
87
88
return err
88
89
}
89
90
90
91
// Execute commands here
91
92
92
93
// Push the image
93
- return image .PushImage (destination )
94
+ return image .PushImage (sourceImage , destination )
94
95
}
Original file line number Diff line number Diff line change @@ -26,33 +26,22 @@ import (
26
26
)
27
27
28
28
// sourceImage is the image that will be modified by the executor
29
- var sourceImage img.MutableSource
30
29
31
30
// InitializeSourceImage initializes the source image with the base image
32
- func InitializeSourceImage (srcImg string ) error {
31
+ func NewSourceImage (srcImg string ) ( * img. MutableSource , error ) {
33
32
logrus .Infof ("Initializing source image %s" , srcImg )
34
33
ref , err := docker .ParseReference ("//" + srcImg )
35
34
if err != nil {
36
- return err
37
- }
38
- ms , err := img .NewMutableSource (ref )
39
- if err != nil {
40
- return err
35
+ return nil , err
41
36
}
42
- sourceImage = * ms
43
- return nil
44
- }
45
-
46
- // AppendLayer appends a layer onto the base image
47
- func AppendLayer (contents []byte , author string ) error {
48
- return sourceImage .AppendLayer (contents , author )
37
+ return img .NewMutableSource (ref )
49
38
}
50
39
51
40
// PushImage pushes the final image
52
- func PushImage (destImg string ) error {
41
+ func PushImage (ms * img. MutableSource , destImg string ) error {
53
42
srcRef := & img.ProxyReference {
54
43
ImageReference : nil ,
55
- Src : & sourceImage ,
44
+ Src : ms ,
56
45
}
57
46
destRef , err := alltransports .ParseImageName ("docker://" + destImg )
58
47
if err != nil {
You can’t perform that action at this time.
0 commit comments