Skip to content

Commit

Permalink
Merge pull request kubevirt#242 from copejon/gofmt-project
Browse files Browse the repository at this point in the history
gofmt'd cmd, pkg, and test dirs (no change in cmd)
  • Loading branch information
copejon committed Jul 6, 2018
2 parents 45b321d + bcf2694 commit f5b698d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pkg/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (
Vadmin = 2
Vdebug = 3
DEFAULT_VERBOSE = Vuser

// the length of the random generated cloning label
GENERATED_CLONING_LABEL_LEN = 10
)
6 changes: 3 additions & 3 deletions pkg/controller/clone-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package controller

import (
"fmt"
"time"
"github.com/golang/glog"
"github.com/pkg/errors"
"k8s.io/api/core/v1"
Expand All @@ -12,6 +11,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
. "kubevirt.io/containerized-data-importer/pkg/common"
"time"
)

const (
Expand Down Expand Up @@ -170,11 +170,11 @@ func (c *CloneController) processPodItem(pod *v1.Pod) error {
// see if pvc's pod phase anno needs to be added/updated. The update is done only on the target PVC
phase := string(pod.Status.Phase)
_, exists := pvc.ObjectMeta.Annotations[AnnCloneRequest]
if !checkIfAnnoExists(pvc, AnnPodPhase, phase) && exists{
if !checkIfAnnoExists(pvc, AnnPodPhase, phase) && exists {
pvc, err = setPVCAnnotation(c.clientset, pvc, AnnPodPhase, phase)
if err != nil {
return errors.WithMessage(err, fmt.Sprintf("could not set annotation \"%s: %s\" on pvc %q", AnnPodPhase, phase, pvc.Name))

}
glog.V(Vdebug).Infof("processPodItem: pod phase %q annotated in pvc %q", pod.Status.Phase, pvcKey)
if phase == "Succeeded" {
Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ package controller

import (
"fmt"
"math/rand"
"strings"
"time"
"github.com/golang/glog"
"github.com/pkg/errors"
"k8s.io/api/core/v1"
Expand All @@ -14,6 +11,9 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/cache"
. "kubevirt.io/containerized-data-importer/pkg/common"
"math/rand"
"strings"
"time"
)

const DataVolName = "cdi-data-vol"
Expand Down Expand Up @@ -376,7 +376,7 @@ func MakeCloneSourcePodSpec(image, verbose, pullPolicy, pvcName string, generate
AnnCloningCreatedBy: "yes",
},
Labels: map[string]string{
CDI_LABEL_KEY: CDI_LABEL_VALUE, //filtered by the podInformer
CDI_LABEL_KEY: CDI_LABEL_VALUE, //filtered by the podInformer
CLONING_LABEL_KEY: CLONING_LABEL_VALUE + "-" + generatedLabelStr, //used by podAffity
},
},
Expand Down Expand Up @@ -475,7 +475,7 @@ func MakeCloneTargetPodSpec(image, verbose, pullPolicy string, pvc *v1.Persisten
AnnCloningCreatedBy: "yes",
},
Labels: map[string]string{
CDI_LABEL_KEY: CDI_LABEL_VALUE, //filtered by the podInformer
CDI_LABEL_KEY: CDI_LABEL_VALUE, //filtered by the podInformer
CLONING_LABEL_KEY: CLONING_LABEL_VALUE + "-" + generatedLabelStr, //used by PodAffinity
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/image/filefmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"encoding/hex"
"strconv"

"github.com/pkg/errors"
"github.com/golang/glog"
"github.com/pkg/errors"
. "kubevirt.io/containerized-data-importer/pkg/common"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/importer/dataStream.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (d dataStream) xzReader() (*Reader, int64, error) {
}

// Return the tar reader and size of the endpoint "through the eye" of the previous reader.
// Assumes a single file was archived.
// Assumes a single file was archived.
// Note: the size stored in the header is used rather than raw metadata.
func (d dataStream) tarReader() (*Reader, int64, error) {
tr := tar.NewReader(d.topReader())
Expand Down
6 changes: 3 additions & 3 deletions test/functional/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ package controller
import (
"fmt"

"github.com/pkg/errors"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "kubevirt.io/containerized-data-importer/pkg/common"
. "kubevirt.io/containerized-data-importer/pkg/controller"
"github.com/pkg/errors"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/client-go/tools/cache"
k8stesting "k8s.io/client-go/tools/cache/testing"
. "kubevirt.io/containerized-data-importer/pkg/common"
. "kubevirt.io/containerized-data-importer/pkg/controller"
)

type operation int
Expand Down
2 changes: 1 addition & 1 deletion test/functional/importer/datastream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"strconv"
"strings"

"github.com/pkg/errors"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/pkg/errors"
"kubevirt.io/containerized-data-importer/pkg/image"
"kubevirt.io/containerized-data-importer/pkg/importer"
imagesize "kubevirt.io/containerized-data-importer/pkg/lib/size"
Expand Down

0 comments on commit f5b698d

Please sign in to comment.