-
Notifications
You must be signed in to change notification settings - Fork 0
Use registrar client #11
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
Conversation
74d23a5
to
3d95463
Compare
|
||
r.mu.Lock() | ||
defer r.mu.Unlock() | ||
opts := []client.UpdateNodeOpts{ |
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.
are those updates required?
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 understand what you mean by are updates required
} | ||
|
||
func (r *registrarGateway) GetTime() (time.Time, error) { | ||
// log.Trace().Str("method", "Time").Msg("method called") |
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.
why commenting?
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 is not implemented in the registrar yet
|
||
nodeID, regErr := registrarGateway.GetNodeByTwinID(ctx, twinID) | ||
node, regErr := registrarGateway.GetNodeByTwinID(ctx, twinID) | ||
nodeID = node.NodeID |
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.
how could we retrieve the node ID if there is an error?
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.
if there's an error it would create a node if the error is ErrorNodeNotFound
, if not it will fail
pkg/registrar_light/register.go
Outdated
if regErr != nil { | ||
if strings.Contains(regErr.Error(), registrargw.ErrorRecordNotFound.Error()) { | ||
nodeID, err = registrarGateway.CreateNode(ctx, req) | ||
if strings.Contains(regErr.Error(), client.ErrorNodeNotFround.Error()) { |
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.
cannot we use errors.As?
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.
tried it and it's not working
} | ||
|
||
// if we are on devnet just update we don't need to update the version throught out the registrar | ||
v := "v0.0.0" | ||
v := client.ZosVersion{Version: "v0.0.0", SafeToUpgrade: true} |
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.
why setting version to zero?
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 was already the flow, I just updated how it stored
blocked on threefoldtech/zosbase#16 |
0d23bba
to
442bed7
Compare
c378623
to
345e18c
Compare
345e18c
to
0a0d2a0
Compare
2a428a8
to
212bc90
Compare
212bc90
to
4942d23
Compare
7031a12
to
4725133
Compare
4725133
to
d813867
Compare
Description
update registrar gateway to use the new registrar client
Changes
List of changes this PR includes
Related Issues
Checklist