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

Unmarshal instance metadata JSON #40

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tianxiaoliang
Copy link

No description provided.

@tysonstewart
Copy link
Contributor

@tianxiaoliang Thanks for the contribution! I'm trying to find some time to test it out so I can get it merged.

@@ -106,7 +106,13 @@ func parsePort(s string) int {
func (i *InstanceMetadata) UnmarshalJSON(b []byte) error {
i.Raw = b
// TODO(cq) could actually parse Raw here, and in a parallel UnmarshalXML as well.
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the comment to note the only outstanding proposal: unmarshal the XML. You took care of the first proposal here.

@tianxiaoliang
Copy link
Author

Done

@@ -23,23 +23,23 @@ func (a *Application) ParseAllMetadata() error {

// SetMetadataString for a given instance before register
func (ins *Instance) SetMetadataString(key, value string) {
if ins.Metadata.parsed == nil {
ins.Metadata.parsed = map[string]interface{}{}
if ins.Metadata.Parsed == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that we can set entries in this field, "Parsed" doesn't match its use. "Parsed" implies that we only receive these values.

Again, consider renaming it to "Map", "Fields", "Values", or something similar.

@damtur
Copy link
Contributor

damtur commented Sep 27, 2016

@tianxiaoliang Would you like to address @seh comments here. I want this to be merged ;)

Please also make sure that tests are working after the change for JSON.
Unfortunately I'm afraid that those might not work on master. They do for XML.

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.

4 participants