You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by GitBox <gi...@apache.org> on 2018/09/19 13:54:21 UTC

[GitHub] nicolaferraro closed pull request #103: Fix golint findings, remove unused code

nicolaferraro closed pull request #103: Fix golint findings, remove unused code
URL: https://github.com/apache/camel-k/pull/103
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pkg/apis/camel/v1alpha1/register.go b/pkg/apis/camel/v1alpha1/register.go
index 52af408..460dd4c 100644
--- a/pkg/apis/camel/v1alpha1/register.go
+++ b/pkg/apis/camel/v1alpha1/register.go
@@ -31,14 +31,15 @@ const (
 )
 
 var (
-	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
-	AddToScheme   = SchemeBuilder.AddToScheme
 	// SchemeGroupVersion is the group version used to register these objects.
 	SchemeGroupVersion = schema.GroupVersion{Group: groupName, Version: version}
 )
 
 func init() {
-	sdkK8sutil.AddToSDKScheme(AddToScheme)
+	schemeBuilder := runtime.NewSchemeBuilder(addKnownTypes)
+	addToScheme := schemeBuilder.AddToScheme
+
+	sdkK8sutil.AddToSDKScheme(addToScheme)
 }
 
 // addKnownTypes adds the set of types defined in this package to the supplied scheme.
diff --git a/pkg/build/local/local_builder.go b/pkg/build/local/local_builder.go
index 0274c12..c341274 100644
--- a/pkg/build/local/local_builder.go
+++ b/pkg/build/local/local_builder.go
@@ -111,11 +111,11 @@ func (b *localBuilder) buildCycle(ctx context.Context) {
 }
 
 func (b *localBuilder) execute(source build.Request) (string, error) {
-	project, err := generateProjectDefinition(source)
+	integration, err := generateIntegration(source)
 	if err != nil {
 		return "", err
 	}
-	tarFileName, err := maven.Build(project)
+	tarFileName, err := maven.Build(integration)
 	if err != nil {
 		return "", err
 	}
@@ -254,24 +254,24 @@ func (b *localBuilder) publish(tarFile string, source build.Request) (string, er
 	return is.Status.DockerImageRepository + ":" + source.Identifier.Qualifier, nil
 }
 
-func generateProjectDefinition(source build.Request) (maven.ProjectDefinition, error) {
-	project := maven.ProjectDefinition{
+func generateIntegration(source build.Request) (maven.Integration, error) {
+	integration := maven.Integration{
 		Project: maven.Project{
 			XMLName:           xml.Name{Local: "project"},
-			XmlNs:             "http://maven.apache.org/POM/4.0.0",
-			XmlNsXsi:          "http://www.w3.org/2001/XMLSchema-instance",
+			XMLNs:             "http://maven.apache.org/POM/4.0.0",
+			XMLNsXsi:          "http://www.w3.org/2001/XMLSchema-instance",
 			XsiSchemaLocation: "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd",
 			ModelVersion:      "4.0.0",
-			GroupId:           "org.apache.camel.k.integration",
-			ArtifactId:        "camel-k-integration",
+			GroupID:           "org.apache.camel.k.integration",
+			ArtifactID:        "camel-k-integration",
 			Version:           version.Version,
 			DependencyManagement: maven.DependencyManagement{
 				Dependencies: maven.Dependencies{
 					Dependencies: []maven.Dependency{
 						{
 							//TODO: camel version should be retrieved from an external source or provided as static version
-							GroupId:    "org.apache.camel",
-							ArtifactId: "camel-bom",
+							GroupID:    "org.apache.camel",
+							ArtifactID: "camel-bom",
 							Version:    "2.22.1",
 							Type:       "pom",
 							Scope:      "import",
@@ -291,7 +291,7 @@ func generateProjectDefinition(source build.Request) (maven.ProjectDefinition, e
 	// set-up dependencies
 	//
 
-	deps := &project.Project.Dependencies
+	deps := &integration.Project.Dependencies
 	deps.AddGAV("org.apache.camel.k", "camel-k-runtime-jvm", version.Version)
 
 	for _, d := range source.Dependencies {
@@ -309,9 +309,9 @@ func generateProjectDefinition(source build.Request) (maven.ProjectDefinition, e
 
 			deps.AddEncodedGAV(gav)
 		} else {
-			return maven.ProjectDefinition{}, fmt.Errorf("unknown dependency type: %s", d)
+			return maven.Integration{}, fmt.Errorf("unknown dependency type: %s", d)
 		}
 	}
 
-	return project, nil
+	return integration, nil
 }
diff --git a/pkg/build/local/local_builder_test.go b/pkg/build/local/local_builder_test.go
index 790c124..c5fd33d 100644
--- a/pkg/build/local/local_builder_test.go
+++ b/pkg/build/local/local_builder_test.go
@@ -43,16 +43,16 @@ func TestProjectGeneration(t *testing.T) {
 		},
 	}
 
-	prj, err := generateProjectDefinition(source)
+	prj, err := generateIntegration(source)
 	assert.Nil(t, err)
 	assert.NotNil(t, prj)
 	assert.Equal(t, len(prj.Project.Dependencies.Dependencies), 5)
-	assert.Equal(t, prj.Project.Dependencies.Dependencies[0].ArtifactId, "camel-k-runtime-jvm")
-	assert.Equal(t, prj.Project.Dependencies.Dependencies[1].ArtifactId, "camel-mail")
-	assert.Equal(t, prj.Project.Dependencies.Dependencies[2].ArtifactId, "camel-netty4")
-	assert.Equal(t, prj.Project.Dependencies.Dependencies[3].ArtifactId, "camel-servicenow")
+	assert.Equal(t, prj.Project.Dependencies.Dependencies[0].ArtifactID, "camel-k-runtime-jvm")
+	assert.Equal(t, prj.Project.Dependencies.Dependencies[1].ArtifactID, "camel-mail")
+	assert.Equal(t, prj.Project.Dependencies.Dependencies[2].ArtifactID, "camel-netty4")
+	assert.Equal(t, prj.Project.Dependencies.Dependencies[3].ArtifactID, "camel-servicenow")
 	assert.Equal(t, prj.Project.Dependencies.Dependencies[3].Version, "2.21.1")
-	assert.Equal(t, prj.Project.Dependencies.Dependencies[4].ArtifactId, "camel-salesforce")
+	assert.Equal(t, prj.Project.Dependencies.Dependencies[4].ArtifactID, "camel-salesforce")
 	assert.Equal(t, prj.Project.Dependencies.Dependencies[4].Version, "")
 }
 
@@ -75,6 +75,6 @@ func TestProjectGenerationWithFailure(t *testing.T) {
 		},
 	}
 
-	_, err := generateProjectDefinition(source)
+	_, err := generateIntegration(source)
 	assert.NotNil(t, err)
 }
diff --git a/pkg/build/local/scheme.go b/pkg/build/local/scheme.go
deleted file mode 100644
index 465c290..0000000
--- a/pkg/build/local/scheme.go
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-Copyright 2018 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package local
-
-import (
-	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	"k8s.io/apimachinery/pkg/runtime"
-	"k8s.io/apimachinery/pkg/runtime/schema"
-	"k8s.io/apimachinery/pkg/runtime/serializer"
-	"k8s.io/apimachinery/pkg/runtime/serializer/json"
-	"k8s.io/apimachinery/pkg/runtime/serializer/versioning"
-)
-
-var watchScheme = runtime.NewScheme()
-var basicScheme = runtime.NewScheme()
-var deleteScheme = runtime.NewScheme()
-var parameterScheme = runtime.NewScheme()
-var deleteOptionsCodec = serializer.NewCodecFactory(deleteScheme)
-var dynamicParameterCodec = runtime.NewParameterCodec(parameterScheme)
-
-var versionV1 = schema.GroupVersion{Version: "v1"}
-
-func init() {
-	metav1.AddToGroupVersion(watchScheme, versionV1)
-	metav1.AddToGroupVersion(basicScheme, versionV1)
-	metav1.AddToGroupVersion(parameterScheme, versionV1)
-	metav1.AddToGroupVersion(deleteScheme, versionV1)
-}
-
-var watchJsonSerializerInfo = runtime.SerializerInfo{
-	MediaType:        "application/json",
-	EncodesAsText:    true,
-	Serializer:       json.NewSerializer(json.DefaultMetaFactory, watchScheme, watchScheme, false),
-	PrettySerializer: json.NewSerializer(json.DefaultMetaFactory, watchScheme, watchScheme, true),
-	StreamSerializer: &runtime.StreamSerializerInfo{
-		EncodesAsText: true,
-		Serializer:    json.NewSerializer(json.DefaultMetaFactory, watchScheme, watchScheme, false),
-		Framer:        json.Framer,
-	},
-}
-
-// watchNegotiatedSerializer is used to read the wrapper of the watch stream
-type watchNegotiatedSerializer struct{}
-
-var watchNegotiatedSerializerInstance = watchNegotiatedSerializer{}
-
-func (s watchNegotiatedSerializer) SupportedMediaTypes() []runtime.SerializerInfo {
-	return []runtime.SerializerInfo{watchJsonSerializerInfo}
-}
-
-func (s watchNegotiatedSerializer) EncoderForVersion(encoder runtime.Encoder, gv runtime.GroupVersioner) runtime.Encoder {
-	return versioning.NewDefaultingCodecForScheme(watchScheme, encoder, nil, gv, nil)
-}
-
-func (s watchNegotiatedSerializer) DecoderToVersion(decoder runtime.Decoder, gv runtime.GroupVersioner) runtime.Decoder {
-	return versioning.NewDefaultingCodecForScheme(watchScheme, nil, decoder, nil, gv)
-}
-
-// basicNegotiatedSerializer is used to handle discovery and error handling serialization
-type basicNegotiatedSerializer struct{}
-
-func (s basicNegotiatedSerializer) SupportedMediaTypes() []runtime.SerializerInfo {
-	return []runtime.SerializerInfo{
-		{
-			MediaType:        "application/json",
-			EncodesAsText:    true,
-			Serializer:       json.NewSerializer(json.DefaultMetaFactory, basicScheme, basicScheme, false),
-			PrettySerializer: json.NewSerializer(json.DefaultMetaFactory, basicScheme, basicScheme, true),
-			StreamSerializer: &runtime.StreamSerializerInfo{
-				EncodesAsText: true,
-				Serializer:    json.NewSerializer(json.DefaultMetaFactory, basicScheme, basicScheme, false),
-				Framer:        json.Framer,
-			},
-		},
-	}
-}
-
-func (s basicNegotiatedSerializer) EncoderForVersion(encoder runtime.Encoder, gv runtime.GroupVersioner) runtime.Encoder {
-	return versioning.NewDefaultingCodecForScheme(watchScheme, encoder, nil, gv, nil)
-}
-
-func (s basicNegotiatedSerializer) DecoderToVersion(decoder runtime.Decoder, gv runtime.GroupVersioner) runtime.Decoder {
-	return versioning.NewDefaultingCodecForScheme(watchScheme, nil, decoder, nil, gv)
-}
diff --git a/pkg/client/cmd/context.go b/pkg/client/cmd/context.go
index 949dab0..7fa66ed 100644
--- a/pkg/client/cmd/context.go
+++ b/pkg/client/cmd/context.go
@@ -21,8 +21,7 @@ import (
 	"github.com/spf13/cobra"
 )
 
-// NewCmdContext --
-func NewCmdContext(rootCmdOptions *RootCmdOptions) *cobra.Command {
+func newCmdContext(rootCmdOptions *RootCmdOptions) *cobra.Command {
 	cmd := cobra.Command{
 		Use:   "context",
 		Short: "Configure an Integration Context",
diff --git a/pkg/client/cmd/get.go b/pkg/client/cmd/get.go
index 7ae35ce..5b68adc 100644
--- a/pkg/client/cmd/get.go
+++ b/pkg/client/cmd/get.go
@@ -28,12 +28,12 @@ import (
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
-type GetCmdOptions struct {
+type getCmdOptions struct {
 	*RootCmdOptions
 }
 
-func NewCmdGet(rootCmdOptions *RootCmdOptions) *cobra.Command {
-	options := GetCmdOptions{
+func newCmdGet(rootCmdOptions *RootCmdOptions) *cobra.Command {
+	options := getCmdOptions{
 		RootCmdOptions: rootCmdOptions,
 	}
 	cmd := cobra.Command{
@@ -46,7 +46,7 @@ func NewCmdGet(rootCmdOptions *RootCmdOptions) *cobra.Command {
 	return &cmd
 }
 
-func (o *GetCmdOptions) run(cmd *cobra.Command, args []string) error {
+func (o *getCmdOptions) run(cmd *cobra.Command, args []string) error {
 	integrationList := v1alpha1.IntegrationList{
 		TypeMeta: metav1.TypeMeta{
 			APIVersion: v1alpha1.SchemeGroupVersion.String(),
diff --git a/pkg/client/cmd/install.go b/pkg/client/cmd/install.go
index cd84fbd..2ca05ba 100644
--- a/pkg/client/cmd/install.go
+++ b/pkg/client/cmd/install.go
@@ -23,13 +23,12 @@ import (
 	"os"
 
 	"github.com/apache/camel-k/pkg/install"
+	"github.com/pkg/errors"
 	"github.com/spf13/cobra"
 	k8serrors "k8s.io/apimachinery/pkg/api/errors"
-	"github.com/pkg/errors"
 )
 
-// NewCmdInstall --
-func NewCmdInstall(rootCmdOptions *RootCmdOptions) *cobra.Command {
+func newCmdInstall(rootCmdOptions *RootCmdOptions) *cobra.Command {
 	options := installCmdOptions{
 		RootCmdOptions: rootCmdOptions,
 	}
diff --git a/pkg/client/cmd/root.go b/pkg/client/cmd/root.go
index dfbbfd9..7fbeeef 100644
--- a/pkg/client/cmd/root.go
+++ b/pkg/client/cmd/root.go
@@ -73,11 +73,11 @@ func NewKamelCommand(ctx context.Context) (*cobra.Command, error) {
 	}
 
 	cmd.AddCommand(newCmdCompletion(&cmd))
-	cmd.AddCommand(NewCmdVersion())
-	cmd.AddCommand(NewCmdRun(&options))
-	cmd.AddCommand(NewCmdGet(&options))
-	cmd.AddCommand(NewCmdInstall(&options))
-	cmd.AddCommand(NewCmdContext(&options))
+	cmd.AddCommand(newCmdVersion())
+	cmd.AddCommand(newCmdRun(&options))
+	cmd.AddCommand(newCmdGet(&options))
+	cmd.AddCommand(newCmdInstall(&options))
+	cmd.AddCommand(newCmdContext(&options))
 
 	return &cmd, nil
 }
diff --git a/pkg/client/cmd/run.go b/pkg/client/cmd/run.go
index 47e23fe..37d06bb 100644
--- a/pkg/client/cmd/run.go
+++ b/pkg/client/cmd/run.go
@@ -20,13 +20,14 @@ package cmd
 import (
 	"errors"
 	"fmt"
-	"github.com/apache/camel-k/pkg/util/sync"
-	"github.com/sirupsen/logrus"
 	"io/ioutil"
 	"os"
 	"strconv"
 	"strings"
 
+	"github.com/apache/camel-k/pkg/util/sync"
+	"github.com/sirupsen/logrus"
+
 	"io"
 
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
@@ -39,8 +40,7 @@ import (
 	"k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
-// NewCmdRun --
-func NewCmdRun(rootCmdOptions *RootCmdOptions) *cobra.Command {
+func newCmdRun(rootCmdOptions *RootCmdOptions) *cobra.Command {
 	options := runCmdOptions{
 		RootCmdOptions: rootCmdOptions,
 	}
@@ -134,7 +134,7 @@ func (o *runCmdOptions) run(cmd *cobra.Command, args []string) error {
 
 func (o *runCmdOptions) waitForIntegrationReady(integration *v1alpha1.Integration) error {
 	// Block this goroutine until the integration is in a final status
-	changes, err := watch.WatchStateChanges(o.Context, integration)
+	changes, err := watch.StateChanges(o.Context, integration)
 	if err != nil {
 		return err
 	}
diff --git a/pkg/client/cmd/version.go b/pkg/client/cmd/version.go
index 1424a37..2153107 100644
--- a/pkg/client/cmd/version.go
+++ b/pkg/client/cmd/version.go
@@ -24,7 +24,7 @@ import (
 	"github.com/spf13/cobra"
 )
 
-func NewCmdVersion() *cobra.Command {
+func newCmdVersion() *cobra.Command {
 	return &cobra.Command{
 		Use:   "version",
 		Short: "Display client version",
diff --git a/pkg/install/cluster.go b/pkg/install/cluster.go
index 4fddf54..855d8f6 100644
--- a/pkg/install/cluster.go
+++ b/pkg/install/cluster.go
@@ -29,6 +29,7 @@ import (
 	"k8s.io/apimachinery/pkg/util/yaml"
 )
 
+// SetupClusterwideResources --
 func SetupClusterwideResources() error {
 
 	// Install CRD for Integration Context (if needed)
@@ -56,6 +57,7 @@ func SetupClusterwideResources() error {
 	return nil
 }
 
+// IsCRDInstalled check if the given CRT kind is installed
 func IsCRDInstalled(kind string) (bool, error) {
 	lst, err := k8sclient.GetKubeClient().Discovery().ServerResourcesForGroupVersion("camel.apache.org/v1alpha1")
 	if err != nil && errors.IsNotFound(err) {
@@ -82,7 +84,7 @@ func installCRD(kind string, resourceName string) error {
 	}
 
 	crd := []byte(deploy.Resources[resourceName])
-	crdJson, err := yaml.ToJSON(crd)
+	crdJSON, err := yaml.ToJSON(crd)
 	if err != nil {
 		return err
 	}
@@ -93,7 +95,7 @@ func installCRD(kind string, resourceName string) error {
 	// Post using dynamic client
 	result := restClient.
 		Post().
-		Body(crdJson).
+		Body(crdJSON).
 		Resource("customresourcedefinitions").
 		Do()
 	// Check result
@@ -104,6 +106,7 @@ func installCRD(kind string, resourceName string) error {
 	return nil
 }
 
+// IsClusterRoleInstalled check if cluster role camel-k:edit is installed
 func IsClusterRoleInstalled() (bool, error) {
 	clusterRole := v1.ClusterRole{
 		TypeMeta: metav1.TypeMeta{
diff --git a/pkg/stub/action/context/action.go b/pkg/stub/action/context/action.go
index c35b84c..23b0f10 100644
--- a/pkg/stub/action/context/action.go
+++ b/pkg/stub/action/context/action.go
@@ -21,6 +21,7 @@ import (
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 )
 
+// IntegrationContextAction --
 type IntegrationContextAction interface {
 
 	// a user friendly name for the action
diff --git a/pkg/stub/action/context/initialize.go b/pkg/stub/action/context/initialize.go
index 5803b38..64d7647 100644
--- a/pkg/stub/action/context/initialize.go
+++ b/pkg/stub/action/context/initialize.go
@@ -23,22 +23,23 @@ import (
 	"github.com/operator-framework/operator-sdk/pkg/sdk"
 )
 
+// NewIntegrationContextInitializeAction creates a new initialization handling action for the context
 func NewIntegrationContextInitializeAction() IntegrationContextAction {
-	return &integrationContexInitializeAction{}
+	return &integrationContextInitializeAction{}
 }
 
-type integrationContexInitializeAction struct {
+type integrationContextInitializeAction struct {
 }
 
-func (action *integrationContexInitializeAction) Name() string {
+func (action *integrationContextInitializeAction) Name() string {
 	return "initialize"
 }
 
-func (action *integrationContexInitializeAction) CanHandle(context *v1alpha1.IntegrationContext) bool {
+func (action *integrationContextInitializeAction) CanHandle(context *v1alpha1.IntegrationContext) bool {
 	return context.Status.Phase == ""
 }
 
-func (action *integrationContexInitializeAction) Handle(context *v1alpha1.IntegrationContext) error {
+func (action *integrationContextInitializeAction) Handle(context *v1alpha1.IntegrationContext) error {
 	target := context.DeepCopy()
 
 	// update the status
diff --git a/pkg/stub/action/context/monitor.go b/pkg/stub/action/context/monitor.go
index 138900b..e30a1ea 100644
--- a/pkg/stub/action/context/monitor.go
+++ b/pkg/stub/action/context/monitor.go
@@ -24,6 +24,7 @@ import (
 	"github.com/sirupsen/logrus"
 )
 
+// NewIntegrationContextMonitorAction creates a new monitoring handling action for the context
 func NewIntegrationContextMonitorAction() IntegrationContextAction {
 	return &integrationContextMonitorAction{}
 }
diff --git a/pkg/stub/action/integration/action.go b/pkg/stub/action/integration/action.go
index c1c7935..9e4a69c 100644
--- a/pkg/stub/action/integration/action.go
+++ b/pkg/stub/action/integration/action.go
@@ -21,6 +21,7 @@ import (
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 )
 
+// IntegrationAction --
 type IntegrationAction interface {
 
 	// a user friendly name for the action
diff --git a/pkg/stub/action/integration/initialize.go b/pkg/stub/action/integration/initialize.go
index 25322fd..44bac89 100644
--- a/pkg/stub/action/integration/initialize.go
+++ b/pkg/stub/action/integration/initialize.go
@@ -18,34 +18,34 @@ limitations under the License.
 package action
 
 import (
+	"sort"
+
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/discover"
 	"github.com/apache/camel-k/pkg/util/digest"
 	"github.com/operator-framework/operator-sdk/pkg/sdk"
-	"sort"
 )
 
-// InitializeAction initializes the integration status to trigger the deployment
-type InitializeAction struct {
-}
-
 // NewInitializeAction creates a new inititialize action
 func NewInitializeAction() IntegrationAction {
-	return &InitializeAction{}
+	return &initializeAction{}
+}
+
+type initializeAction struct {
 }
 
 // Name returns a common name of the action
-func (b *InitializeAction) Name() string {
+func (action *initializeAction) Name() string {
 	return "initialize"
 }
 
 // CanHandle tells whether this action can handle the integration
-func (b *InitializeAction) CanHandle(integration *v1alpha1.Integration) bool {
+func (action *initializeAction) CanHandle(integration *v1alpha1.Integration) bool {
 	return integration.Status.Phase == ""
 }
 
 // Handle handles the integratios
-func (b *InitializeAction) Handle(integration *v1alpha1.Integration) error {
+func (action *initializeAction) Handle(integration *v1alpha1.Integration) error {
 	target := integration.DeepCopy()
 	// set default values
 	if target.Spec.Replicas == nil {
@@ -62,7 +62,7 @@ func (b *InitializeAction) Handle(integration *v1alpha1.Integration) error {
 	}
 	if *target.Spec.DependenciesAutoDiscovery {
 		discovered := discover.Dependencies(target.Spec.Source)
-		target.Spec.Dependencies = b.mergeDependencies(target.Spec.Dependencies, discovered)
+		target.Spec.Dependencies = action.mergeDependencies(target.Spec.Dependencies, discovered)
 	}
 	// sort the dependencies to get always the same list if they don't change
 	sort.Strings(target.Spec.Dependencies)
@@ -72,7 +72,7 @@ func (b *InitializeAction) Handle(integration *v1alpha1.Integration) error {
 	return sdk.Update(target)
 }
 
-func (b *InitializeAction) mergeDependencies(list1 []string, list2 []string) []string {
+func (action *initializeAction) mergeDependencies(list1 []string, list2 []string) []string {
 	set := make(map[string]bool, 0)
 	for _, d := range list1 {
 		set[d] = true
diff --git a/pkg/stub/action/integration/monitor.go b/pkg/stub/action/integration/monitor.go
index b12600a..483212e 100644
--- a/pkg/stub/action/integration/monitor.go
+++ b/pkg/stub/action/integration/monitor.go
@@ -24,23 +24,24 @@ import (
 	"github.com/sirupsen/logrus"
 )
 
-type MonitorAction struct {
+// NewMonitorAction creates a new monitoring action for an integration
+func NewMonitorAction() IntegrationAction {
+	return &monitorAction{}
 }
 
-func NewMonitorAction() IntegrationAction {
-	return &MonitorAction{}
+type monitorAction struct {
 }
 
-func (b *MonitorAction) Name() string {
+func (action *monitorAction) Name() string {
 	return "monitor"
 }
 
-func (a *MonitorAction) CanHandle(integration *v1alpha1.Integration) bool {
+func (action *monitorAction) CanHandle(integration *v1alpha1.Integration) bool {
 	return integration.Status.Phase == v1alpha1.IntegrationPhaseRunning ||
 		integration.Status.Phase == v1alpha1.IntegrationPhaseError
 }
 
-func (a *MonitorAction) Handle(integration *v1alpha1.Integration) error {
+func (action *monitorAction) Handle(integration *v1alpha1.Integration) error {
 
 	hash := digest.ComputeForIntegration(integration)
 	if hash != integration.Status.Digest {
diff --git a/pkg/util/kubernetes/config.go b/pkg/util/kubernetes/config.go
index 465b96c..b5d7393 100644
--- a/pkg/util/kubernetes/config.go
+++ b/pkg/util/kubernetes/config.go
@@ -18,15 +18,17 @@ limitations under the License.
 package kubernetes
 
 import (
-	"github.com/operator-framework/operator-sdk/pkg/k8sclient"
-	"k8s.io/client-go/tools/clientcmd"
 	"os/user"
 	"path/filepath"
+
+	"github.com/operator-framework/operator-sdk/pkg/k8sclient"
+	"k8s.io/client-go/tools/clientcmd"
 )
 
+// InitKubeClient initialize the k8s client
 func InitKubeClient(kubeconfig string) error {
 	if kubeconfig == "" {
-		kubeconfig = GetDefaultKubeConfigFile()
+		kubeconfig = getDefaultKubeConfigFile()
 	}
 
 	// use the current context in kubeconfig
@@ -39,7 +41,7 @@ func InitKubeClient(kubeconfig string) error {
 	return nil
 }
 
-func GetDefaultKubeConfigFile() string {
+func getDefaultKubeConfigFile() string {
 	usr, err := user.Current()
 	if err != nil {
 		panic(err) // TODO handle error
diff --git a/pkg/util/kubernetes/customclient/customclient.go b/pkg/util/kubernetes/customclient/customclient.go
index 9e38b6c..c0e3b64 100644
--- a/pkg/util/kubernetes/customclient/customclient.go
+++ b/pkg/util/kubernetes/customclient/customclient.go
@@ -23,6 +23,7 @@ import (
 	"k8s.io/client-go/rest"
 )
 
+// GetClientFor returns a RESTClient for the given group and version
 func GetClientFor(group string, version string) (*rest.RESTClient, error) {
 	inConfig := k8sclient.GetKubeConfig()
 	config := rest.CopyConfig(inConfig)
diff --git a/pkg/util/kubernetes/customclient/scheme.go b/pkg/util/kubernetes/customclient/scheme.go
index 7edcd02..9f62c42 100644
--- a/pkg/util/kubernetes/customclient/scheme.go
+++ b/pkg/util/kubernetes/customclient/scheme.go
@@ -20,7 +20,6 @@ import (
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	"k8s.io/apimachinery/pkg/runtime/schema"
-	"k8s.io/apimachinery/pkg/runtime/serializer"
 	"k8s.io/apimachinery/pkg/runtime/serializer/json"
 	"k8s.io/apimachinery/pkg/runtime/serializer/versioning"
 )
@@ -29,9 +28,6 @@ var watchScheme = runtime.NewScheme()
 var basicScheme = runtime.NewScheme()
 var deleteScheme = runtime.NewScheme()
 var parameterScheme = runtime.NewScheme()
-var deleteOptionsCodec = serializer.NewCodecFactory(deleteScheme)
-var dynamicParameterCodec = runtime.NewParameterCodec(parameterScheme)
-
 var versionV1 = schema.GroupVersion{Version: "v1"}
 
 func init() {
@@ -41,35 +37,6 @@ func init() {
 	metav1.AddToGroupVersion(deleteScheme, versionV1)
 }
 
-var watchJsonSerializerInfo = runtime.SerializerInfo{
-	MediaType:        "application/json",
-	EncodesAsText:    true,
-	Serializer:       json.NewSerializer(json.DefaultMetaFactory, watchScheme, watchScheme, false),
-	PrettySerializer: json.NewSerializer(json.DefaultMetaFactory, watchScheme, watchScheme, true),
-	StreamSerializer: &runtime.StreamSerializerInfo{
-		EncodesAsText: true,
-		Serializer:    json.NewSerializer(json.DefaultMetaFactory, watchScheme, watchScheme, false),
-		Framer:        json.Framer,
-	},
-}
-
-// watchNegotiatedSerializer is used to read the wrapper of the watch stream
-type watchNegotiatedSerializer struct{}
-
-var watchNegotiatedSerializerInstance = watchNegotiatedSerializer{}
-
-func (s watchNegotiatedSerializer) SupportedMediaTypes() []runtime.SerializerInfo {
-	return []runtime.SerializerInfo{watchJsonSerializerInfo}
-}
-
-func (s watchNegotiatedSerializer) EncoderForVersion(encoder runtime.Encoder, gv runtime.GroupVersioner) runtime.Encoder {
-	return versioning.NewDefaultingCodecForScheme(watchScheme, encoder, nil, gv, nil)
-}
-
-func (s watchNegotiatedSerializer) DecoderToVersion(decoder runtime.Decoder, gv runtime.GroupVersioner) runtime.Decoder {
-	return versioning.NewDefaultingCodecForScheme(watchScheme, nil, decoder, nil, gv)
-}
-
 // basicNegotiatedSerializer is used to handle discovery and error handling serialization
 type basicNegotiatedSerializer struct{}
 
diff --git a/pkg/util/kubernetes/loader.go b/pkg/util/kubernetes/loader.go
index 7e00bc7..fdc1fb8 100644
--- a/pkg/util/kubernetes/loader.go
+++ b/pkg/util/kubernetes/loader.go
@@ -24,14 +24,15 @@ import (
 	"k8s.io/apimachinery/pkg/util/yaml"
 )
 
+// LoadResourceFromYaml loads a k8s resource from a yaml definition
 func LoadResourceFromYaml(data string) (runtime.Object, error) {
 	role := []byte(data)
-	roleJson, err := yaml.ToJSON(role)
+	roleJSON, err := yaml.ToJSON(role)
 	if err != nil {
 		return nil, err
 	}
 	u := unstructured.Unstructured{}
-	err = u.UnmarshalJSON(roleJson)
+	err = u.UnmarshalJSON(roleJSON)
 	if err != nil {
 		return nil, err
 	}
diff --git a/pkg/util/kubernetes/namespace.go b/pkg/util/kubernetes/namespace.go
index 279f64b..664330c 100644
--- a/pkg/util/kubernetes/namespace.go
+++ b/pkg/util/kubernetes/namespace.go
@@ -18,17 +18,19 @@ limitations under the License.
 package kubernetes
 
 import (
-	"github.com/pkg/errors"
 	"io/ioutil"
+
+	"github.com/pkg/errors"
 	"k8s.io/apimachinery/pkg/runtime/schema"
 	"k8s.io/client-go/tools/clientcmd"
 	clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
 	clientcmdlatest "k8s.io/client-go/tools/clientcmd/api/latest"
 )
 
+// GetClientCurrentNamespace --
 func GetClientCurrentNamespace(kubeconfig string) (string, error) {
 	if kubeconfig == "" {
-		kubeconfig = GetDefaultKubeConfigFile()
+		kubeconfig = getDefaultKubeConfigFile()
 	}
 	if kubeconfig == "" {
 		return "default", nil
diff --git a/pkg/util/kubernetes/sanitize.go b/pkg/util/kubernetes/sanitize.go
index e42c554..3021103 100644
--- a/pkg/util/kubernetes/sanitize.go
+++ b/pkg/util/kubernetes/sanitize.go
@@ -32,6 +32,7 @@ func init() {
 	disallowedChars = regexp.MustCompile("[^a-z0-9-]")
 }
 
+// SanitizeName sanitizes the given name to be compatible with k8s
 func SanitizeName(name string) string {
 	name = strings.Split(name, ".")[0]
 	name = path.Base(name)
diff --git a/pkg/util/kubernetes/wait.go b/pkg/util/kubernetes/wait.go
index 1ce55ee..9ae6948 100644
--- a/pkg/util/kubernetes/wait.go
+++ b/pkg/util/kubernetes/wait.go
@@ -1,20 +1,41 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
 package kubernetes
 
 import (
+	"time"
+
 	"github.com/operator-framework/operator-sdk/pkg/sdk"
 	"github.com/pkg/errors"
 	"k8s.io/apimachinery/pkg/runtime"
-	"time"
 )
 
+// ResourceRetrieveFunction --
 type ResourceRetrieveFunction func() (interface{}, error)
 
+// ResourceCheckFunction --
 type ResourceCheckFunction func(interface{}) (bool, error)
 
 const (
 	sleepTime = 400 * time.Millisecond
 )
 
+// WaitCondition --
 func WaitCondition(obj runtime.Object, condition ResourceCheckFunction, maxDuration time.Duration) error {
 	start := time.Now()
 
diff --git a/pkg/util/maven/maven.go b/pkg/util/maven/maven.go
index 32e1317..c54ebd2 100644
--- a/pkg/util/maven/maven.go
+++ b/pkg/util/maven/maven.go
@@ -38,15 +38,15 @@ const (
 	artifactDirPrefix = "maven-bin-"
 )
 
-// Takes a project description and returns a binary tar with the built artifacts
-func Build(project ProjectDefinition) (string, error) {
+// Build takes a project description and returns a binary tar with the built artifacts
+func Build(integration Integration) (string, error) {
 	buildDir, err := ioutil.TempDir("", buildDirPrefix)
 	if err != nil {
 		return "", errors.Wrap(err, "could not create temporary dir for maven source files")
 	}
 	defer os.RemoveAll(buildDir)
 
-	err = createMavenStructure(buildDir, project)
+	err = createMavenStructure(buildDir, integration)
 	if err != nil {
 		return "", errors.Wrap(err, "could not write maven source files")
 	}
@@ -54,7 +54,7 @@ func Build(project ProjectDefinition) (string, error) {
 	if err != nil {
 		return "", err
 	}
-	tarfile, err := createTar(buildDir, project)
+	tarfile, err := createTar(buildDir, integration)
 	if err != nil {
 		return "", err
 	}
@@ -90,13 +90,13 @@ func mavenExtraOptions() string {
 	return "-Dcamel.noop=true"
 }
 
-func createTar(buildDir string, project ProjectDefinition) (string, error) {
+func createTar(buildDir string, integration Integration) (string, error) {
 	artifactDir, err := ioutil.TempDir("", artifactDirPrefix)
 	if err != nil {
 		return "", errors.Wrap(err, "could not create temporary dir for maven artifacts")
 	}
 
-	tarFileName := path.Join(artifactDir, project.Project.ArtifactId+".tar")
+	tarFileName := path.Join(artifactDir, integration.Project.ArtifactID+".tar")
 	tarFile, err := os.Create(tarFileName)
 	if err != nil {
 		return "", errors.Wrap(err, "cannot create tar file "+tarFileName)
@@ -104,14 +104,14 @@ func createTar(buildDir string, project ProjectDefinition) (string, error) {
 	defer tarFile.Close()
 
 	writer := tar.NewWriter(tarFile)
-	err = appendToTar(path.Join(buildDir, "target", project.Project.ArtifactId+"-"+project.Project.Version+".jar"), "", writer)
+	err = appendToTar(path.Join(buildDir, "target", integration.Project.ArtifactID+"-"+integration.Project.Version+".jar"), "", writer)
 	if err != nil {
 		return "", err
 	}
 
 	// Environment variables
-	if project.Env != nil {
-		err = writeFile(buildDir, "run-env.sh", envFileContent(project.Env))
+	if integration.Env != nil {
+		err = writeFile(buildDir, "run-env.sh", envFileContent(integration.Env))
 		if err != nil {
 			return "", err
 		}
@@ -169,7 +169,7 @@ func appendToTar(filePath string, tarPath string, writer *tar.Writer) error {
 	return nil
 }
 
-func createMavenStructure(buildDir string, project ProjectDefinition) error {
+func createMavenStructure(buildDir string, project Integration) error {
 	pom, err := GeneratePomFileContent(project.Project)
 	if err != nil {
 		return err
@@ -236,6 +236,7 @@ func envFileContent(env map[string]string) string {
 	return content
 }
 
+// GeneratePomFileContent generate a pom.xml file from the given project definition
 func GeneratePomFileContent(project Project) (string, error) {
 	w := &bytes.Buffer{}
 	w.WriteString(xml.Header)
@@ -251,14 +252,20 @@ func GeneratePomFileContent(project Project) (string, error) {
 	return w.String(), nil
 }
 
+// ParseGAV decode a maven artifact id to a dependency definition.
+//
+// The artifact id is in the form of:
+//
+//     <groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?')
+//
 func ParseGAV(gav string) (Dependency, error) {
 	// <groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?')
 	dep := Dependency{}
 	rex := regexp.MustCompile("([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?(:([^: ]+))?")
 	res := rex.FindStringSubmatch(gav)
 
-	dep.GroupId = res[1]
-	dep.ArtifactId = res[2]
+	dep.GroupID = res[1]
+	dep.ArtifactID = res[2]
 	dep.Type = "jar"
 
 	cnt := strings.Count(gav, ":")
diff --git a/pkg/util/maven/maven_test.go b/pkg/util/maven/maven_test.go
index 7e59e54..05cff20 100644
--- a/pkg/util/maven/maven_test.go
+++ b/pkg/util/maven/maven_test.go
@@ -53,19 +53,19 @@ const expectedPom = `<?xml version="1.0" encoding="UTF-8"?>
 func TestPomGeneration(t *testing.T) {
 	project := Project{
 		XMLName:           xml.Name{Local: "project"},
-		XmlNs:             "http://maven.apache.org/POM/4.0.0",
-		XmlNsXsi:          "http://www.w3.org/2001/XMLSchema-instance",
+		XMLNs:             "http://maven.apache.org/POM/4.0.0",
+		XMLNsXsi:          "http://www.w3.org/2001/XMLSchema-instance",
 		XsiSchemaLocation: "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd",
 		ModelVersion:      "4.0.0",
-		GroupId:           "org.apache.camel.k.integration",
-		ArtifactId:        "camel-k-integration",
+		GroupID:           "org.apache.camel.k.integration",
+		ArtifactID:        "camel-k-integration",
 		Version:           "1.0.0",
 		DependencyManagement: DependencyManagement{
 			Dependencies: Dependencies{
 				Dependencies: []Dependency{
 					{
-						GroupId:    "org.apache.camel",
-						ArtifactId: "camel-bom",
+						GroupID:    "org.apache.camel",
+						ArtifactID: "camel-bom",
 						Version:    "2.22.1",
 						Type:       "pom",
 						Scope:      "import",
@@ -76,8 +76,8 @@ func TestPomGeneration(t *testing.T) {
 		Dependencies: Dependencies{
 			Dependencies: []Dependency{
 				{
-					GroupId:    "org.apache.camel.k",
-					ArtifactId: "camel-k-runtime-jvm",
+					GroupID:    "org.apache.camel.k",
+					ArtifactID: "camel-k-runtime-jvm",
 					Version:    "1.0.0",
 				},
 			},
@@ -96,8 +96,8 @@ func TestParseSimpleGAV(t *testing.T) {
 	dep, err := ParseGAV("org.apache.camel:camel-core:2.21.1")
 
 	assert.Nil(t, err)
-	assert.Equal(t, dep.GroupId, "org.apache.camel")
-	assert.Equal(t, dep.ArtifactId, "camel-core")
+	assert.Equal(t, dep.GroupID, "org.apache.camel")
+	assert.Equal(t, dep.ArtifactID, "camel-core")
 	assert.Equal(t, dep.Version, "2.21.1")
 	assert.Equal(t, dep.Type, "jar")
 	assert.Equal(t, dep.Classifier, "")
@@ -107,8 +107,8 @@ func TestParseGAVWithType(t *testing.T) {
 	dep, err := ParseGAV("org.apache.camel:camel-core:war:2.21.1")
 
 	assert.Nil(t, err)
-	assert.Equal(t, dep.GroupId, "org.apache.camel")
-	assert.Equal(t, dep.ArtifactId, "camel-core")
+	assert.Equal(t, dep.GroupID, "org.apache.camel")
+	assert.Equal(t, dep.ArtifactID, "camel-core")
 	assert.Equal(t, dep.Version, "2.21.1")
 	assert.Equal(t, dep.Type, "war")
 	assert.Equal(t, dep.Classifier, "")
@@ -118,8 +118,8 @@ func TestParseGAVWithClassifierAndType(t *testing.T) {
 	dep, err := ParseGAV("org.apache.camel:camel-core:war:test:2.21.1")
 
 	assert.Nil(t, err)
-	assert.Equal(t, dep.GroupId, "org.apache.camel")
-	assert.Equal(t, dep.ArtifactId, "camel-core")
+	assert.Equal(t, dep.GroupID, "org.apache.camel")
+	assert.Equal(t, dep.ArtifactID, "camel-core")
 	assert.Equal(t, dep.Version, "2.21.1")
 	assert.Equal(t, dep.Type, "war")
 	assert.Equal(t, dep.Classifier, "test")
diff --git a/pkg/util/maven/types.go b/pkg/util/maven/types.go
index 5b1158e..db4b897 100644
--- a/pkg/util/maven/types.go
+++ b/pkg/util/maven/types.go
@@ -21,42 +21,49 @@ import (
 	"encoding/xml"
 )
 
-type ProjectDefinition struct {
+// Integration --
+type Integration struct {
 	Project     Project
 	JavaSources map[string]string
 	Resources   map[string]string
 	Env         map[string]string // TODO: should we deprecate it ? env are set on deployment
 }
 
+// Project represent a maven project
 type Project struct {
 	XMLName              xml.Name
-	XmlNs                string               `xml:"xmlns,attr"`
-	XmlNsXsi             string               `xml:"xmlns:xsi,attr"`
+	XMLNs                string               `xml:"xmlns,attr"`
+	XMLNsXsi             string               `xml:"xmlns:xsi,attr"`
 	XsiSchemaLocation    string               `xml:"xsi:schemaLocation,attr"`
 	ModelVersion         string               `xml:"modelVersion"`
-	GroupId              string               `xml:"groupId"`
-	ArtifactId           string               `xml:"artifactId"`
+	GroupID              string               `xml:"groupId"`
+	ArtifactID           string               `xml:"artifactId"`
 	Version              string               `xml:"version"`
 	DependencyManagement DependencyManagement `xml:"dependencyManagement"`
 	Dependencies         Dependencies         `xml:"dependencies"`
 }
 
+// DependencyManagement represent maven's dependency management block
 type DependencyManagement struct {
 	Dependencies Dependencies `xml:"dependencies"`
 }
 
+// Dependencies --
 type Dependencies struct {
 	Dependencies []Dependency `xml:"dependency"`
 }
 
+// Add a dependency to maven's dependencies
 func (deps *Dependencies) Add(dep Dependency) {
 	deps.Dependencies = append(deps.Dependencies, dep)
 }
 
-func (deps *Dependencies) AddGAV(groupId string, artifactId string, version string) {
-	deps.Add(NewDependency(groupId, artifactId, version))
+// AddGAV a dependency to maven's dependencies
+func (deps *Dependencies) AddGAV(groupID string, artifactID string, version string) {
+	deps.Add(NewDependency(groupID, artifactID, version))
 }
 
+// AddEncodedGAV a dependency to maven's dependencies
 func (deps *Dependencies) AddEncodedGAV(gav string) {
 	if d, err := ParseGAV(gav); err == nil {
 		// TODO: error handling
@@ -64,19 +71,21 @@ func (deps *Dependencies) AddEncodedGAV(gav string) {
 	}
 }
 
+// Dependency represent a maven's dependency
 type Dependency struct {
-	GroupId    string `xml:"groupId"`
-	ArtifactId string `xml:"artifactId"`
+	GroupID    string `xml:"groupId"`
+	ArtifactID string `xml:"artifactId"`
 	Version    string `xml:"version,omitempty"`
 	Type       string `xml:"type,omitempty"`
 	Classifier string `xml:"classifier,omitempty"`
 	Scope      string `xml:"scope,omitempty"`
 }
 
-func NewDependency(groupId string, artifactId string, version string) Dependency {
+// NewDependency create an new dependency from the given gav info
+func NewDependency(groupID string, artifactID string, version string) Dependency {
 	return Dependency{
-		GroupId:    groupId,
-		ArtifactId: artifactId,
+		GroupID:    groupID,
+		ArtifactID: artifactID,
 		Version:    version,
 		Type:       "jar",
 		Classifier: "",
diff --git a/pkg/util/openshift/register.go b/pkg/util/openshift/register.go
index f399bab..83b08aa 100644
--- a/pkg/util/openshift/register.go
+++ b/pkg/util/openshift/register.go
@@ -15,7 +15,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Register all Openshift types that we want to manage.
 package openshift
 
 import (
@@ -30,14 +29,11 @@ import (
 	"k8s.io/apimachinery/pkg/runtime"
 )
 
+// Register all Openshift types that we want to manage.
 func init() {
-	k8sutil.AddToSDKScheme(AddToScheme)
+	k8sutil.AddToSDKScheme(addKnownTypes)
 }
 
-var (
-	AddToScheme = addKnownTypes
-)
-
 type registerFunction func(*runtime.Scheme) error
 
 func addKnownTypes(scheme *runtime.Scheme) error {
diff --git a/pkg/util/sync/file.go b/pkg/util/sync/file.go
index 1be83b8..d40ebe2 100644
--- a/pkg/util/sync/file.go
+++ b/pkg/util/sync/file.go
@@ -20,9 +20,10 @@ package sync
 
 import (
 	"context"
+	"time"
+
 	"github.com/radovskyb/watcher"
 	"github.com/sirupsen/logrus"
-	"time"
 )
 
 // File returns a channel that signals each time the content of the file changes
diff --git a/pkg/util/watch/watch.go b/pkg/util/watch/watch.go
index 3ec0bda..1ed9671 100644
--- a/pkg/util/watch/watch.go
+++ b/pkg/util/watch/watch.go
@@ -18,18 +18,19 @@ limitations under the License.
 package watch
 
 import (
-	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"context"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/operator-framework/operator-sdk/pkg/k8sclient"
-	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	"k8s.io/apimachinery/pkg/runtime"
 	"github.com/operator-framework/operator-sdk/pkg/util/k8sutil"
-	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
 	"github.com/sirupsen/logrus"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+	"k8s.io/apimachinery/pkg/runtime"
 )
 
-// Watches a integration resource and send it through a channel when its status changes
-func WatchStateChanges(ctx context.Context, integration *v1alpha1.Integration) (<-chan *v1alpha1.Integration, error) {
+// StateChanges watches a integration resource and send it through a channel when its status changes
+func StateChanges(ctx context.Context, integration *v1alpha1.Integration) (<-chan *v1alpha1.Integration, error) {
 	resourceClient, _, err := k8sclient.GetResourceClient(integration.APIVersion, integration.Kind, integration.Namespace)
 	if err != nil {
 		return nil, err


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services