This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 9e8b438427c7ae4c25585934c5d9e6569a67e94f Author: Nicola Ferraro <ni.ferr...@gmail.com> AuthorDate: Thu Jun 4 00:00:04 2020 +0200 chore(lint): fix linting --- pkg/trait/prometheus.go | 2 +- pkg/util/flows/io.go | 3 +++ pkg/util/flows/io_test.go | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/trait/prometheus.go b/pkg/trait/prometheus.go index 9beeb2c..47bcc6a 100644 --- a/pkg/trait/prometheus.go +++ b/pkg/trait/prometheus.go @@ -146,7 +146,7 @@ func (t *prometheusTrait) Apply(e *Environment) (err error) { service = getServiceFor(e) // Override the service name if none exists. // This is required for Knative Serving, that checks no standard eponymous service exist - service.Name = service.Name + "-prometheus" + service.Name += "-prometheus" e.Resources.Add(service) } } else { diff --git a/pkg/util/flows/io.go b/pkg/util/flows/io.go index dc85959..9c3e13e 100644 --- a/pkg/util/flows/io.go +++ b/pkg/util/flows/io.go @@ -43,6 +43,9 @@ func Unmarshal(reader io.Reader) ([]v1.Flow, error) { // Using the Kubernetes decoder to turn them into JSON before unmarshal. // This avoids having map[interface{}]interface{} objects which are not JSON compatible. jsonData, err := yaml.ToJSON(buffered) + if err != nil { + return nil, err + } if err = json.Unmarshal(jsonData, &flows); err != nil { return nil, err } diff --git a/pkg/util/flows/io_test.go b/pkg/util/flows/io_test.go index 7517a94..cfaf884 100644 --- a/pkg/util/flows/io_test.go +++ b/pkg/util/flows/io_test.go @@ -19,8 +19,9 @@ package flows import ( "bytes" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestReadWriteYaml(t *testing.T) {