-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Rebase and merge of docker sysctl support #3568
Conversation
Thanks a lot @preetapan . I really need this one! |
@@ -75,6 +75,7 @@ The `docker` driver supports the following configuration in the job spec. Only | |||
} | |||
``` | |||
|
|||
<<<<<<< 657619c0ec51068e48a34817ddc4df267b6cce6f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left-over merge conflict marker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed now
client/driver/docker.go
Outdated
splitted := strings.SplitN(ulimitRaw, ":", 2) | ||
soft, err := strconv.Atoi(splitted[0]) | ||
if err != nil { | ||
return []docker.ULimit{}, fmt.Errorf("Malformed ulimit %v: %v", name, ulimitRaw) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe include that it's the soft limit that is invalid? - same below for hard limit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed with the limit specification for logging.
client/driver/docker.go
Outdated
} | ||
|
||
splitted := strings.SplitN(ulimitRaw, ":", 2) | ||
soft, err := strconv.Atoi(splitted[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check length before indexing.
client/driver/docker.go
Outdated
splitted := strings.SplitN(ulimitRaw, ":", 2) | ||
soft, err := strconv.Atoi(splitted[0]) | ||
if err != nil { | ||
return []docker.ULimit{}, fmt.Errorf("Malformed ulimit %v: %v", name, ulimitRaw) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed with the limit specification for logging.
client/driver/docker.go
Outdated
if err != nil { | ||
return []docker.ULimit{}, fmt.Errorf("Malformed ulimit %v: %v", name, ulimitRaw) | ||
} | ||
hard, err := strconv.Atoi(splitted[1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check limit before indexing.
client/driver/docker_test.go
Outdated
|
||
container, err := client.InspectContainer(handle.ContainerID()) | ||
if err != nil { | ||
t.Fatalf("err: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use assert library for test assertions.
@@ -97,6 +97,34 @@ The `docker` driver supports the following configuration in the job spec. Only | |||
* `interactive` - (Optional) `true` or `false` (default). Keep STDIN open on | |||
the container. | |||
|
|||
* `sysctl` - (Optional) A key-value map of sysctl configurations to set to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence is incomplete.
@@ -858,6 +858,60 @@ func TestDockerDriver_NetworkAliases_Bridge(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestDockerDriver_Sysctl_Ulimit(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we test the failure conditions as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! If you can just swap to use assert in the error case test.
client/driver/docker_test.go
Outdated
defer ctx.AllocDir.Destroy() | ||
|
||
if _, err := driver.Prestart(ctx.ExecCtx, task); err == nil || err.Error() != tc.err.Error() { | ||
t.Fatalf("error expected in prestart, got %v, expected %v", err, tc.err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use assert here :)
Is there any plans for supporting this for |
@ashald Looks like there isn't support yet: rkt/rkt#2694 |
Sorry, missed that! |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
No description provided.