Skip to content

Commit c9ec70b

Browse files
committed
feat: Kubernetes 1.26 support
1 parent e18bcdb commit c9ec70b

File tree

4 files changed

+85
-33
lines changed

4 files changed

+85
-33
lines changed

.github/workflows/runner.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-22.04
1313
strategy:
1414
matrix:
15-
kubernetes: [v1.25.4,v1.24.4,v1.23.14,v1.22.12]
15+
kubernetes: [v1.26.8,v1.25.13,v1.24.17,v1.23.17]
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v3
@@ -21,7 +21,7 @@ jobs:
2121
- name: Test Action
2222
uses: ./
2323
with:
24-
minikube version: v1.28.0
24+
minikube version: v1.29.0
2525
kubernetes version: ${{ matrix.kubernetes }}
2626
github token: ${{ secrets.GITHUB_TOKEN }}
2727
- name: Validate Minikube
@@ -41,8 +41,8 @@ jobs:
4141
- name: Test Action
4242
uses: ./
4343
with:
44-
minikube version: v1.28.0
45-
kubernetes version: v1.25.4
44+
minikube version: v1.29.0
45+
kubernetes version: v1.26.8
4646
github token: ${{ secrets.GITHUB_TOKEN }}
4747
driver: docker
4848
- name: Validate Minikube
@@ -64,8 +64,8 @@ jobs:
6464
- name: Test Action
6565
uses: ./
6666
with:
67-
minikube version: v1.28.0
68-
kubernetes version: v1.25.4
67+
minikube version: v1.29.0
68+
kubernetes version: v1.26.8
6969
github token: ${{ secrets.GITHUB_TOKEN }}
7070
start args: '--addons=registry --addons=metrics-server'
7171
- name: Validate Minikube
@@ -85,8 +85,8 @@ jobs:
8585
- name: Test Action
8686
uses: ./
8787
with:
88-
minikube version: v1.28.0
89-
kubernetes version: v1.25.4
88+
minikube version: v1.29.0
89+
kubernetes version: v1.26.8
9090
github token: ${{ secrets.GITHUB_TOKEN }}
9191
start args: '--addons=ingress'
9292
- name: Validate Minikube
@@ -100,7 +100,7 @@ jobs:
100100
runs-on: ubuntu-latest
101101
strategy:
102102
matrix:
103-
kubernetes: [v1.25.4,1.24.8,v1.19.16]
103+
kubernetes: [v1.26.8,v1.25.4,v1.19.16]
104104
container_runtime: ['containerd']
105105
steps:
106106
- name: Checkout
@@ -110,7 +110,7 @@ jobs:
110110
- name: Test Action
111111
uses: ./
112112
with:
113-
minikube version: v1.28.0
113+
minikube version: v1.29.0
114114
kubernetes version: ${{ matrix.kubernetes }}
115115
github token: ${{ secrets.GITHUB_TOKEN }}
116116
container runtime: ${{ matrix.container_runtime }}
@@ -126,7 +126,7 @@ jobs:
126126
runs-on: ubuntu-20.04
127127
strategy:
128128
matrix:
129-
kubernetes: [v1.22.15,v1.21.14,v1.20.15,v1.19.16,v1.18.20,v1.17.17]
129+
kubernetes: [v1.22.17,v1.21.14,v1.20.15,v1.19.16,v1.18.20,v1.17.17]
130130
steps:
131131
- name: Checkout
132132
uses: actions/checkout@v3
@@ -135,7 +135,7 @@ jobs:
135135
- name: Test Action
136136
uses: ./
137137
with:
138-
minikube version: v1.28.0
138+
minikube version: v1.29.0
139139
kubernetes version: ${{ matrix.kubernetes }}
140140
github token: ${{ secrets.GITHUB_TOKEN }}
141141
- name: Validate Minikube

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
- name: Setup Minikube
3232
uses: manusa/[email protected]
3333
with:
34-
minikube version: 'v1.28.0'
35-
kubernetes version: 'v1.25.4'
34+
minikube version: 'v1.29.0'
35+
kubernetes version: 'v1.26.8'
3636
github token: ${{ secrets.GITHUB_TOKEN }}
3737
- name: Interact with the cluster
3838
run: kubectl get nodes
+65-15
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,77 @@
11
describe('configure-docker module test suite', () => {
2+
let download;
23
let configureEnvironment;
34
let logExecSync;
45
beforeEach(() => {
56
jest.resetModules();
67
jest.mock('../exec');
78
jest.mock('../download');
9+
download = require('../download');
810
configureEnvironment = require('../configure-environment');
911
logExecSync = require('../exec').logExecSync;
1012
});
11-
test('configureEnvironment, should run all configuration commands', () => {
12-
// Given
13-
logExecSync.mockImplementation(() => {});
14-
// When
15-
configureEnvironment();
16-
// Then
17-
expect(logExecSync).toHaveBeenCalledTimes(2);
18-
});
19-
test('configureEnvironment with docker driver, should run all configuration commands', () => {
20-
// Given
21-
logExecSync.mockImplementation(() => {});
22-
// When
23-
configureEnvironment({driver: 'docker'});
24-
// Then
25-
expect(logExecSync).toHaveBeenCalledTimes(3);
13+
describe('configureEnvironment', () => {
14+
beforeEach(() => {
15+
logExecSync.mockImplementation(() => {});
16+
});
17+
describe('with driver=docker', () => {
18+
beforeEach(() => {
19+
configureEnvironment({driver: 'docker'});
20+
});
21+
test('installs conntrack', () => {
22+
expect(logExecSync).toHaveBeenCalledWith('sudo apt update -y');
23+
expect(logExecSync).toHaveBeenCalledWith(
24+
'sudo apt-get install -y conntrack'
25+
);
26+
});
27+
test('waits for docker to be ready', () => {
28+
expect(logExecSync).toHaveBeenCalledWith(
29+
"docker version -f '{{.Server.Version}} - {{.Client.Version}}'"
30+
);
31+
});
32+
test('doesn\t install cni plugins', () => {
33+
expect(download.installCniPlugins).not.toHaveBeenCalled();
34+
});
35+
});
36+
describe('with driver=undefined', () => {
37+
beforeEach(() => {
38+
configureEnvironment();
39+
});
40+
test('installs conntrack', () => {
41+
expect(logExecSync).toHaveBeenCalledWith('sudo apt update -y');
42+
expect(logExecSync).toHaveBeenCalledWith(
43+
'sudo apt-get install -y conntrack'
44+
);
45+
});
46+
test('installs cni plugins', () => {
47+
expect(download.installCniPlugins).toHaveBeenCalledTimes(1);
48+
});
49+
test('installs crictl', () => {
50+
expect(download.installCriCtl).toHaveBeenCalledTimes(1);
51+
});
52+
test('installs cri-dockerd', () => {
53+
expect(download.installCriDockerd).toHaveBeenCalledTimes(1);
54+
});
55+
});
56+
describe('with driver=none', () => {
57+
beforeEach(() => {
58+
configureEnvironment({driver: 'none'});
59+
});
60+
test('installs conntrack', () => {
61+
expect(logExecSync).toHaveBeenCalledWith('sudo apt update -y');
62+
expect(logExecSync).toHaveBeenCalledWith(
63+
'sudo apt-get install -y conntrack'
64+
);
65+
});
66+
test('installs cni plugins', () => {
67+
expect(download.installCniPlugins).toHaveBeenCalledTimes(1);
68+
});
69+
test('installs crictl', () => {
70+
expect(download.installCriCtl).toHaveBeenCalledTimes(1);
71+
});
72+
test('installs cri-dockerd', () => {
73+
expect(download.installCriDockerd).toHaveBeenCalledTimes(1);
74+
});
75+
});
2676
});
2777
});

src/configure-environment.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ const waitForDocker = async (attempt = 0) => {
2222
};
2323

2424
const configureEnvironment = async (inputs = {}) => {
25+
const {driver = 'none'} = inputs;
2526
core.info('Updating Environment configuration to support Minikube');
2627
logExecSync('sudo apt update -y');
2728
logExecSync('sudo apt-get install -y conntrack');
28-
if (inputs.driver === 'docker') {
29+
if (driver === 'docker') {
2930
core.info('Waiting for Docker to be ready');
3031
await waitForDocker();
32+
} else {
33+
await download.installCniPlugins(inputs);
34+
await download.installCriCtl(inputs);
35+
await download.installCriDockerd(inputs);
3136
}
32-
await download.installCniPlugins(inputs);
33-
await download.installCriCtl(inputs);
34-
await download.installCriDockerd(inputs);
3537
};
3638

3739
module.exports = configureEnvironment;

0 commit comments

Comments
 (0)