Skip to content

Commit

Permalink
add securityopt arg support
Browse files Browse the repository at this point in the history
  • Loading branch information
bparees committed Oct 31, 2017
1 parent de3ca58 commit 865e79f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions image.go
Expand Up @@ -473,6 +473,7 @@ type BuildImageOptions struct {
NetworkMode string `qs:"networkmode"`
InactivityTimeout time.Duration `qs:"-"`
CgroupParent string `qs:"cgroupparent"`
SecurityOpt []string `qs:"securityopt"`
Context context.Context
}

Expand Down
4 changes: 3 additions & 1 deletion image_test.go
Expand Up @@ -801,6 +801,7 @@ func TestBuildImageParameters(t *testing.T) {
Labels: map[string]string{"k": "v"},
NetworkMode: "host",
CgroupParent: "cgparent",
SecurityOpt: []string{"securityoptions"},
}
err := client.BuildImage(opts)
if err != nil && !strings.Contains(err.Error(), "build image fail") {
Expand All @@ -825,10 +826,11 @@ func TestBuildImageParameters(t *testing.T) {
"buildargs": {`{"SOME_VAR":"some_value"}`},
"networkmode": {"host"},
"cgroupparent": {"cgparent"},
"securityopt": {"securityoptions"},
}
got := map[string][]string(req.URL.Query())
if !reflect.DeepEqual(got, expected) {
t.Errorf("BuildImage: wrong query string. Want %#v. Got %#v.", expected, got)
t.Errorf("BuildImage: wrong query string. Want %#v.\n Got %#v.", expected, got)
}
}

Expand Down

0 comments on commit 865e79f

Please sign in to comment.