-
Notifications
You must be signed in to change notification settings - Fork 334
CNI File watcher and pre applying rules setup #1345
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3c6e110
Initial CNI installer & plugin (#1304)
curtbushko 1e1873f
CNI Helm Charts
curtbushko 77b9849
Initial CNI installer & plugin (#1304)
curtbushko cee83eb
CNI File watcher and pre applying rules setup
curtbushko c9dd4dc
go mod tidy to get linting passing
curtbushko 2a4a042
Add tests to install-cni/binary and cni/main. Address PR comments
curtbushko 2a6759f
Update comment
curtbushko fb0fe1b
fix conflicting pointer.Int64 and pointer.Bool calls
curtbushko 9872a35
remove the annotation that is not used
curtbushko 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,19 +1,42 @@ | ||
| package config | ||
|
|
||
| const ( | ||
| DefaultPluginName = "consul-cni" | ||
| DefaultPluginType = "consul-cni" | ||
| DefaultCNIBinDir = "/opt/cni/bin" | ||
| DefaultCNINetDir = "/etc/cni/net.d" | ||
| DefaultMultus = false | ||
| // defaultKubeconfig is named ZZZ-.. as part of a convention that other CNI plugins use. | ||
| DefaultKubeconfig = "ZZZ-consul-cni-kubeconfig" | ||
| DefaultLogLevel = "info" | ||
| ) | ||
|
|
||
| // CNIConfig is the configuration that both the CNI installer and plugin will use. | ||
| type CNIConfig struct { | ||
| // Name of the plugin | ||
| // Name of the plugin. | ||
| Name string `json:"name" mapstructure:"name"` | ||
| // Type of plugin (consul-cni) | ||
| // Type of plugin (consul-cni). | ||
| Type string `json:"type" mapstructure:"type"` | ||
| // CNIBinDir is the location of the cni config files on the node. Can bet as a cli flag. | ||
| CNIBinDir string `json:"cni_bin_dir" mapstructure:"cni_bin_dir"` | ||
| // CNINetDir is the locaion of the cni plugin on the node. Can be set as a cli flag. | ||
| CNINetDir string `json:"cni_net_dir" mapstructure:"cni_net_dir"` | ||
| // Multus is if the plugin is a multus plugin. Can be set as a cli flag. | ||
| Multus bool `json:"multus" mapstructure:"multus"` | ||
| // Kubeconfig file name. Can be set as a cli flag. | ||
| Kubeconfig string `json:"kubeconfig" mapstructure:"kubeconfig"` | ||
| // LogLevl is the logging level. Can be set as a cli flag. | ||
| LogLevel string `json:"log_level" mapstructure:"log_level"` | ||
| // Multus is if the plugin is a multus plugin. Can be set as a cli flag. | ||
| Multus bool `json:"multus" mapstructure:"multus"` | ||
|
t-eckert marked this conversation as resolved.
|
||
| } | ||
|
|
||
| func NewDefaultCNIConfig() *CNIConfig { | ||
| return &CNIConfig{ | ||
| Name: DefaultPluginName, | ||
| Type: DefaultPluginType, | ||
| CNIBinDir: DefaultCNIBinDir, | ||
| CNINetDir: DefaultCNINetDir, | ||
| Kubeconfig: DefaultKubeconfig, | ||
| LogLevel: DefaultLogLevel, | ||
| Multus: DefaultMultus, | ||
| } | ||
| } | ||
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.