Skip to content

Commit ae4a64f

Browse files
fuweidzhuangqh
authored andcommitted
cri: remove v1alpha1 codebase
Signed-off-by: Wei Fu <[email protected]>
1 parent 856fc68 commit ae4a64f

File tree

15 files changed

+13
-4896
lines changed

15 files changed

+13
-4896
lines changed

Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ COVERAGE_PACKAGES=$(shell go list ./... | \
8686
grep -v github.com/alibaba/pouch/cli$$ | \
8787
grep -v github.com/alibaba/pouch/cli/ | \
8888
grep -v github.com/alibaba/pouch/cri/apis | \
89-
grep -v github.com/alibaba/pouch/cri/v1alpha1 | \
9089
grep -v github.com/alibaba/pouch/apis/types )
9190

9291
COVERAGE_PACKAGES_LIST=$(shell echo $(COVERAGE_PACKAGES) | tr " " ",")
@@ -292,12 +291,6 @@ integration-test: build-daemon-integration build-integration-test ## run daemon
292291
@mkdir -p coverage
293292
./hack/testing/run_daemon_integration.sh ${INTEGRATION_FLAGS}
294293

295-
.PHONY: cri-v1alpha1-test
296-
cri-v1alpha1-test: ## run v1 alpha1 cri-v1alpha1-test
297-
@echo $@
298-
@mkdir -p coverage
299-
./hack/testing/run_daemon_cri_integration.sh v1alpha1
300-
301294
.PHONY: cri-v1alpha2-test
302295
cri-v1alpha2-test: ## run v1 alpha2 cri-v1alpha2-test
303296
@echo $@
@@ -311,7 +304,7 @@ cri-e2e-test: ## run cri-e2e-test
311304
./hack/testing/run_daemon_cri_e2e.sh v1alpha2
312305

313306
.PHONY: test
314-
test: unit-test integration-test cri-v1alpha1-test cri-v1alpha2-test cri-e2e-test ## run the unit-test, integration-test , cri-v1alpha1-test , cri-v1alpha2-test and cri-e2e-test
307+
test: unit-test integration-test cri-v1alpha2-test cri-e2e-test ## run the unit-test, integration-test, cri-v1alpha2-test and cri-e2e-test
315308

316309
.PHONY: coverage
317310
coverage: ## combine coverage after test

cri/criservice.go

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"fmt"
55

66
"github.com/alibaba/pouch/cri/stream"
7-
criv1alpha1 "github.com/alibaba/pouch/cri/v1alpha1"
8-
servicev1alpha1 "github.com/alibaba/pouch/cri/v1alpha1/service"
97
criv1alpha2 "github.com/alibaba/pouch/cri/v1alpha2"
108
"github.com/alibaba/pouch/daemon/config"
119
"github.com/alibaba/pouch/daemon/mgr"
@@ -29,67 +27,15 @@ func RunCriService(daemonconfig *config.Config, containerMgr mgr.ContainerMgr, i
2927
return
3028
}
3129
switch daemonconfig.CriConfig.CriVersion {
32-
case "v1alpha1":
33-
err = runv1alpha1(daemonconfig, containerMgr, imageMgr, streamRouterCh, readyCh)
3430
case "v1alpha2":
3531
err = runv1alpha2(daemonconfig, containerMgr, imageMgr, volumeMgr, criPlugin, streamRouterCh, readyCh)
3632
default:
3733
streamRouterCh <- nil
3834
readyCh <- false
39-
err = fmt.Errorf("failed to start CRI service: invalid CRI version %s, expected to be v1alpha1 or v1alpha2", daemonconfig.CriConfig.CriVersion)
35+
err = fmt.Errorf("failed to start CRI service: invalid CRI version %s, expected to be v1alpha2", daemonconfig.CriConfig.CriVersion)
4036
}
4137
}
4238

43-
// Start CRI service with CRI version: v1alpha1
44-
func runv1alpha1(daemonconfig *config.Config, containerMgr mgr.ContainerMgr, imageMgr mgr.ImageMgr, streamRouterCh chan stream.Router, readyCh chan bool) error {
45-
logrus.Infof("Start CRI service with CRI version: v1alpha1")
46-
criMgr, err := criv1alpha1.NewCriManager(daemonconfig, containerMgr, imageMgr)
47-
if err != nil {
48-
streamRouterCh <- nil
49-
readyCh <- false
50-
return fmt.Errorf("failed to get CriManager with error: %v", err)
51-
}
52-
53-
service, err := servicev1alpha1.NewService(daemonconfig, criMgr)
54-
if err != nil {
55-
streamRouterCh <- nil
56-
readyCh <- false
57-
return fmt.Errorf("failed to start CRI service with error: %v", err)
58-
}
59-
60-
errChan := make(chan error, 2)
61-
// If the cri stream server share the port with pouchd,
62-
// export the its router. Otherwise launch it.
63-
if daemonconfig.CriConfig.StreamServerReusePort {
64-
errChan = make(chan error, 1)
65-
streamRouterCh <- criMgr.StreamRouter()
66-
} else {
67-
go func() {
68-
errChan <- criMgr.StreamServerStart()
69-
logrus.Infof("CRI Stream server stopped")
70-
}()
71-
streamRouterCh <- nil
72-
}
73-
74-
go func() {
75-
errChan <- service.Serve()
76-
logrus.Infof("CRI GRPC server stopped")
77-
}()
78-
79-
// the criservice has set up, send Ready
80-
readyCh <- true
81-
82-
// Check for error
83-
for i := 0; i < cap(errChan); i++ {
84-
if err := <-errChan; err != nil {
85-
return err
86-
}
87-
}
88-
89-
logrus.Infof("CRI service stopped")
90-
return nil
91-
}
92-
9339
// Start CRI service with CRI version: v1alpha2
9440
func runv1alpha2(daemonconfig *config.Config, containerMgr mgr.ContainerMgr, imageMgr mgr.ImageMgr, volumeMgr mgr.VolumeMgr, criPlugin hookplugins.CriPlugin, streamRouterCh chan stream.Router, readyCh chan bool) error {
9541
logrus.Infof("Start CRI service with CRI version: v1alpha2")

0 commit comments

Comments
 (0)