-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Avoid unnecessary synching of Context and Servers Before this commit, the CLI would always perform a two-way sync of the Contexts of the config-ng.yaml file and the Servers of the config.yaml file, even if there was no reason to sync, i.e., if the Contexts and Servers were already in sync. This sync was being done for every single command of the CLI. This caused a write to the config files for each contexts configured and one more for the current context. With many contexts configured, this unnecessary sync would make the CLI startup noticeably slower. This commit verifies if the sync is required by computing and storing a SHA for the "context" section and one for the "server" section, and checking if the SHAs have changed on each CLI command and if so, only then doing the sync. Note that Tanzu contexts are kept out of the SHA computation since they are not synced. * Write to datastore and config files only if needed The logic to store the last execute CLI would always write to the datastore and to the config files, which should be avoided. This commit first checks if the update is required or not. Signed-off-by: Marc Khouzam <[email protected]>
- Loading branch information
1 parent
e24f5d6
commit 6cbbf31
Showing
2 changed files
with
99 additions
and
2 deletions.
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