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
be6551c0
Unverified
Commit
be6551c0
authored
Oct 22, 2019
by
Matthew Fisher
Committed by
GitHub
Oct 22, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6749 from icanhazbroccoli/icanhazbroccoli/revert-6010
Reverted changes introduced in #6010
parents
f573de08
4cddc82c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
43 deletions
+2
-43
install_test.go
cmd/helm/installer/install_test.go
+1
-25
requirements_test.go
pkg/chartutil/requirements_test.go
+0
-5
coleridge.yaml
pkg/chartutil/testdata/coleridge.yaml
+0
-1
values.go
pkg/chartutil/values.go
+1
-5
values_test.go
pkg/chartutil/values_test.go
+0
-7
No files found.
cmd/helm/installer/install_test.go
View file @
be6551c0
...
...
@@ -17,7 +17,6 @@ limitations under the License.
package
installer
// import "k8s.io/helm/cmd/helm/installer"
import
(
"encoding/json"
"os"
"path/filepath"
"reflect"
...
...
@@ -717,32 +716,9 @@ func TestDeployment_WithSetValues(t *testing.T) {
// convert our expected value to match the result type for comparison
ev
:=
tt
.
expect
intType
:=
reflect
.
TypeOf
(
int64
(
0
))
floatType
:=
reflect
.
TypeOf
(
float64
(
0
))
switch
pvt
:=
pv
.
(
type
)
{
case
json
.
Number
:
evv
:=
reflect
.
ValueOf
(
ev
)
evv
=
reflect
.
Indirect
(
evv
)
switch
ev
.
(
type
)
{
case
float32
,
float64
:
evv
=
evv
.
Convert
(
floatType
)
if
fpv
,
err
:=
pv
.
(
json
.
Number
)
.
Float64
();
err
!=
nil
{
t
.
Errorf
(
"Failed to convert json number to float: %s"
,
err
)
}
else
if
fpv
!=
evv
.
Float
()
{
t
.
Errorf
(
"%s: expected float value %q, got %f"
,
tt
.
name
,
tt
.
expect
,
fpv
)
}
case
byte
,
int
,
int32
,
int64
:
evv
=
evv
.
Convert
(
intType
)
if
ipv
,
err
:=
pv
.
(
json
.
Number
)
.
Int64
();
err
!=
nil
{
t
.
Errorf
(
"Failed to convert json number to int: %s"
,
err
)
}
else
if
ipv
!=
evv
.
Int
()
{
t
.
Errorf
(
"%s: expected int value %q, got %d"
,
tt
.
name
,
tt
.
expect
,
ipv
)
}
default
:
t
.
Errorf
(
"Unknown primitive type: %s"
,
reflect
.
TypeOf
(
ev
))
}
case
float64
:
floatType
:=
reflect
.
TypeOf
(
float64
(
0
))
v
:=
reflect
.
ValueOf
(
ev
)
v
=
reflect
.
Indirect
(
v
)
if
!
v
.
Type
()
.
ConvertibleTo
(
floatType
)
{
...
...
pkg/chartutil/requirements_test.go
View file @
be6551c0
...
...
@@ -15,7 +15,6 @@ limitations under the License.
package
chartutil
import
(
"encoding/json"
"os"
"path/filepath"
"sort"
...
...
@@ -312,10 +311,6 @@ func verifyRequirementsImportValues(t *testing.T, c *chart.Chart, v *chart.Confi
}
switch
pv
.
(
type
)
{
case
json
.
Number
:
if
s
:=
pv
.
(
json
.
Number
)
.
String
();
s
!=
vv
{
t
.
Errorf
(
"Failed to match imported number value %v with expected %v"
,
s
,
vv
)
}
case
float64
:
s
:=
strconv
.
FormatFloat
(
pv
.
(
float64
),
'f'
,
-
1
,
64
)
if
s
!=
vv
{
...
...
pkg/chartutil/testdata/coleridge.yaml
View file @
be6551c0
...
...
@@ -10,4 +10,3 @@ water:
water
:
where
:
"
everywhere"
nor
:
"
any
drop
to
drink"
temperature
:
1234567890
pkg/chartutil/values.go
View file @
be6551c0
...
...
@@ -17,7 +17,6 @@ limitations under the License.
package
chartutil
import
(
"encoding/json"
"errors"
"fmt"
"io"
...
...
@@ -133,10 +132,7 @@ func tableLookup(v Values, simple string) (Values, error) {
// ReadValues will parse YAML byte data into a Values.
func
ReadValues
(
data
[]
byte
)
(
vals
Values
,
err
error
)
{
err
=
yaml
.
Unmarshal
(
data
,
&
vals
,
func
(
d
*
json
.
Decoder
)
*
json
.
Decoder
{
d
.
UseNumber
()
return
d
})
err
=
yaml
.
Unmarshal
(
data
,
&
vals
)
if
len
(
vals
)
==
0
{
vals
=
Values
{}
}
...
...
pkg/chartutil/values_test.go
View file @
be6551c0
...
...
@@ -53,7 +53,6 @@ water:
water:
where: "everywhere"
nor: "any drop to drink"
temperature: 1234567890
`
data
,
err
:=
ReadValues
([]
byte
(
doc
))
...
...
@@ -267,12 +266,6 @@ func matchValues(t *testing.T, data map[string]interface{}) {
}
else
if
o
!=
"everywhere"
{
t
.
Errorf
(
"Expected water water everywhere"
)
}
if
o
,
err
:=
ttpl
(
"{{.water.water.temperature}}"
,
data
);
err
!=
nil
{
t
.
Errorf
(
".water.water.temperature: %s"
,
err
)
}
else
if
o
!=
"1234567890"
{
t
.
Errorf
(
"Expected water water temperature: 1234567890, got: %s"
,
o
)
}
}
func
ttpl
(
tpl
string
,
v
map
[
string
]
interface
{})
(
string
,
error
)
{
...
...
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