Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/ddc/cache/component/component_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ package component

import (
"context"

"github.com/fluid-cloudnative/fluid/api/v1alpha1"
"github.com/fluid-cloudnative/fluid/pkg/common"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
)

Expand All @@ -30,16 +30,16 @@ type ComponentManager interface {
ConstructComponentStatus(todo context.Context, value *common.CacheRuntimeComponentValue) (v1alpha1.RuntimeComponentStatus, error)
}

func NewComponentHelper(workloadType metav1.TypeMeta, scheme *runtime.Scheme, client client.Client) ComponentManager {
func NewComponentHelper(workloadType metav1.TypeMeta, client client.Client) ComponentManager {
if workloadType.APIVersion == "apps/v1" {
if workloadType.Kind == "StatefulSet" {
return newStatefulSetManager(scheme, client)
return newStatefulSetManager(client)
} else if workloadType.Kind == "DaemonSet" {
return newDaemonSetManager(scheme, client)
return newDaemonSetManager(client)
}
}

return newStatefulSetManager(scheme, client)
return newStatefulSetManager(client)
}

// getCommonLabelsFromComponent returns the common labels for component used for stateful
Expand Down
29 changes: 29 additions & 0 deletions pkg/ddc/cache/component/component_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright 2026 The Fluid Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package component

import (
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

func TestCacheComponent(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Cache Component Suite", Label("cache-component"))
}
Loading
Loading