Skip to content

Modify generate API - #169

Merged
mrunalp merged 3 commits into
opencontainers:masterfrom
haiyanmeng:fix_generate_api
Aug 1, 2016
Merged

Modify generate API#169
mrunalp merged 3 commits into
opencontainers:masterfrom
haiyanmeng:fix_generate_api

Conversation

@haiyanmeng

Copy link
Copy Markdown
Contributor

This PR tries to make the generate API easier to use. For example, instead of feeding a whole string to AddAnnotation, the new API allows the user to feed a key and a value to AddAnnotation.

Note: This PR does not touch any seccomp-relative function to avoid conflicts with Grant's work.
Signed-off-by: Haiyan Meng hmeng@redhat.com

Signed-off-by: Haiyan Meng <hmeng@redhat.com>
@haiyanmeng

Copy link
Copy Markdown
ContributorAuthor

@mrunalp , PTAL.

@haiyanmeng

Copy link
Copy Markdown
ContributorAuthor

@mrunalp , to make it easy for you to test the PR, here is the test command for testing all the changed functions in this PR:

ocitools generate --uidmappings 0:19:1000 --gidmappings 0:29:1032 --tmpfs /hmeng/test/tmp:rw,noexec --bind /hmeng/test11:/hmeng/testcontainer12 --bind /hmeng/test:/hmeng/testcontainer:rw --prestart ls:/dev:/run --poststart date:-u --poststop uname:-a --sysctl net.ipv4.forward=1 --sysctl myname=hmeng --label tag=mytag1 --output config.json

@mrunalp

Copy link
Copy Markdown
Contributor

LGTM

Comment threadgenerate/generate.go Outdated

// AddLinuxSysctl adds a new sysctl config into g.spec.Linux.Sysctl.
func (g *Generator) AddLinuxSysctl(s string) error {
func (g *Generator) AddLinuxSysctl(key, value string) error {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this function does not need return error any more. Same as other AddXXXX() function.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mashimiao , thanks for pointing out. Fixed it. PTAL.
I also change the param of AddProcessAdditionalGid from string to uint32.

Haiyan Meng added 2 commits July 29, 2016 11:30
Signed-off-by: Haiyan Meng <hmeng@redhat.com>
Signed-off-by: Haiyan Meng <hmeng@redhat.com>
@haiyanmeng

Copy link
Copy Markdown
ContributorAuthor

@mrunalp , PTAL.

@mrunalp

Copy link
Copy Markdown
Contributor

LGTM

@mrunalp
mrunalp merged commit 7233310 into opencontainers:masterAug 1, 2016
@haiyanmeng
haiyanmeng deleted the fix_generate_api branch August 1, 2016 19:56
wking pushed a commit to wking/ocitools-v2 that referenced this pull request Aug 3, 2016
Signed-off-by: Haiyan Meng <hmeng@redhat.com>
Backported to v1.0.0.rc1 from a217d8copencontainers#169 (cherry-pick applied
cleanly).
Signed-off-by: W. Trevor King <wking@tremily.us>
wking pushed a commit to wking/ocitools-v2 that referenced this pull request Aug 3, 2016
Signed-off-by: Haiyan Meng <hmeng@redhat.com>
Backported to v1.0.0.rc1 from b31cc61opencontainers#169 (cherry-pick applied
cleanly).
Signed-off-by: W. Trevor King <wking@tremily.us>
wking pushed a commit to wking/ocitools-v2 that referenced this pull request Aug 3, 2016
Signed-off-by: Haiyan Meng <hmeng@redhat.com>
Backported to v1.0.0.rc1 from a99f698opencontainers#169 (cherry-pick applied
cleanly).
Signed-off-by: W. Trevor King <wking@tremily.us>
@wkingwking mentioned this pull request Aug 3, 2016
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@haiyanmeng@mrunalp@wking@Mashimiao