Skip to content

Commit b4a1acf

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

File tree

4 files changed

+79
-26
lines changed

4 files changed

+79
-26
lines changed

.github/workflows/runner.yml

+6-6
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
@@ -42,7 +42,7 @@ jobs:
4242
uses: ./
4343
with:
4444
minikube version: v1.28.0
45-
kubernetes version: v1.25.4
45+
kubernetes version: v1.26.8
4646
github token: ${{ secrets.GITHUB_TOKEN }}
4747
driver: docker
4848
- name: Validate Minikube
@@ -65,7 +65,7 @@ jobs:
6565
uses: ./
6666
with:
6767
minikube version: v1.28.0
68-
kubernetes version: v1.25.4
68+
kubernetes version: v1.26.8
6969
github token: ${{ secrets.GITHUB_TOKEN }}
7070
start args: '--addons=registry --addons=metrics-server'
7171
- name: Validate Minikube
@@ -86,7 +86,7 @@ jobs:
8686
uses: ./
8787
with:
8888
minikube version: v1.28.0
89-
kubernetes version: v1.25.4
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
@@ -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

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: manusa/[email protected]
3333
with:
3434
minikube version: 'v1.28.0'
35-
kubernetes version: 'v1.25.4'
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

+7-4
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,19 @@ 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();
3132
}
32-
await download.installCniPlugins(inputs);
33-
await download.installCriCtl(inputs);
34-
await download.installCriDockerd(inputs);
33+
if (driver === 'none') {
34+
await download.installCniPlugins(inputs);
35+
await download.installCriCtl(inputs);
36+
await download.installCriDockerd(inputs);
37+
}
3538
};
3639

3740
module.exports = configureEnvironment;

0 commit comments

Comments
 (0)