-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow passing Type and Uplink in registration requests #60
Conversation
Previously "Type" and "Uplink" in the v2.Registration struct were hardcoded as "unknown". This change allows, and even requires, that the registration request has nomimally valid values for those to fields.
Pull Request Test Coverage Report for Build 12059126093Details
💛 - Coveralls |
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.
Reviewable status: 0 of 1 approvals obtained (waiting on @nkinkade)
handler/handler.go
line 187 at r1 (raw file):
param.Type = req.URL.Query().Get("type") if !isValidType(param.Type) { fmt.Printf("bad machine type")
Prefer log
if necessary. For log messages include more context; here for example the provided type value.
handler/handler.go
line 189 at r1 (raw file):
fmt.Printf("bad machine type") resp.Error = &v2.Error{ Type: "?machine-type=<machine-type>",
This error message references a parameter that is different from the one named in Get()
above. What is the parameter name?
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.
PTAL?
Reviewable status: 0 of 1 approvals obtained (waiting on @stephen-soltesz)
handler/handler.go
line 187 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
Prefer
log
if necessary. For log messages include more context; here for example the provided type value.
Sorry. This statement was actually just a debug line I added while updating the unit tests, and I never meant for it to make it through to the PR. It is removed now.
handler/handler.go
line 189 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
This error message references a parameter that is different from the one named in
Get()
above. What is the parameter name?
Another good catch. I originally has this defined as Param.MachineType
, since "type" is so generic. But after the fact I decided that if Type
was good enough for v2.Registration, than it was good enough in the Param
struct` too, and that having them equal made it easier to understand. I missed modifying this, but it is updated now.
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.
Reviewable status: complete! 1 of 1 approvals obtained
Currently, both
Type
andUplink
in v2.Registration are statically set to "unknown". This change allows (requires) that valid-looking values for those fields be passed in registration commands.We will need to be sure that RNP has updated their configurations before we release this, and also that our own test instances. Alternatively, I could update these changes to make these fields optional. I chose to make them required because it puts autojoined machines at parity with every other machine on the platform, where those fields are always present.
This change is