Skip to content

Commit

Permalink
Make sure repo override in envvar makes it into config (#15782)
Browse files Browse the repository at this point in the history
* Make sure repo override in envvar makes it into config

* Explain what happens with the "here" flag
  • Loading branch information
iliakur authored Sep 7, 2023
1 parent 2867af8 commit 3567074
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ddev/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

* Add color output to tests in CI ([#15774](https://github.com/DataDog/integrations-core/pull/15774))

***Fixed***:

* Make sure repo override in envvar makes it into config ([#15782](https://github.com/DataDog/integrations-core/pull/15782))

## 5.0.0 / 2023-09-06

***Removed***:
Expand Down
9 changes: 7 additions & 2 deletions ddev/src/ddev/cli/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,13 @@ def initialize_old_cli(self):
self.__config['color'] = not self.console.no_color
self.__config['dd_api_key'] = self.config.orgs.get('default', {}).get('api_key', '')
self.__config['dd_app_key'] = self.config.orgs.get('default', {}).get('app_key', '')

kwargs = {'here' if self.repo.name == 'local' else self.repo.name: True}
# Make sure that envvar overrides of repo make it into config.
self.__config['repo'] = self.repo.name
# Transfer the -x/--here flag to the old CLI.
# In the new CLI that flag turns into a repo named "local" but the old CLI expects a bool kwarg "here".
kwargs = {}
if self.repo.name == 'local':
kwargs['here'] = True
initialize_root(self.__config, **kwargs)

def copy(self):
Expand Down

0 comments on commit 3567074

Please sign in to comment.