Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
e3e1116e
Commit
e3e1116e
authored
Oct 03, 2017
by
Matthew Fisher
Committed by
GitHub
Oct 03, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2857 from llsheldon/fix-dependency-alias
fix(helm):Fix dependency aliaes not working
parents
3799c477
0440b54b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
requirements.go
pkg/chartutil/requirements.go
+3
-2
requirements_test.go
pkg/chartutil/requirements_test.go
+14
-0
No files found.
pkg/chartutil/requirements.go
View file @
e3e1116e
...
...
@@ -23,6 +23,7 @@ import (
"github.com/ghodss/yaml"
"k8s.io/helm/pkg/proto/hapi/chart"
"k8s.io/helm/pkg/version"
)
const
(
...
...
@@ -230,7 +231,7 @@ func getAliasDependency(charts []*chart.Chart, aliasChart *Dependency) *chart.Ch
if
existingChart
.
Metadata
.
Name
!=
aliasChart
.
Name
{
continue
}
if
existingChart
.
Metadata
.
Version
!=
aliasChart
.
Version
{
if
!
version
.
IsCompatibleRange
(
aliasChart
.
Version
,
existingChart
.
Metadata
.
Version
)
{
continue
}
chartFound
=
*
existingChart
...
...
@@ -266,7 +267,7 @@ func ProcessRequirementsEnabled(c *chart.Chart, v *chart.Config) error {
for
_
,
existingDependency
:=
range
c
.
Dependencies
{
var
dependencyFound
bool
for
_
,
req
:=
range
reqs
.
Dependencies
{
if
existingDependency
.
Metadata
.
Name
==
req
.
Name
&&
existingDependency
.
Metadata
.
Version
==
req
.
Version
{
if
existingDependency
.
Metadata
.
Name
==
req
.
Name
&&
version
.
IsCompatibleRange
(
req
.
Version
,
existingDependency
.
Metadata
.
Version
)
{
dependencyFound
=
true
break
}
...
...
pkg/chartutil/requirements_test.go
View file @
e3e1116e
...
...
@@ -21,6 +21,7 @@ import (
"strconv"
"k8s.io/helm/pkg/proto/hapi/chart"
"k8s.io/helm/pkg/version"
)
func
TestLoadRequirements
(
t
*
testing
.
T
)
{
...
...
@@ -347,11 +348,24 @@ func TestGetAliasDependency(t *testing.T) {
t
.
Fatalf
(
"Dependency chart name should be %s but got %s"
,
req
.
Dependencies
[
0
]
.
Name
,
aliasChart
.
Metadata
.
Name
)
}
if
req
.
Dependencies
[
0
]
.
Version
!=
""
{
if
!
version
.
IsCompatibleRange
(
req
.
Dependencies
[
0
]
.
Version
,
aliasChart
.
Metadata
.
Version
)
{
t
.
Fatalf
(
"Dependency chart version is not in the compatible range"
)
}
}
// Failure case
req
.
Dependencies
[
0
]
.
Name
=
"something-else"
if
aliasChart
:=
getAliasDependency
(
c
.
Dependencies
,
req
.
Dependencies
[
0
]);
aliasChart
!=
nil
{
t
.
Fatalf
(
"expected no chart but got %s"
,
aliasChart
.
Metadata
.
Name
)
}
req
.
Dependencies
[
0
]
.
Version
=
"something else which is not in the compatible range"
if
version
.
IsCompatibleRange
(
req
.
Dependencies
[
0
]
.
Version
,
aliasChart
.
Metadata
.
Version
)
{
t
.
Fatalf
(
"Dependency chart version which is not in the compatible range should cause a failure other than a success "
)
}
}
func
TestDependentChartAliases
(
t
*
testing
.
T
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment