Skip to content

Commit d0a345a

Browse files
committed
style: remove unused go code with golint
1 parent 1802c77 commit d0a345a

File tree

1 file changed

+2
-35
lines changed

1 file changed

+2
-35
lines changed

internal/controller/handler.go

+2-35
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package controller
33
import (
44
"context"
55
"fmt"
6+
"strings"
7+
68
stackv1alpha1 "github.com/zncdata-labs/hive-metastore-operator/api/v1alpha1"
79
opgo "github.com/zncdata-labs/operator-go/pkg/apis/commons/v1alpha1"
810
"github.com/zncdata-labs/operator-go/pkg/errors"
@@ -14,7 +16,6 @@ import (
1416
"k8s.io/apimachinery/pkg/runtime"
1517
ctrl "sigs.k8s.io/controller-runtime"
1618
"sigs.k8s.io/controller-runtime/pkg/client"
17-
"strings"
1819
)
1920

2021
// Resource todo for dep, svc and so on
@@ -108,40 +109,6 @@ func (r *HiveMetastoreReconciler) reconcilePvc(ctx context.Context, instance *st
108109
return nil
109110
}
110111

111-
func (r *HiveMetastoreReconciler) makePv(ctx context.Context, instance *stackv1alpha1.HiveMetastore,
112-
mergeLabels map[string]string, groupName string, storageClassName *string, storageSize string,
113-
warehouseDir string, volumeMode *corev1.PersistentVolumeMode) error {
114-
className := ""
115-
if storageClassName != nil {
116-
className = *storageClassName
117-
}
118-
pv := &corev1.PersistentVolume{
119-
ObjectMeta: metav1.ObjectMeta{
120-
Name: instance.GetNameWithSuffix(groupName),
121-
Namespace: instance.Namespace,
122-
Labels: mergeLabels,
123-
},
124-
Spec: corev1.PersistentVolumeSpec{
125-
Capacity: corev1.ResourceList{
126-
corev1.ResourceStorage: resource.MustParse(storageSize),
127-
},
128-
PersistentVolumeSource: corev1.PersistentVolumeSource{
129-
HostPath: &corev1.HostPathVolumeSource{
130-
Path: warehouseDir,
131-
},
132-
},
133-
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},
134-
StorageClassName: className,
135-
VolumeMode: volumeMode,
136-
},
137-
}
138-
if err := CreateOrUpdate(ctx, r.Client, pv); err != nil {
139-
r.Log.Error(err, "Failed to create or update Resource", "resource", pv)
140-
return err
141-
}
142-
return nil
143-
}
144-
145112
// when s3 exists, need not make pvc; otherwise, need to make pv and pvc using `warehouseDir`
146113
func (r *HiveMetastoreReconciler) extractPvcForRoleGroup(instance *stackv1alpha1.HiveMetastore, ctx context.Context,
147114
groupName string, roleGroup *stackv1alpha1.RoleConfigSpec, scheme *runtime.Scheme) (*client.Object, error) {

0 commit comments

Comments
 (0)