Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cap-add && cap-drop flags #55

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

fahedouch
Copy link
Member

Signed-off-by: fahedouch fahed.dorgaa@gmail.com

run.go Outdated
Name: "cap-add",
Usage: "Add Linux capabilities",
},
&cli.StringSliceFlag{
Copy link
Member

Choose a reason for hiding this comment

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

Please gofmt

run.go Outdated
}
opts = append(opts, oci.WithCapabilities(caps))

caps = []string{}
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid reusing caps variable here. This should be a new variable like capsDrop

@AkihiroSuda
Copy link
Member

Signed-off-by: fahedouch

Could you use full name?

run.go Outdated
@@ -54,6 +54,7 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"github.com/containerd/cri/pkg/util"
Copy link
Member

Choose a reason for hiding this comment

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

Can we avoid CRI dependency?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok I move it inside nerdctl

@fahedouch fahedouch changed the title [WIP] add cap-add && cap-drop flags add cap-add && cap-drop flags Jan 6, 2021
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com>

fix MR

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>

fix MR

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>

fmt

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>

// InStringSlice checks whether a string is inside a string slice.
// Comparison is case insensitive.
func InStringSlice(ss []string, str string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

nit: this should be in existing strutil.go . Also please clarify the origin of the code in the comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

@AkihiroSuda what do you mean by existing strutil.go ? in nerdctl project or in other project ?

Copy link
Member

Choose a reason for hiding this comment

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

@@ -0,0 +1,27 @@
/*
Copyright The containerd Authors.
Copy link
Member

Choose a reason for hiding this comment

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

missing nerdctl authors comment I think

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Jan 8, 2021

Merging. I'll address nits in a follow-up

(EDIT: done AkihiroSuda@1f9b447)

@AkihiroSuda AkihiroSuda merged commit 1b4adb1 into containerd:master Jan 8, 2021
AkihiroSuda added a commit that referenced this pull request Jan 8, 2021
follow-up to #55

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@AkihiroSuda
Copy link
Member

Tests for this is being added in https://github.com/AkihiroSuda/nerdctl/pull/56/files

fahedouch referenced this pull request in fahedouch/nerdctl Feb 16, 2021
follow-up to #55

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
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.

None yet

3 participants