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.
Updated PR - this one also deletes existing *.conf files in cni config directory. These are some thoughts:
This deletes existing *.conf file so it can safely be applied over existing kube-router and it will update the conf format.
Although the kubelet only reads the first config in lexicographic order, there doesn't appear to be any limitation in the cni spec itself against having multiple configs. Therefore, the init container only deletes *.conf files if there was no pre-existing kube-router-installed 10-kuberouter.conflist file. The assumption is the first install is in a prepared environment, but after that all bets are off.
Existing *.conflist or other files are not deleted. If kube-router is deployed into an environment like this the assumption is that the environment is complex and carefully crafted. But, if it gets deployed without that extra care, it may break things but at least it doesn't irretrievably destroy the previous configs.
Perhaps some intelligence could be added where the init/install process parses existing conf/conflist files and reworks/adds itself in seamlessly, but this seems out of scope for a simple deployment config change like this.