fix: fixed delete by resync failure of init file data by using agentctl #1782
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.
When using init file for importing configuration data by VPP-Agent start and then you try to delete them by resync with empty configuration (using agentctl) then failure happens (this is not the case for using agentctl config delete). The root cause of this is different data source of init file data and data that can agentctl work with. The data source behaves for resyncs similar to linux namespaces, you can't clean data from different data source/namespace (agentctl works with 'grpc' data source data and init file data are 'datasync'-data-source data).
The fix provided by this PR enables the user to configure the init file data to have different data source (i.e.'grpc' to be compatible with agentctl resync). However, due to aggregating of data from multiple data sources (aggregator functionality), the data source will be changes also for data from other sources (etcd, redis,...). That means that this fix is only for certain scenarios when it is used only init file and no etcd, redis,... .
Proper handling of all possible combinations (init file/init file + etcd/init file + redis/...) to achieve functionality of agentctl's resync ('agentctl update --replace') is out of scope of this fix. It would probably require to do multiple resync at VPP-Agent start (multiple data inputs can have different data source labels -> for each one must be done resync) and handle all corner cases.