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

Ensure global config is valid before creating network #1070

Merged
merged 1 commit into from
Nov 17, 2017
Merged

Ensure global config is valid before creating network #1070

merged 1 commit into from
Nov 17, 2017

Conversation

tiewei
Copy link
Contributor

@tiewei tiewei commented Nov 16, 2017

When global config (espeically fwd mode) is not set, we shouldn't
allow creating network. The network created at that moment is may
not having enough data to proceed.

Signed-off-by: Wei Tie wtie@cisco.com

@tiewei
Copy link
Contributor Author

tiewei commented Nov 16, 2017

build PR

@tiewei
Copy link
Contributor Author

tiewei commented Nov 16, 2017

build PR

2 similar comments
@tiewei
Copy link
Contributor Author

tiewei commented Nov 16, 2017

build PR

@tiewei
Copy link
Contributor Author

tiewei commented Nov 16, 2017

build PR

@tiewei
Copy link
Contributor Author

tiewei commented Nov 17, 2017

build PR

1 similar comment
@tiewei
Copy link
Contributor Author

tiewei commented Nov 17, 2017

build PR

Copy link
Contributor

@unclejack unclejack left a comment

Choose a reason for hiding this comment

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

LGTM

@unclejack
Copy link
Contributor

@g1rana @rchirakk @srampal: Can one of you take a look as well, please?


func validateGlobalConfig(netmode string) error {
globalConfig := contivModel.FindGlobal("global")
if globalConfig.FwdMode == "" {
Copy link
Contributor

@rchirakk rchirakk Nov 17, 2017

Choose a reason for hiding this comment

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

globalConfig != nil check ?

Copy link
Contributor Author

@tiewei tiewei Nov 17, 2017

Choose a reason for hiding this comment

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

i don't think globalConfig would be nil once the netmaster started, although i can add the check

When global config (espeically fwd mode) is not set, we shouldn't
allow creating network. The network created at that moment is may
not having enough data to proceed.
Also ensure global settings are set before any network creating in
objapi_test

Signed-off-by: Wei Tie <wtie@cisco.com>
@tiewei
Copy link
Contributor Author

tiewei commented Nov 17, 2017

squashed

@tiewei
Copy link
Contributor Author

tiewei commented Nov 17, 2017

build PR

@kahou82
Copy link
Member

kahou82 commented Nov 17, 2017

👍

@kahou82 kahou82 merged commit 4ec7ee2 into contiv:master Nov 17, 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.

None yet

5 participants