Uh oh!
There was an error while loading. Please reload this page.
support setting oom_score_adj - #176
Conversation
haiyanmeng
commented
Aug 2, 2016
@mrunalp , PTAL. |
930108c to
8e409e5Comparewking
commented
Aug 2, 2016
via email
Hmm. Is there a way to clear oom_score_adj with this interface? Does
IntFlag support explicitly setting a nil value (e.g. ‘--oom-score-adj=’
with no argument). |
mrunalp
commented
Aug 2, 2016
IIRC, =FALSE works for setting nil value. |
mrunalp
commented
Aug 2, 2016
@wking nvm, I misunderstood your question. |
mrunalp
commented
Aug 2, 2016
LGTM |
wking
commented
Aug 2, 2016
On Tue, Aug 02, 2016 at 02:25:07PM -0700, Mrunal Patel wrote:
I haven't tested =FALSE, but I think we want to figure out how we |
| cli.StringSliceFlag{Name: "seccomp-errno", Usage: "specifies syscalls to be added to list that returns an error"}, | ||
| cli.StringFlag{Name: "template", Usage: "base template to use for creating the configuration"}, | ||
| cli.StringSliceFlag{Name: "label", Usage: "add annotations to the configuration e.g. key=value"}, | ||
| cli.IntFlag{Name: "oom-score-adj", Usage: "specify oom_score_adj for the container"}, |
There was a problem hiding this comment.
specify->specifies
I think usage should keep same with man
There was a problem hiding this comment.
@Mashimiao , I was struggling with this when I made the change.
The man doc always use specifies, adds, uses. However, most of flags defined in cmd/ocitools/generate.go are using specify,add,use`.
I will first change it to a phrase instead of a verb + a noun.
haiyanmeng
commented
Aug 3, 2016
@wking, I am not sure what do you really want here. |
Signed-off-by: Haiyan Meng <hmeng@redhat.com>
8e409e5 to
1915407Comparehaiyanmeng
commented
Aug 3, 2016
@mrunalp , @Mashimiao , PTAL. |
mrunalp
commented
Aug 3, 2016
Still LGTM |
wking
commented
Aug 3, 2016
GitHub seems to have eaten my emailed comment, so re-posting via the web UI: On Wed, Aug 03, 2016 at 07:36:34AM -0700, hmeng-19 wrote:
But I want a way to set the |
wking
commented
Aug 3, 2016
On Wed, Aug 03, 2016 at 07:36:34AM -0700, hmeng-19 wrote:
$ ./ocitools generate --template <(echo '{"linux": {"resources": {"oomScoreAdj": 5}}}') --oom-score-adj 0 | jq .linux But I want a way to set the |
haiyanmeng
commented
Aug 3, 2016
@wking , first I am not sure we want to support the use cases you pointed out or not. If I understand correctly, you want to remove some fields from a template completely. Right? I would suggest always feed the minimal config.json as the template, and then only add new fields into it. If you really want to remove fields from a template, then we probably should add some new flags like |
haiyanmeng
commented
Aug 3, 2016
@wking , it seems github was slow this morning. I noticed there was a 40 minutes delay before I got gmail notifications for others' comments. |
wking
commented
Aug 3, 2016
On Wed, Aug 03, 2016 at 10:56:48AM -0700, hmeng-19 wrote:
I think ‘ocitools generate --template ...’ is positioning itself to be
That's one approach, and the implementation might be more
With jq being a convenient, generic solution to config edits, I think |
haiyanmeng
commented
Aug 3, 2016
@mrunalp , how do you think about this? |
mrunalp
commented
Aug 3, 2016
Yes. But, it shouldn't block PRs while we figure it out as starting with minimal config.json is a workaround.
I think it would be good if we avoid adding new flags, but I don't see how --abc= will work for setting to nil unless the library we are using supports it by special treating some text like NIL to mean make it nil. |
haiyanmeng
commented
Aug 3, 2016
@wking , I tried to use the |
On Wed, Aug 03, 2016 at 11:40:01AM -0700, Mrunal Patel wrote:
I think that means we want to use a StringFlag here and add our own |
haiyanmeng
commented
Aug 3, 2016
@wking , I would suggest we first merge PR. |
wking
commented
Aug 3, 2016
On Wed, Aug 03, 2016 at 12:02:36PM -0700, hmeng-19 wrote:
If you like. I don't see much need to push this through if we already |
haiyanmeng
commented
Aug 3, 2016
@mrunalp , I think we can merge this PR for now, so that we can vendor it into ocid to set up oom_score_adj. |
mrunalp
commented
Aug 3, 2016
@wking By using StringFlag we lose some of the checks that we get from the CLI library. |
wking
commented
Aug 3, 2016
On Wed, Aug 03, 2016 at 03:37:05PM -0700, Mrunal Patel wrote:
So put the checks in our helper? Are the checks really that |
mrunalp
commented
Aug 4, 2016
@wking Yeah, we could look into that. We can open an issue to track this. |
mrunalp
commented
Aug 5, 2016
LGTM (we can figure out the CLI conversion on the side). |
Signed-off-by: Haiyan Meng <hmeng@redhat.com> Backported to v1.0.0.rc1 from 1915407opencontainers#176 (cherry-pick applied cleanly). Signed-off-by: W. Trevor King <wking@tremily.us>
* v1.0.0.rc1: man/ocitools.1: Replace "**...(1)**" with "**...**(1)" add namespace check for uid/gid mappings validation: add linux resource check add label manpage and fix help support setting oom_score_adj generate: fix mount-cgroups bug completions: update based on generate help message update urfave/cli package to v1.18.0 generate: optimize namespace setup log and fix manpage change param type of AddProcessAdditionalGid remove unnecessary return error value Modify generate API Add Travis CI badge to README generate: fix capability.List() for cap_last_cap not exist generate: remove unnecessary spec initialization generate: fix tmpfs adding based on manpage Check CAP_LAST_CAP while setting privileged generate: Remove superfluous err check from Save Signed-off-by: W. Trevor King <wking@tremily.us> Conflicts: cmd/ocitools/generate.go man/ocitools-generate.1.md The conflicts are because: * support setting oom_score_adj (opencontainers#176, opencontainers#185) * add label manpage and fix help (opencontainers#189, opencontainers#190) have landed in master and been backported to v1.0.0.rc1 since this branch split from master. They wouldn't have happend if I'd rebased this branch on the current master before merging v1.0.0.rc1, but then I'd have to repeat the initial dance done with eac0762 (Merge commit '30e2ea2', 2016-08-02) and b45bebd (Merge commit '6acca9e', 2016-08-02).
Signed-off-by: Haiyan Meng hmeng@redhat.com