-
-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for metadata API (#1137)
* Add support for metadata API This change adds support for the (undocumented) metadata API. Through this change, clients may request only the metadata of objects, reducing I/O and storage pressure. To make it possible, the change adds new request impl in kube-core, and new metadata methods on the Api type. Additionally, this change also adds a new 'PartialObjectMeta' type that is supposed to mirror the Go counterpart. A wrapper list has also been added. Both of these support conversions to ObjectMeta (or ObjectList<ObjectMeta>). Metadata-only requests are made possible through the REST API by including an extended Accept header. The header will notify the API Server a JSON response is expected, and it will encode an additional 'as=PartialObjectMetadata' k=v pair to receive only the metadata of the object. This is more efficient when only the metadata needs to be parsed (as opposed to the whole spec). Note: Older servers (k8s v1.14 and below) will retrieve the object and then convert the metadata Signed-off-by: Matei David <matei@buoyant.io> * Run fmt Signed-off-by: Matei David <matei@buoyant.io> * Pass request unit tests Signed-off-by: Matei David <matei@buoyant.io> * Add docs for new types and methods Signed-off-by: Matei David <matei@buoyant.io> * Add list and patch integration tests Signed-off-by: Matei David <matei@buoyant.io> * Address feedback and fix doc tests Signed-off-by: Matei David <matei@buoyant.io> * Update kube-core/src/metadata.rs Co-authored-by: Eirik A <sszynrae@gmail.com> Signed-off-by: Matei David <matei.david.35@gmail.com> * Add Resource impl for PartialObjectMeta Signed-off-by: Matei David <matei@buoyant.io> * Fix stale comment that referred to PartialObjectMetaList Signed-off-by: Matei David <matei@buoyant.io> * Run fmt Signed-off-by: Matei David <matei@buoyant.io> --------- Signed-off-by: Matei David <matei@buoyant.io> Signed-off-by: Matei David <matei.david.35@gmail.com> Co-authored-by: Eirik A <sszynrae@gmail.com>
- Loading branch information
1 parent
4c26615
commit fdd799d
Showing
4 changed files
with
511 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Oops, something went wrong.