Skip to content

Conversation

@haiyanmeng
Copy link
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 [email protected]

Signed-off-by: Haiyan Meng <[email protected]>
@haiyanmeng
Copy link
Contributor Author

@mrunalp , PTAL.

@haiyanmeng
Copy link
Contributor Author

@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
Contributor

mrunalp commented Jul 28, 2016

LGTM


// 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 {

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
Contributor Author

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
@haiyanmeng
Copy link
Contributor Author

@mrunalp , PTAL.

@mrunalp
Copy link
Contributor

mrunalp commented Aug 1, 2016

LGTM

@mrunalp mrunalp merged commit 7233310 into opencontainers:master Aug 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 <[email protected]>

Backported to v1.0.0.rc1 from a217d8c opencontainers#169 (cherry-pick applied
cleanly).

Signed-off-by: W. Trevor King <[email protected]>
wking pushed a commit to wking/ocitools-v2 that referenced this pull request Aug 3, 2016
Signed-off-by: Haiyan Meng <[email protected]>

Backported to v1.0.0.rc1 from b31cc61 opencontainers#169 (cherry-pick applied
cleanly).

Signed-off-by: W. Trevor King <[email protected]>
wking pushed a commit to wking/ocitools-v2 that referenced this pull request Aug 3, 2016
Signed-off-by: Haiyan Meng <[email protected]>

Backported to v1.0.0.rc1 from a99f698 opencontainers#169 (cherry-pick applied
cleanly).

Signed-off-by: W. Trevor King <[email protected]>
Sign up for free to 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