This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 228
Enable multiple non-IP interface to be connected via tc redirect #836
Merged
Merged
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
0d7046e
First crack at multinet implementation
networkop 0b3dfdb
fix the dhcp server bug
networkop 9acef4f
Merge branch 'weaveworks:main' into multinet
networkop 56ca546
Added wait for X number of interfaces to be connected
networkop 52776a6
Merge branch 'weaveworks:main' into multinet
networkop e3baa91
Merge branch 'multinet' of github.com:networkop/ignite into multinet
networkop 17765be
Fixed multiple bugs
networkop 6e19436
Ensure maxIntfs is at least 1
networkop 39d395e
Fixed formatting
networkop 9a31fb9
Forgot to assign envVars
networkop 20b4aa8
Updated docs
networkop 35dc891
More updated docs
networkop e8bd47c
More docs updates
networkop b8ef5d3
Not using env vars anymore
networkop 47c9140
Re-introducing env var support
networkop 6f1f14a
Reverting the order to error checks
networkop 90eaa58
Added multinet tests
networkop 1020f90
Fixing dox
networkop 053def5
Refactored StartVM with async spawn channel
networkop eb8997f
Refactored ignite-spawn's network setup
networkop 051ad2b
Fixed the CNI plugin bug
networkop 1c70e78
Tested with containerlab
networkop 9957b70
Merging suggested changes
networkop 3161ef4
Alternative e2e test
networkop f8d361d
Removed --wait flag and fixed up multinet tests
networkop 668b5fe
Removing waitForSSH from exec
networkop 71c801c
Removing leftover comment
networkop abddda2
Adding waitforSSH back
networkop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -11,6 +11,7 @@ import ( | |||||||||||||
"github.com/weaveworks/ignite/pkg/apis/ignite/validation" | ||||||||||||||
meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" | ||||||||||||||
"github.com/weaveworks/ignite/pkg/config" | ||||||||||||||
"github.com/weaveworks/ignite/pkg/constants" | ||||||||||||||
"github.com/weaveworks/ignite/pkg/dmlegacy" | ||||||||||||||
"github.com/weaveworks/ignite/pkg/metadata" | ||||||||||||||
"github.com/weaveworks/ignite/pkg/operations" | ||||||||||||||
|
@@ -39,6 +40,7 @@ type CreateFlags struct { | |||||||||||||
ConfigFile string | ||||||||||||||
VM *api.VM | ||||||||||||||
Labels []string | ||||||||||||||
EnvVars string | ||||||||||||||
RequireName bool | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
|
@@ -95,6 +97,9 @@ func (cf *CreateFlags) NewCreateOptions(args []string, fs *flag.FlagSet) (*Creat | |||||||||||||
return nil, err | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
// Save env variables | ||||||||||||||
baseVM.SetAnnotation(constants.IGNITE_ENV_VAR_ANNOTATION, cf.EnvVars) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to provide a way to set this ignite/pkg/apis/ignite/types.go Lines 261 to 266 in 999ad7c
cf flag and individual VM configuration.Since this is set as annotation, the baseVM should have the annotation inherited from the ignite configuration. Annotation in VM configuration should override/append the baseVM configuration. The VM create flag value should append/override everything before. |
||||||||||||||
|
||||||||||||||
// If --require-name is true, VM name must be provided. | ||||||||||||||
if cf.RequireName && len(baseVM.Name) == 0 { | ||||||||||||||
return nil, fmt.Errorf("must set VM name, flag --require-name set") | ||||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ func Start(so *StartOptions, fs *flag.FlagSet) error { | |
return err | ||
} | ||
|
||
if err := operations.StartVM(so.vm, so.Debug); err != nil { | ||
if err := operations.StartVM(so.vm, so.Debug, true); err != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe before setting true here, the VM configuration/annotation needs to be checked? |
||
return err | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since this is used just once, above, maybe
os.Environ()
should be called in this function itself for now. Keeping true to the meaning of the function 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.
IMO using map of config key=values without mutating the ignite-spawn Environment is better, but this is conflating a lot of config ideas. (flags producing ENV vs. flags overriding ENV)
In general though, is this the proper strategy for config?
Since we already have the information in the VM object, ignite-spawn has access to it and it can read the value from it directly.
That will get of all of the flag-passing and parsing code within ignite & ignite-spawn.
nit:
The names of the variables/annotations in this code should not reference any idea of ENV.
We should call it what it is with a proper domain.
There should be an explicit key for each thing you want.