Skip to content
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

WIP: Teach Purity about instance names #302

Closed

Conversation

Garbett1
Copy link
Contributor

Purity abuses the instance name for the REX Api to make Elan have special cases. Additionally, it doesn't pass through instance names through out.

Still need to re-generate the protos, and ran into some "fun".

@@ -187,6 +190,7 @@ func (c *collector) LoadAllBlobs() error {
for j := 0; j < 16; j++ {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
defer cancel()
ctx = metadata.NewOutgoingContext(ctx, metadata.Pairs("mettle-caller-name", name))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not normally that person, but maybe we should have a constant for mettle-caller-name...

Or possibly a top-level variable for this Pairs instance might be easier?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was considering moving it into the common package and perhaps making it a gRPC interceptor.

Not sure what conventions gRPC has for naming metadata as well, almost went for mettle.tmachine.io/name, but that feels very Java/k8s.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Keys are case insensitive and consist of ASCII letters, digits, and special characters -, _, . and must not start with grpc- (which is reserved for gRPC itself). Binary-valued keys end in -bin while ASCII-valued keys do not.

So you can't have the / at least. Lower kebab case seems normal from what I've seen.

@Garbett1
Copy link
Contributor Author

I think this needed more work to actually get functional, because the REX SDK was problematic to update.

@Garbett1 Garbett1 closed this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants