Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Refresh ~/.finch/confg.json based on finch.yaml
Suppose we have configured the `creds_helpers` in `~/.finch/finch.yaml` as follows, and subsequently initialized a VM (`finch vm init`). ``` cpus: 6 creds_helpers: - ecr-login memory: 8GiB vmType: vz rosetta: true ``` As a result, `~/.finch/config.json` is created, and it contains the following: ``` {"credsStore":"ecr-login"} ``` This allows us to utilize the Amazon ECR Docker Credential Helper within Finch. Subsequently, suppose we stop and remove the VM (`finch vm stop` && `finch vm remove`), and then remove the `creds_helpers` configuration from `finch.yaml`. We then configure the `finch.yaml` file as follows: ``` cpus: 6 memory: 8GiB vmType: vz rosetta: true ``` As a result, when we reinitialize the VM (`finch vm init`), the expected behavior is that it will no longer use the Amazon ECR Docker Credential Helper. However, when initializing the VM, despite the absence of `creds_helpers` configuration in `finch.yaml`, the `"credsStore": "ecr-login"` remains in `config.json`, allowing the continued use of the Amazon ECR Docker Credential Helper. This behavior has been reported in the following issue: - runfinch#480 Furthermore, this issue occurs when we stop the VM (`finch vm stop`), modify `finch.yaml`, and subsequently start the VM (`finch vm start`). Consequently, we will modify the behavior to update `config.json` in accordance with the `creds_helpers` configuration in `finch.yaml` when initiating or starting the VM. Note that in this pull request, the commits are divided as follows: - Implement the logic to update `config.json` according to `finch.yaml` and change the function name (loadFinchConfig) in the config package - Modify to call the logic to update `config.json` according to `finch.yaml` on the VM side - Add unit tests for the credhelper package and modify unit tests for the config package - Modify and add Behavior-Driven Development (BDD) Tests using Ginkgo on the VM side - Add e2e tests On the other hand, in this commit, the logic to update `config.json` according to `finch.yaml` is implemented and the function name (loadFinchConfig) is changed in the config package. Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
- Loading branch information