Skip to content

Commit

Permalink
Remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnNiang committed Sep 1, 2021
1 parent af19058 commit f2397fc
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions kubectl-plugin/pipeline/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ func getNestedString(obj map[string]interface{}, fields ...string) string {
return val
}

func getNestMap(obj map[string]interface{}, fields ...string) map[string]interface{} {
val, found, err := unstructured.NestedMap(obj, fields...)
if !found || err != nil {
return nil
}
return val
}

func getNestSlice(obj map[string]interface{}, fields ...string) []interface{} {
val, found, err := unstructured.NestedSlice(obj, fields...)
if !found || err != nil {
Expand Down Expand Up @@ -74,7 +66,7 @@ func Test_parsePipelineRunTpl(t *testing.T) {
assert.Equal(t, "fake_name", obj.GetGenerateName())
assert.Equal(t, "fake_namespace", obj.GetNamespace())
assert.Equal(t, "fake_name", getNestedString(obj.Object, "spec", "pipelineRef", "name"))
assert.Equal(t, 0, len(getNestMap(obj.Object, "spec", "parameters")))
assert.Equal(t, 0, len(getNestSlice(obj.Object, "spec", "parameters")))
},
}, {
name: "With nil parameters",
Expand All @@ -89,7 +81,7 @@ func Test_parsePipelineRunTpl(t *testing.T) {
assert.Equal(t, "fake_name", obj.GetGenerateName())
assert.Equal(t, "fake_namespace", obj.GetNamespace())
assert.Equal(t, "fake_name", getNestedString(obj.Object, "spec", "pipelineRef", "name"))
assert.Equal(t, 0, len(getNestMap(obj.Object, "spec", "parameters")))
assert.Equal(t, 0, len(getNestSlice(obj.Object, "spec", "parameters")))
},
}, {
name: "With empty parameters",
Expand Down

0 comments on commit f2397fc

Please sign in to comment.