feat(zfspv) Add golint check to travis (#175)

Signed-off-by: vaniisgh <vanisingh@live.co.uk>
This commit is contained in:
vaniisgh 2020-07-07 18:21:02 +05:30 committed by GitHub
parent 8b7ad5cb45
commit 8bbf3d7d2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 321 additions and 266 deletions

View file

@ -31,15 +31,17 @@ type NamespaceGetter interface {
type NamespaceLister interface {
List(options metav1.ListOptions) (*corev1.NamespaceList, error)
}
type namespace struct{}
// NamespaceStruct is used to initialise kubernetes namespace instnaces
type NamespaceStruct struct{}
// Namespace returns a pointer to the namespace struct
func Namespace() *namespace {
return &namespace{}
func Namespace() *NamespaceStruct {
return &NamespaceStruct{}
}
// Get returns a namespace instance from kubernetes cluster
func (ns *namespace) Get(name string, options metav1.GetOptions) (*corev1.Namespace, error) {
func (ns *NamespaceStruct) Get(name string, options metav1.GetOptions) (*corev1.Namespace, error) {
cs, err := Clientset().Get()
if err != nil {
return nil, errors.Wrapf(err, "failed to get namespace: %s", name)
@ -48,7 +50,7 @@ func (ns *namespace) Get(name string, options metav1.GetOptions) (*corev1.Namesp
}
// List returns a slice of namespaces defined in a Kubernetes cluster
func (ns *namespace) List(options metav1.ListOptions) (*corev1.NamespaceList, error) {
func (ns *NamespaceStruct) List(options metav1.ListOptions) (*corev1.NamespaceList, error) {
cs, err := Clientset().Get()
if err != nil {
return nil, errors.Wrapf(err, "failed to get namespaces")