Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Extract store metadata sent by Go plugins #2140

Merged

Conversation

xtreme-vikram-yadav
Copy link
Contributor

Signed-off-by: Vikram Yadav [email protected]

What this PR does / why we need it: It allows octant to extract out contextual data sent by the Go plugins. This data is intended to be used by object stores.

Related PR: #2099

// Second value is ignored as metadata is always set by grpc.
md, _ := metadata.FromIncomingContext(ctx)
for k, v := range md {
if strings.HasPrefix(k, "x-octant-") {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something up for discussion. grpc metadata does not allow strings to be wrapped by type and strictly accept string. This is the convention i used here to avoid octant from loading header like content-type, user-agent into the context which are subject to change in the future.

@xtreme-vikram-yadav xtreme-vikram-yadav force-pushed the go-plugins-context branch 2 times, most recently from 7e956ea to 57ce9d0 Compare March 11, 2021 20:25
Copy link
Contributor

@wwitzel3 wwitzel3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

Could you add a note about somewhere in https://github.com/vmware-tanzu/octant/blob/master/web/src/stories/docs/plugins/GoPluginsIntro.story.mdx .. like a "Other" section or something or .. "Custom Runtimes"

@wwitzel3 wwitzel3 merged commit 3913c2f into vmware-archive:master Mar 16, 2021
@xtreme-vikram-yadav xtreme-vikram-yadav mentioned this pull request Apr 21, 2021
6 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugins can enrich calls to custom object stores with arbitrary metadata
2 participants