Skip to content

Commit

Permalink
Merge pull request #45 from aslafy-z/fix/dependency-update
Browse files Browse the repository at this point in the history
Reintroduce Helm dependency update before chart install
  • Loading branch information
Andrew Suderman authored Jan 10, 2019
2 parents 47e47f2 + d1e2e0c commit c23a4d0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.11.0]

### Added
- Ensure chart dependencies are up to date with `helm dependency update` before installing it

## [0.10.3]

### Fixed
Expand Down
7 changes: 2 additions & 5 deletions reckoner/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def update_dependencies(self):
logging.debug("Updating chart dependencies: {}".format(self.chart_path))
if os.path.exists(self.chart_path):
try:
# TODO This is actually broken - not implemented (even before refactor)
r = self.helm.dependency_update(self.chart_path)
except ReckonerCommandException, e:
logging.warn("Unable to update chart dependencies: {}".format(e.stderr))
Expand Down Expand Up @@ -196,11 +195,9 @@ def install(self, namespace=None, context=None):
# TODO: Improve error handling of a repository installation
self.repository.install(self.name, self.version)
self.chart_path = self.repository.chart_path
# Update the helm dependencies

if self.repository.git is None:
# TODO this is broken
self.update_dependencies()
# Update the helm dependencies
self.update_dependencies()

# Build the args for the chart installation
# And add any extra arguments
Expand Down
3 changes: 2 additions & 1 deletion reckoner/helm/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def rollback(self, release):
)

def dependency_update(self, chart_path):
raise NotImplementedError('Sorry this feature has not yet been implemented.')
"""Function to update chart dependencies"""
return self.execute('dependency', ['update', chart_path], filter_non_global_flags=True)

def repo_update(self):
"""Function to update all the repositories"""
Expand Down
4 changes: 2 additions & 2 deletions reckoner/helm/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def test_upgrade(self):
assert without_install.command.command == 'install'

def test_dependency_update(self):
with self.assertRaises(NotImplementedError):
HelmClient(provider=self.dummy_provider).dependency_update('')
HelmClient(provider=self.dummy_provider).dependency_update('chart_path')
self.dummy_provider.execute.assert_called_once

def test_repo_update(self):
HelmClient(provider=self.dummy_provider).repo_update()
Expand Down
2 changes: 1 addition & 1 deletion reckoner/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = '0.10.3'
__version__ = '0.11.0'
__author__ = 'ReactiveOps, Inc.'

0 comments on commit c23a4d0

Please sign in to comment.