-
Notifications
You must be signed in to change notification settings - Fork 27
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
capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 #14
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wking
force-pushed
the
new2-no-load
branch
2 times, most recently
from
February 20, 2018 00:19
de16c6c
to
c9101b3
Compare
The old methods had an internal Load(), which is unnecessary for some use cases. For example, if you're going to drop all capabilities, you don't need to load the current set first. This commit deprecates the old New* functions and adds New*2 functions which do not include the internal Load. Callers who do need the Load will need to call it explicitly after initializing their Capabilities object. Callers who do not need the Load can just add the "2" to the function name and get more efficient/robust behavior. The "Deprecated:" paragraph syntax is recommended in [1]: To signal that an identifier should not be used, add a paragraph to its doc comment that begins with "Deprecated:" followed by some information about the deprecation. [1]: https://blog.golang.org/godoc-documenting-go-code
There is room for further optimization in this direction by adding a |
wking
added a commit
to wking/runc
that referenced
this pull request
Feb 20, 2018
Take advantage of [1] to avoid crashing with: container_linux.go:348: starting container process caused "open /proc/9976/status: no such file or directory" [1]: syndtr/gocapability#14 Signed-off-by: W. Trevor King <wking@tremily.us>
3 tasks
thaJeztah
added a commit
to thaJeztah/runc
that referenced
this pull request
Mar 28, 2019
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
added a commit
to thaJeztah/runc
that referenced
this pull request
Mar 28, 2019
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
added a commit
to thaJeztah/runc
that referenced
this pull request
Apr 12, 2019
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
added a commit
to thaJeztah/runc
that referenced
this pull request
Apr 12, 2019
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
added a commit
to thaJeztah/runc
that referenced
this pull request
Apr 12, 2019
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
added a commit
to thaJeztah/containerd
that referenced
this pull request
Apr 18, 2019
full diff: syndtr/gocapability@db04d3c...d983527 changes included: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
kiwik
pushed a commit
to theopenlab/containerd
that referenced
this pull request
Apr 23, 2019
* Add tcp service for grpc listeners Signed-off-by: Michael Crosby <crosbymichael@gmail.com> * Set nofile to 1048576 Closes containerd#3201 Signed-off-by: Michael Crosby <crosbymichael@gmail.com> * Fix API forward events for shims Signed-off-by: Michael Crosby <crosbymichael@gmail.com> * Add support for required plugins. Signed-off-by: Lantao Liu <lantaol@google.com> * Use $TEST_RUNTIME for cri test. Signed-off-by: Lantao Liu <lantaol@google.com> * Improve shim shutdown logic Shims no longer call `os.Exit` but close the context on shutdown so that events and other resources have hit the `defer`s. Signed-off-by: Michael Crosby <crosbymichael@gmail.com> * Add dialer for events service Signed-off-by: Michael Crosby <crosbymichael@gmail.com> * Rename `hrpc` to `tcpServer` Signed-off-by: Michael Crosby <crosbymichael@gmail.com> * Check task list to avoid unnecessary cleanup. Signed-off-by: Lantao Liu <lantaol@google.com> * Correct import path in services/server package Signed-off-by: Jared Cordasco <jcordasc@coglib.com> * Correct PusherFunc helper to match Pusher intf Signed-off-by: Jared Cordasco <jcordasc@coglib.com> * Requeue events in the shim publisher Signed-off-by: Michael Crosby <crosbymichael@gmail.com> * bump mistifyio/go-zfs f784269be439d704d3dfa1906f45dd848fed2beb - mistifyio/go-zfs#72 Switch to google/uuid - removes the github.com/pborman/uuid dependency Signed-off-by: Sebastiaan van Stijn <github@gone.nl> * Update go-winio in vendor.conf Signed-off-by: Kevin Parsons <kevpar@microsoft.com> * Allow dumping stacks via ETW capture state Signed-off-by: Kevin Parsons <kevpar@microsoft.com> * Access to client's GRPC connection object Signed-off-by: Maksym Pavlenko <makpav@amazon.com> * .mailmap: update Akihiro Suda's email address No affiliation change (NTT). The former email address will continue to be available for the time being. For daily communication, I still prefer to use my gmail.com address. Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> * Move to sha-specified test image for nanoserver Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> * Fix error on pull hang in CI Kill the underlying containerd after outputting error. Otherwise CI hangs indefinitely and requires the CI infrastructure to kill the build at the timeout expiration. Signed-off-by: Wei Fu <fuweid89@gmail.com> Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> * Write stack dump to `os.TempDir()` as well Signed-off-by: John Howard <jhoward@microsoft.com> * bump gocapability full diff: syndtr/gocapability@db04d3c...d983527 changes included: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl> * Update x/crypto to 88737f569e3a9c7ab309cdc09a07fe7fc87233c3 full diff: golang/crypto@4979611...88737f5 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> * bump containerd/console 0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f Signed-off-by: Sebastiaan van Stijn <github@gone.nl> * Convert Windows CI to use Microsoft MCR image urls Signed-off-by: Justin Terry (VM) <juterry@microsoft.com> * Don't write dumped stacks to file for ETW capture state Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
thaJeztah
added a commit
to thaJeztah/runc
that referenced
this pull request
Apr 25, 2019
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
added a commit
to thaJeztah/runc
that referenced
this pull request
Jul 14, 2019
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
added a commit
to thaJeztah/runc
that referenced
this pull request
Aug 26, 2019
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
added a commit
to thaJeztah/runc
that referenced
this pull request
Sep 5, 2019
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
stefanberger
pushed a commit
to stefanberger/runc
that referenced
this pull request
Dec 31, 2019
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
adrianreber
pushed a commit
to adrianreber/runc
that referenced
this pull request
Feb 10, 2020
relevant changes: - syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2 - syndtr/gocapability#16 Fix capHeader.pid type Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This pull request was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old methods had an internal
Load()
, which is unnecessary for some use cases. For example, if you're going to drop all capabilities, you don't need to load the current set first. This commit deprecates the oldNew*
functions and addsNew*2
functions which do not include the internalLoad
. Callers who do need theLoad
will need to call it explicitly after initializing theirCapabilities
object. Callers who do not need theLoad
can just add the2
to the function name and get more efficient/robust behavior.