kube-object-storage / lib-bucket-provisioner

Library for the dynamic provisioning of object store buckets to be used by object store providers.
Apache License 2.0
21 stars 22 forks source link

tracking - go.sh lint results: #155

Open screeley44 opened 5 years ago

screeley44 commented 5 years ago

tracking go.sh lint results:

[screeley@screeley lib-bucket-provisioner (gosh)]$ ./hack/go.sh lint

WARN [runner/megacheck] Can't run megacheck because of compilation errors in packages [github.com/kube-object-storage/lib-bucket-provisioner/pkg/client/clientset/versioned/typed/objectbucket.io/v1alpha1 github.com/kube-object-storage/lib-bucket-provisioner/pkg/client/clientset/versioned github.com/kube-object-storage/lib-bucket-provisioner/pkg/client/clientset/versioned/typed/objectbucket.io/v1alpha1/fake github.com/kube-object-storage/lib-bucket-provisioner/pkg/client/clientset/versioned/fake github.com/kube-object-storage/lib-bucket-provisioner/pkg/client/informers/externalversions/internalinterfaces github.com/kube-object-storage/lib-bucket-provisioner/pkg/client/listers/objectbucket.io/v1alpha1 github.com/kube-object-storage/lib-bucket-provisioner/pkg/client/informers/externalversions/objectbucket.io/v1alpha1 github.com/kube-object-storage/lib-bucket-provisioner/pkg/client/informers/externalversions/objectbucket.io github.com/kube-object-storage/lib-bucket-provisioner/pkg/client/informers/externalversions github.com/kube-object-storage/lib-bucket-provisioner/pkg/provisioner]: pkg/client/clientset/versioned/typed/objectbucket.io/v1alpha1/objectbucket.io_client.go:79: DirectCodecFactory not declared by package serializer and 17 more errors: run `golangci-lint run --no-config --disable-all -E typecheck` to see all errors 
pkg/provisioner/controller.go:1: /home/screeley/git/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/rest/request.go:598:91: too few arguments in call to watch.NewStreamWatcher (typecheck)
/*
pkg/apis/objectbucket.io/register.go:17:1: don't use an underscore in package name (golint)
package objectbucket_io
^
pkg/provisioner/controller.go:342:21: error strings should not be capitalized or end with punctuation or a newline (golint)
        return fmt.Errorf("error updating OB %q's status to %q:", ob.Name, v1alpha1.ObjectBucketStatusPhaseBound, err)

With mods disabled (we think)

pkg/provisioner/controller.go:1: /home/screeley/git/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/kubernetes/typed/autoscaling/v1/autoscaling_client.go:74:43: DirectCodecFactory not declared by package serializer (typecheck)
/*
pkg/apis/objectbucket.io/register.go:17:1: don't use an underscore in package name (golint)
package objectbucket_io
^
pkg/provisioner/controller.go:342:21: error strings should not be capitalized or end with punctuation or a newline (golint)
        return fmt.Errorf("error updating OB %q's status to %q:", ob.Name, v1alpha1.ObjectBucketStatusPhaseBound, err)
copejon commented 5 years ago

As with #154 this looks like an issue with having go mods enabled. It's probably attempting to build the library with incompatible package versions.

screeley44 commented 5 years ago

@copejon - I updated my comment with the results of mods turned off

copejon commented 5 years ago

It's still looking at modules rather than vendored dependencies: pkg/provisioner/controller.go:1: /home/screeley/git/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/kubernetes/typed/autoscaling/v1/autoscaling_client.go:74:43: DirectCodecFactory not declared by package serializer (typecheck)

copejon commented 5 years ago

To prevent these issues from reoccurring with new devs, we need to fix the hack/README.md. Workflows need to be scrubbed of go mod uses and perhaps a line warning against using modules should be made.