@@ -3,6 +3,8 @@ package controller
3
3
import (
4
4
"context"
5
5
"fmt"
6
+ "strings"
7
+
6
8
stackv1alpha1 "github.com/zncdata-labs/hive-metastore-operator/api/v1alpha1"
7
9
opgo "github.com/zncdata-labs/operator-go/pkg/apis/commons/v1alpha1"
8
10
"github.com/zncdata-labs/operator-go/pkg/errors"
@@ -14,7 +16,6 @@ import (
14
16
"k8s.io/apimachinery/pkg/runtime"
15
17
ctrl "sigs.k8s.io/controller-runtime"
16
18
"sigs.k8s.io/controller-runtime/pkg/client"
17
- "strings"
18
19
)
19
20
20
21
// Resource todo for dep, svc and so on
@@ -108,40 +109,6 @@ func (r *HiveMetastoreReconciler) reconcilePvc(ctx context.Context, instance *st
108
109
return nil
109
110
}
110
111
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
-
145
112
// when s3 exists, need not make pvc; otherwise, need to make pv and pvc using `warehouseDir`
146
113
func (r * HiveMetastoreReconciler ) extractPvcForRoleGroup (instance * stackv1alpha1.HiveMetastore , ctx context.Context ,
147
114
groupName string , roleGroup * stackv1alpha1.RoleConfigSpec , scheme * runtime.Scheme ) (* client.Object , error ) {
0 commit comments