You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/06/05 08:00:35 UTC

[camel-k] branch master updated (2c778a9 -> 0d91d86)

This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git.


    from 2c778a9  Fix #707: sign released artifacts
     new 4d02add  fix: Do not share labels map reference in integration deployment
     new 0d91d86  chore(lint): Fix findings

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pkg/cmd/install.go                   |  4 ++--
 pkg/controller/build/schedule_pod.go |  7 +++----
 pkg/install/common.go                |  7 ++++---
 pkg/trait/deployment.go              | 20 +++++++++++---------
 4 files changed, 20 insertions(+), 18 deletions(-)


[camel-k] 02/02: chore(lint): Fix findings

Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 0d91d866e28bc3b6cd590ac2b0c071bfd1829d8b
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Jun 5 09:47:24 2019 +0200

    chore(lint): Fix findings
---
 pkg/cmd/install.go                   | 4 ++--
 pkg/controller/build/schedule_pod.go | 7 +++----
 pkg/install/common.go                | 7 ++++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/pkg/cmd/install.go b/pkg/cmd/install.go
index e0f502e..1a9a9fe 100644
--- a/pkg/cmd/install.go
+++ b/pkg/cmd/install.go
@@ -298,13 +298,13 @@ func (o *installCmdOptions) validate(_ *cobra.Command, _ []string) error {
 		return nil
 	}
 	for _, context := range o.contexts {
-		err := errorIfContextIsNotAvailable(schema, context, len(o.contexts))
+		err := errorIfContextIsNotAvailable(schema, context)
 		result = multierr.Append(result, err)
 	}
 	return result
 }
 
-func errorIfContextIsNotAvailable(schema *runtime.Scheme, context string, nrContexts int) error {
+func errorIfContextIsNotAvailable(schema *runtime.Scheme, context string) error {
 	for _, resource := range deploy.Resources {
 		resource, err := kubernetes.LoadResourceFromYaml(schema, resource)
 		if err != nil {
diff --git a/pkg/controller/build/schedule_pod.go b/pkg/controller/build/schedule_pod.go
index be34557..212e0f6 100644
--- a/pkg/controller/build/schedule_pod.go
+++ b/pkg/controller/build/schedule_pod.go
@@ -21,6 +21,7 @@ import (
 	"context"
 	"sync"
 
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/platform"
 	"github.com/apache/camel-k/pkg/util/defaults"
 
@@ -32,8 +33,6 @@ import (
 	"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
 
 	"github.com/pkg/errors"
-
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 )
 
 // NewSchedulePodAction creates a new schedule action
@@ -141,8 +140,8 @@ func newBuildPod(build *v1alpha1.Build, operatorImage string) *corev1.Pod {
 			ServiceAccountName: "camel-k-operator",
 			Containers: []corev1.Container{
 				{
-					Name:  "builder",
-					Image: builderImage,
+					Name:            "builder",
+					Image:           builderImage,
 					ImagePullPolicy: "IfNotPresent",
 					Args: []string{
 						"camel-k-builder",
diff --git a/pkg/install/common.go b/pkg/install/common.go
index f8a9fbe..c4cedda 100644
--- a/pkg/install/common.go
+++ b/pkg/install/common.go
@@ -24,19 +24,20 @@ import (
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/client"
 	"github.com/apache/camel-k/pkg/util/kubernetes"
+
 	"k8s.io/apimachinery/pkg/api/errors"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 )
 
 // ResourceCustomizer can be used to inject code that changes the objects before they are created
-type ResourceCustomizer func(object runtime.Object)runtime.Object
+type ResourceCustomizer func(object runtime.Object) runtime.Object
+
 // IdentityResourceCustomizer is a ResourceCustomizer that does nothing
-var IdentityResourceCustomizer = func(object runtime.Object)runtime.Object {
+var IdentityResourceCustomizer = func(object runtime.Object) runtime.Object {
 	return object
 }
 
-
 // Resources installs named resources from the project resource directory
 func Resources(ctx context.Context, c client.Client, namespace string, customizer ResourceCustomizer, names ...string) error {
 	return ResourcesOrCollect(ctx, c, namespace, nil, customizer, names...)


[camel-k] 01/02: fix: Do not share labels map reference in integration deployment

Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 4d02add0846f4009f0bcdbe9268c498d1db325cd
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Jun 5 09:46:17 2019 +0200

    fix: Do not share labels map reference in integration deployment
---
 pkg/trait/deployment.go | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/pkg/trait/deployment.go b/pkg/trait/deployment.go
index a6cc1c4..c27a0b9 100644
--- a/pkg/trait/deployment.go
+++ b/pkg/trait/deployment.go
@@ -123,10 +123,6 @@ func (t *deploymentTrait) getDeploymentFor(e *Environment) *appsv1.Deployment {
 		envvar.SetVar(&environment, envVar)
 	}
 
-	labels := map[string]string{
-		"camel.apache.org/integration": e.Integration.Name,
-	}
-
 	// create a copy to avoid sharing the underlying annotation map
 	annotations := make(map[string]string)
 	if e.Integration.Annotations != nil {
@@ -144,19 +140,25 @@ func (t *deploymentTrait) getDeploymentFor(e *Environment) *appsv1.Deployment {
 			APIVersion: appsv1.SchemeGroupVersion.String(),
 		},
 		ObjectMeta: metav1.ObjectMeta{
-			Name:        e.Integration.Name,
-			Namespace:   e.Integration.Namespace,
-			Labels:      labels,
+			Name:      e.Integration.Name,
+			Namespace: e.Integration.Namespace,
+			Labels: map[string]string{
+				"camel.apache.org/integration": e.Integration.Name,
+			},
 			Annotations: annotations,
 		},
 		Spec: appsv1.DeploymentSpec{
 			Replicas: e.Integration.Spec.Replicas,
 			Selector: &metav1.LabelSelector{
-				MatchLabels: labels,
+				MatchLabels: map[string]string{
+					"camel.apache.org/integration": e.Integration.Name,
+				},
 			},
 			Template: corev1.PodTemplateSpec{
 				ObjectMeta: metav1.ObjectMeta{
-					Labels:      labels,
+					Labels: map[string]string{
+						"camel.apache.org/integration": e.Integration.Name,
+					},
 					Annotations: annotations,
 				},
 				Spec: corev1.PodSpec{