@@ -8,7 +8,7 @@ const {logExecSync} = require('./exec');
8
8
9
9
const isLinux = name => name . indexOf ( 'linux' ) >= 0 ;
10
10
const isAmd64 = name => name . indexOf ( 'amd64' ) >= 0 ;
11
- const isSignature = name => name . indexOf ( 'sha256' ) >= 0 ;
11
+ const isSignature = name => name . indexOf ( 'sha1' ) >= 0 || name . indexOf ( ' sha256' ) >= 0 || name . indexOf ( 'sha512 ') >= 0 ;
12
12
const isWindows = name => name . indexOf ( '.win.' ) >= 0 ;
13
13
const isMac = name => name . indexOf ( '.darwin.' ) >= 0 ;
14
14
const isTgz = name => name . endsWith ( '.tgz' ) ;
@@ -43,6 +43,23 @@ const downloadMinikube = async (inputs = {}) => {
43
43
} ) ;
44
44
} ;
45
45
46
+ // Required by cri-dockerd and recent Minikube releases
47
+ // https://github.com/Mirantis/cri-dockerd/commit/e2666520e25cb302b9b1d231a63699c2338b8567
48
+ // https://github.com/kubernetes/minikube/commit/fd549f396dbd39385baefe88dcead0ccf99f1bff
49
+ const installCniPlugins = async ( inputs = { } ) => {
50
+ core . info ( `Downloading CNI plugins` ) ;
51
+ const tag = 'v1.2.0' ;
52
+ const tar = await downloadGitHubArtifact ( {
53
+ inputs,
54
+ releaseUrl : `https://api.github.com/repos/containernetworking/plugins/releases/tags/${ tag } ` ,
55
+ assetPredicate : asset =>
56
+ isLinux ( asset . name ) && isAmd64 ( asset . name ) && ! isSignature ( asset . name ) && asset . name . indexOf ( 'cni-plugins' ) === 0
57
+ } ) ;
58
+ const cniBinDirPath = '/opt/cni/bin' ;
59
+ logExecSync ( `sudo mkdir -p ${ cniBinDirPath } ` ) ;
60
+ await tc . extractTar ( tar , cniBinDirPath ) ;
61
+ } ;
62
+
46
63
const installCriCtl = async ( inputs = { } ) => {
47
64
core . info ( `Downloading cri-ctl` ) ;
48
65
const tag = 'v1.25.0' ;
@@ -96,4 +113,4 @@ const installCriDockerd = async (inputs = {}) => {
96
113
logExecSync ( 'sudo systemctl enable --now cri-docker.socket' ) ;
97
114
} ;
98
115
99
- module . exports = { downloadMinikube, installCriCtl, installCriDockerd} ;
116
+ module . exports = { downloadMinikube, installCniPlugins , installCriCtl, installCriDockerd} ;
0 commit comments