-
Notifications
You must be signed in to change notification settings - Fork 33
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
add subscription http endpoints #23
Conversation
5605e26
to
c6c33cf
Compare
3d452c5
to
603f27e
Compare
@kdeng3849 tagging you on here for visibility. I've had to make quite a few changes in order to make hegel backwards compatible with osie/osie preinstall. Issues were primarily with metadata instance, and storage attributes. |
e101816
to
00eacac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit message is actually missing the most important part, that the suffix is very important to tools we run that uses this data, so needs to stay (sgdisk)
grpc_server.go
Outdated
defer func() { | ||
s.subLock.Lock() | ||
defer s.subLock.Unlock() | ||
if cSub, ok := s.subscriptions[id]; ok && cSub.updateChan == sub.updateChan { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need the ok
check I think since for the ==
to be true then ok
will also be true. If ok is false, there's no way cSub.updateChan == sub.updateChan
because cSub.updateChan will be nil and sub.updateChan
is never nil at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also deserves some sort of comment that this is a guard against deleting a sub that has already been deleted because of a reconnection attempt or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cSub
could be null
if the id doesn't already exist. But will add a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, but sub
isn't null so they don't ==
so you wont delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on a normal disconnect, cSub and sub could be equal. As another connection would not have come in and overwrite the s.subscriptions[id]
upgrade pkg/env Signed-off-by: Mike Mason <[email protected]>
85f7cf2
to
0acef54
Compare
@mikemrm ^ |
Sorry, missed that. I've added more details about the sgdisk in the comment. |
Signed-off-by: Mike Mason <[email protected]>
Signed-off-by: Mike Mason <[email protected]>
sgdisk is the tool used in osie to build partitions. sgdisk supports multiple methods to define the size of those partitions and therefore this value should not be modified. Signed-off-by: Mike Mason <[email protected]>
Signed-off-by: Mike Mason <[email protected]>
Signed-off-by: Mike Mason <[email protected]>
Description
Adds http endpoints to list or get subscribers. This allows for tooling to detect whether a server is currently connected to hegel to determine how it should proceed.
Example Output