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

libcni: up-convert a Config to a ConfigList when no other configs are found. #374

Merged
merged 1 commit into from
Feb 27, 2017

Conversation

squeed
Copy link
Member

@squeed squeed commented Feb 17, 2017

No description provided.

@squeed squeed changed the title libcni: up-convert a Config to a ConfigList when no other configs are… libcni: up-convert a Config to a ConfigList when no other configs are found. Feb 17, 2017
@dcbw
Copy link
Member

dcbw commented Feb 23, 2017

LGTM

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

Some stylistic comments; apart from that lgtm

libcni/conf.go Outdated

rawConfigList := make(map[string]interface{})
rawConfigList["name"] = original.Network.Name
rawConfigList["cniVersion"] = original.Network.CNIVersion
Copy link
Contributor

Choose a reason for hiding this comment

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

how about

rawConfigList := map[string]interface{}{
  "name"      : original.Network.Name,
  "cniVersion": original.Network.CNIVersion,
  "plugins"   : []interface{}{rawConfig},
}

libcni/conf.go Outdated
// no files at all
case len(files) == 0 && err == NoConfigsFoundError:
return nil, err
// some files found
Copy link
Contributor

Choose a reason for hiding this comment

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

could be clearer - "some files found by ConfFiles, but not one matching the required name" ?

libcni/conf.go Outdated
// golang default values.

rawConfig := make(map[string]interface{})
err := json.Unmarshal(original.Bytes, &rawConfig)
Copy link
Contributor

Choose a reason for hiding this comment

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

could merge with next line

@tomdee
Copy link
Member

tomdee commented Feb 24, 2017

LGTM

@squeed squeed force-pushed the config-list-upconvert branch from 2719207 to 6e6ad53 Compare February 24, 2017 18:44
@squeed
Copy link
Member Author

squeed commented Feb 24, 2017

@bboreham thanks for the feedback, updated.

@dcbw dcbw merged commit d6d012b into containernetworking:master Feb 27, 2017
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