<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/docker.git/daemon/container_linux.go, branch master</title>
<subtitle>github.com: dotcloud/docker.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/'/>
<entry>
<title>container: split security options to a SecurityOptions struct</title>
<updated>2023-04-28T22:03:37+00:00</updated>
<author>
<name>Sebastiaan van Stijn</name>
<email>github@gone.nl</email>
</author>
<published>2023-04-14T07:27:20+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/commit/?id=3eebf4d1622a0d8fc60f30694ee99d2130db1f4b'/>
<id>3eebf4d1622a0d8fc60f30694ee99d2130db1f4b</id>
<content type='text'>
- Split these options to a separate struct, so that we can handle them in isolation.
- Change some tests to use subtests, and improve coverage

Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Split these options to a separate struct, so that we can handle them in isolation.
- Change some tests to use subtests, and improve coverage

Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon: load and cache sysInfo on initialization</title>
<updated>2022-01-12T17:28:15+00:00</updated>
<author>
<name>Sebastiaan van Stijn</name>
<email>github@gone.nl</email>
</author>
<published>2022-01-07T11:54:47+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/commit/?id=483aa6294b457ad4f60df91e46c0038a0e953dad'/>
<id>483aa6294b457ad4f60df91e46c0038a0e953dad</id>
<content type='text'>
The `daemon.RawSysInfo()` function can be a heavy operation, as it collects
information about all cgroups on the host, networking, AppArmor, Seccomp, etc.

While looking at our code, I noticed that various parts in the code call this
function, potentially even _multiple times_ per container, for example, it is
called from:

- `verifyPlatformContainerSettings()`
- `oci.WithCgroups()` if the daemon has `cpu-rt-period` or `cpu-rt-runtime` configured
- in `ContainerDecoder.DecodeConfig()`, which is called on boith `container create` and `container commit`

Given that this information is not expected to change during the daemon's
lifecycle, and various information coming from this (such as seccomp and
apparmor status) was already cached, we may as well load it once, and cache
the results in the daemon instance.

This patch updates `daemon.RawSysInfo()` to use a `sync.Once()` so that
it's only executed once for the daemon's lifecycle.

Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `daemon.RawSysInfo()` function can be a heavy operation, as it collects
information about all cgroups on the host, networking, AppArmor, Seccomp, etc.

While looking at our code, I noticed that various parts in the code call this
function, potentially even _multiple times_ per container, for example, it is
called from:

- `verifyPlatformContainerSettings()`
- `oci.WithCgroups()` if the daemon has `cpu-rt-period` or `cpu-rt-runtime` configured
- in `ContainerDecoder.DecodeConfig()`, which is called on boith `container create` and `container commit`

Given that this information is not expected to change during the daemon's
lifecycle, and various information coming from this (such as seccomp and
apparmor status) was already cached, we may as well load it once, and cache
the results in the daemon instance.

This patch updates `daemon.RawSysInfo()` to use a `sync.Once()` so that
it's only executed once for the daemon's lifecycle.

Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to Go 1.17.0, and gofmt with Go 1.17</title>
<updated>2021-08-24T21:33:27+00:00</updated>
<author>
<name>Sebastiaan van Stijn</name>
<email>github@gone.nl</email>
</author>
<published>2021-08-23T13:14:53+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/commit/?id=686be57d0a6e514c0cddb2f3ac9cbb3cbef87f5f'/>
<id>686be57d0a6e514c0cddb2f3ac9cbb3cbef87f5f</id>
<content type='text'>
Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon: fix capitalization of some functions</title>
<updated>2020-04-14T15:22:19+00:00</updated>
<author>
<name>Sebastiaan van Stijn</name>
<email>github@gone.nl</email>
</author>
<published>2019-08-09T10:33:15+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/commit/?id=5d040cbd163a8c5b78ac7fa08bbd2d9df6b4790e'/>
<id>5d040cbd163a8c5b78ac7fa08bbd2d9df6b4790e</id>
<content type='text'>
Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon: normalize comment formatting</title>
<updated>2019-11-27T14:43:53+00:00</updated>
<author>
<name>Sebastiaan van Stijn</name>
<email>github@gone.nl</email>
</author>
<published>2019-11-27T14:43:53+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/commit/?id=f4f56b1197934858b15d7b0548b2821a8e1322e2'/>
<id>f4f56b1197934858b15d7b0548b2821a8e1322e2</id>
<content type='text'>
Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon: use constants for AppArmor profiles</title>
<updated>2019-10-13T17:16:12+00:00</updated>
<author>
<name>Sebastiaan van Stijn</name>
<email>github@gone.nl</email>
</author>
<published>2019-10-12T22:04:44+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/commit/?id=a33cf495f2f0ef0b30b943fc9a7e54ec2aaa4c1e'/>
<id>a33cf495f2f0ef0b30b943fc9a7e54ec2aaa4c1e</id>
<content type='text'>
Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Sebastiaan van Stijn &lt;github@gone.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add canonical import comment</title>
<updated>2018-02-05T21:51:57+00:00</updated>
<author>
<name>Daniel Nephin</name>
<email>dnephin@docker.com</email>
</author>
<published>2018-02-05T21:05:59+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/commit/?id=4f0d95fa6ee7f865597c03b9e63702cdcb0f7067'/>
<id>4f0d95fa6ee7f865597c03b9e63702cdcb0f7067</id>
<content type='text'>
Signed-off-by: Daniel Nephin &lt;dnephin@docker.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Daniel Nephin &lt;dnephin@docker.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move api/errdefs to errdefs</title>
<updated>2018-01-12T02:21:43+00:00</updated>
<author>
<name>Brian Goff</name>
<email>cpuguy83@gmail.com</email>
</author>
<published>2018-01-11T19:53:06+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/commit/?id=d453fe35b9b8b52d0677fe0c3cc8373f2f5d30d0'/>
<id>d453fe35b9b8b52d0677fe0c3cc8373f2f5d30d0</id>
<content type='text'>
Signed-off-by: Brian Goff &lt;cpuguy83@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Brian Goff &lt;cpuguy83@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add helpers to create errdef errors</title>
<updated>2018-01-12T02:21:43+00:00</updated>
<author>
<name>Brian Goff</name>
<email>cpuguy83@gmail.com</email>
</author>
<published>2017-11-29T04:09:37+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/commit/?id=87a12421a94faac294079bebc97c8abb4180dde5'/>
<id>87a12421a94faac294079bebc97c8abb4180dde5</id>
<content type='text'>
Instead of having to create a bunch of custom error types that are doing
nothing but wrapping another error in sub-packages, use a common helper
to create errors of the requested type.

e.g. instead of re-implementing this over and over:

```go
type notFoundError struct {
  cause error
}

func(e notFoundError) Error() string {
  return e.cause.Error()
}

func(e notFoundError) NotFound() {}

func(e notFoundError) Cause() error {
  return e.cause
}
```

Packages can instead just do:

```
  errdefs.NotFound(err)
```

Signed-off-by: Brian Goff &lt;cpuguy83@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of having to create a bunch of custom error types that are doing
nothing but wrapping another error in sub-packages, use a common helper
to create errors of the requested type.

e.g. instead of re-implementing this over and over:

```go
type notFoundError struct {
  cause error
}

func(e notFoundError) Error() string {
  return e.cause.Error()
}

func(e notFoundError) NotFound() {}

func(e notFoundError) Cause() error {
  return e.cause
}
```

Packages can instead just do:

```
  errdefs.NotFound(err)
```

Signed-off-by: Brian Goff &lt;cpuguy83@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove string checking in API error handling</title>
<updated>2017-08-15T20:01:11+00:00</updated>
<author>
<name>Brian Goff</name>
<email>cpuguy83@gmail.com</email>
</author>
<published>2017-07-19T14:20:13+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/docker.git/commit/?id=ebcb7d6b406fe50ea9a237c73004d75884184c33'/>
<id>ebcb7d6b406fe50ea9a237c73004d75884184c33</id>
<content type='text'>
Use strongly typed errors to set HTTP status codes.
Error interfaces are defined in the api/errors package and errors
returned from controllers are checked against these interfaces.

Errors can be wraeped in a pkg/errors.Causer, as long as somewhere in the
line of causes one of the interfaces is implemented. The special error
interfaces take precedence over Causer, meaning if both Causer and one
of the new error interfaces are implemented, the Causer is not
traversed.

Signed-off-by: Brian Goff &lt;cpuguy83@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use strongly typed errors to set HTTP status codes.
Error interfaces are defined in the api/errors package and errors
returned from controllers are checked against these interfaces.

Errors can be wraeped in a pkg/errors.Causer, as long as somewhere in the
line of causes one of the interfaces is implemented. The special error
interfaces take precedence over Causer, meaning if both Causer and one
of the new error interfaces are implemented, the Causer is not
traversed.

Signed-off-by: Brian Goff &lt;cpuguy83@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
