summaryrefslogtreecommitdiff
path: root/tests/stubs/edge/handlerstub/module.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stubs/edge/handlerstub/module.go')
-rw-r--r--tests/stubs/edge/handlerstub/module.go76
1 files changed, 0 insertions, 76 deletions
diff --git a/tests/stubs/edge/handlerstub/module.go b/tests/stubs/edge/handlerstub/module.go
deleted file mode 100644
index f559809eb..000000000
--- a/tests/stubs/edge/handlerstub/module.go
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-Copyright 2019 The KubeEdge 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 handlerstub
-
-import (
- "k8s.io/klog/v2"
-
- "github.com/kubeedge/beehive/pkg/core"
- "github.com/kubeedge/kubeedge/tests/stubs/common/constants"
-)
-
-// Init module
-func init() {
- core.Register(&HandlerStub{})
-}
-
-// HandlerStub definition
-type HandlerStub struct {
- podManager *PodManager
-}
-
-var _ core.Module = (*HandlerStub)(nil)
-
-func (*HandlerStub) Enable() bool {
- return true
-}
-
-// Return module name
-func (*HandlerStub) Name() string {
- return constants.HandlerStub
-}
-
-// Return module group
-func (*HandlerStub) Group() string {
- return constants.MetaGroup
-}
-
-// Start handler hub
-func (hs *HandlerStub) Start() {
- // New pod manager
- pm, err := NewPodManager()
- if err != nil {
- klog.Errorf("Failed to create pod manager with error: %v", err)
- return
- }
- hs.podManager = pm
-
- // Wait for message
- klog.Infof("Wait for message")
- hs.WaitforMessage()
-
- // Start upstream controller
- upstream, err := NewUpstreamController(pm)
- if err != nil {
- klog.Errorf("New upstream controller failed with error: %v", err)
- return
- }
- if err := upstream.Start(); err != nil {
- klog.Errorf("Failed to start upstream with error: %v", err)
- return
- }
-}