Skip to content

Commit

Permalink
chore(lint): fix findings
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Mar 8, 2019
1 parent 25caff9 commit 2ee78bf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion pkg/trait/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"fmt"
"strconv"


k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down
4 changes: 1 addition & 3 deletions pkg/trait/knative_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ func (t *knativeServiceTrait) getServiceFor(e *Environment) (*serving.Service, e
envvar.SetVal(environment, "AB_JOLOKIA_OFF", True)

if t.ConfigurationType == "volume" {
if err := t.bindToVolumes(e, &svc); err != nil {
return nil, err
}
t.bindToVolumes(e, &svc)
} else {
if err := t.bindToEnvVar(e, &svc); err != nil {
return nil, err
Expand Down
10 changes: 8 additions & 2 deletions pkg/trait/knative_service_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ func (t *knativeServiceTrait) bindToEnvVar(e *Environment, service *serving.Serv
t.L.Errorf(err, "failed to lookup ConfigMap %s", cmName)
}
if cm != nil {
util.ExtractApplicationProperties(cm.Data, func(key string, val string) {
err = util.ExtractApplicationProperties(cm.Data, func(key string, val string) {
properties[key] = val
})
if err != nil {
t.L.Errorf(err, "failed to extract properties from ConfigMap %s", cmName)
}
}
})

Expand All @@ -61,9 +64,12 @@ func (t *knativeServiceTrait) bindToEnvVar(e *Environment, service *serving.Serv
t.L.Errorf(err, "failed to lookup Secret %s", secretName)
}
if cm != nil {
util.ExtractEncodedApplicationProperties(cm.Data, func(key string, val string) {
err = util.ExtractEncodedApplicationProperties(cm.Data, func(key string, val string) {
properties[key] = val
})
if err != nil {
t.L.Errorf(err, "failed to extract properties from Secret %s", secretName)
}
}
})

Expand Down
4 changes: 1 addition & 3 deletions pkg/trait/knative_service_vol.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
serving "github.com/knative/serving/pkg/apis/serving/v1alpha1"
)

func (t *knativeServiceTrait) bindToVolumes(e *Environment, service *serving.Service) error {
func (t *knativeServiceTrait) bindToVolumes(e *Environment, service *serving.Service) {
e.ConfigureVolumesAndMounts(
t.deployer.ContainerImage,
&service.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Volumes,
Expand All @@ -38,6 +38,4 @@ func (t *knativeServiceTrait) bindToVolumes(e *Environment, service *serving.Ser
envvar.SetVal(environment, "CAMEL_K_ROUTES", strings.Join(paths, ","))
envvar.SetVal(environment, "CAMEL_K_CONF", "/etc/camel/conf/application.properties")
envvar.SetVal(environment, "CAMEL_K_CONF_D", "/etc/camel/conf.d")

return nil
}
1 change: 1 addition & 0 deletions pkg/util/kubernetes/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func ResolveIntegrationSources(context context.Context, client client.Client, in
}

// ResolveIntegrationResources --
// nolint: lll
func ResolveIntegrationResources(context context.Context, client client.Client, integration *v1alpha1.Integration, resources *Collection) ([]v1alpha1.ResourceSpec, error) {
if integration == nil {
return nil, nil
Expand Down

0 comments on commit 2ee78bf

Please sign in to comment.