Skip to content

Commit fef5fa7

Browse files
authored
feat: support latest rhel images (#365)
* feat: support latest rhel images * doc: update doc
1 parent 31d3ea6 commit fef5fa7

6 files changed

Lines changed: 30 additions & 30 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ The `macadam` binary is embedded in the extension, nothing needs to be installed
1212

1313
When initialized, the extension checks if the necessary binaries are present in `/opt/macadam/bin`. If they are not, the extension installs them in this directory.
1414

15-
> If this installation fails, you can run the installer manually, using the installer found at https://github.com/crc-org/macadam/releases/tag/v0.1.1. After this, you need to restart the extension which should find and use the binaries.
15+
> If this installation fails, you can run the installer manually, using the installer found at https://github.com/crc-org/macadam/releases/tag/v0.2.0. After this, you need to restart the extension which should find and use the binaries.
1616
1717
### On Fedora Linux/x86_64
1818

19-
The `macadam` binary must be installed in the directory `/opt/macadam/bin/`: download the binary from https://github.com/crc-org/macadam/releases/tag/v0.1.1, rename it `macadam` and make it executable.
19+
The `macadam` binary must be installed in the directory `/usr/local/bin/`: download the binary from https://github.com/crc-org/macadam/releases/tag/v0.2.0, rename it `macadam` and make it executable.
2020

2121
```
22-
curl -L -o macadam https://github.com/crc-org/macadam/releases/download/v0.1.1/macadam-linux-amd64
22+
curl -L -o macadam https://github.com/crc-org/macadam/releases/download/v0.2.0/macadam-linux-amd64
2323
chmod 755 macadam
24-
sudo mkdir -p /opt/macadam/bin/
25-
sudo mv macadam /opt/macadam/bin/
24+
sudo mkdir -p /usr/local/bin/
25+
sudo mv macadam /usr/local/bin/
2626
```
2727

2828
The `gvproxy` binary must be installed with the command `dnf install gvisor-tap-vsock`.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
},
2626
"rhel-vms.factory.machine.image": {
2727
"type": "string",
28-
"enum": ["RHEL 10.0", "RHEL 9.6", "local image on disk"],
28+
"enum": ["RHEL 10", "RHEL 9", "local image on disk"],
2929
"scope": "VmProviderConnectionFactory",
30-
"default": "RHEL 10.0",
30+
"default": "RHEL 10",
3131
"description": "Image to download"
3232
},
3333
"rhel-vms.factory.machine.force-download": {

src/cache.spec.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,37 @@ beforeEach(() => {
3636
vi.mocked(env).isLinux = false;
3737
});
3838

39-
test('images/image and images/rhel9_5 are deleted during init if they exist, rhel9_6 is not deleted, on Windows', async () => {
39+
test('images/image and images/rhel9_6 are deleted during init if they exist, rhel9 is not deleted, on Windows', async () => {
4040
vi.mocked(env).isWindows = true;
4141
const cachePath = resolve('/', 'path', 'to', 'cache');
4242
const cache = new ImageCache(cachePath);
4343
vol.fromJSON({
4444
'/path/to/cache/images/image': '',
45-
'/path/to/cache/images/rhel9_5.tar.gz': '',
4645
'/path/to/cache/images/rhel9_6.tar.gz': '',
46+
'/path/to/cache/images/rhel9.tar.gz': '',
4747
});
4848

4949
await cache.init();
5050

5151
expect(vol.toJSON()).toEqual({
52-
'/path/to/cache/images/rhel9_6.tar.gz': '',
52+
'/path/to/cache/images/rhel9.tar.gz': '',
5353
});
5454
});
5555

56-
test('images/image and images/rhel9_5 are deleted during init if they exist, rhel9_6 is not deleted, on Mac', async () => {
56+
test('images/image and images/rhel9_6 are deleted during init if they exist, rhel9 is not deleted, on Mac', async () => {
5757
vi.mocked(env).isMac = true;
5858
const cachePath = resolve('/', 'path', 'to', 'cache');
5959
const cache = new ImageCache(cachePath);
6060
vol.fromJSON({
6161
'/path/to/cache/images/image': '',
62-
'/path/to/cache/images/rhel9_5.tar.gz': '',
63-
'/path/to/cache/images/rhel9_6.qcow2': '',
62+
'/path/to/cache/images/rhel9_6.tar.gz': '',
63+
'/path/to/cache/images/rhel9.qcow2': '',
6464
});
6565

6666
await cache.init();
6767

6868
expect(vol.toJSON()).toEqual({
69-
'/path/to/cache/images/rhel9_6.qcow2': '',
69+
'/path/to/cache/images/rhel9.qcow2': '',
7070
});
7171
});
7272

@@ -84,24 +84,24 @@ test('getPath returns path for known image on Windows', async () => {
8484
vi.mocked(env).isWindows = true;
8585
const cache = new ImageCache(resolve('/', 'path', 'to', 'cache'));
8686
await cache.init();
87-
const path = cache.getPath('RHEL 10.0');
88-
expect(path).toBe(resolve('/', 'path', 'to', 'cache', 'images', 'rhel10_0.tar.gz'));
87+
const path = cache.getPath('RHEL 10');
88+
expect(path).toBe(resolve('/', 'path', 'to', 'cache', 'images', 'rhel10.tar.gz'));
8989
});
9090

9191
test('getPath returns path for known image on Linux', async () => {
9292
vi.mocked(env).isMac = true;
9393
const cache = new ImageCache(resolve('/', 'path', 'to', 'cache'));
9494
await cache.init();
95-
const path = cache.getPath('RHEL 10.0');
96-
expect(path).toBe(resolve('/', 'path', 'to', 'cache', 'images', 'rhel10_0.qcow2'));
95+
const path = cache.getPath('RHEL 10');
96+
expect(path).toBe(resolve('/', 'path', 'to', 'cache', 'images', 'rhel10.qcow2'));
9797
});
9898

9999
test('getPath returns path for known image on Mac', async () => {
100100
vi.mocked(env).isMac = true;
101101
const cache = new ImageCache(resolve('/', 'path', 'to', 'cache'));
102102
await cache.init();
103-
const path = cache.getPath('RHEL 10.0');
104-
expect(path).toBe(resolve('/', 'path', 'to', 'cache', 'images', 'rhel10_0.qcow2'));
103+
const path = cache.getPath('RHEL 10');
104+
expect(path).toBe(resolve('/', 'path', 'to', 'cache', 'images', 'rhel10.qcow2'));
105105
});
106106

107107
test('getPath raises an exception for an unknown image', async () => {

src/cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export class ImageCache {
2929
#extension = env.isWindows ? '.tar.gz' : '.qcow2';
3030

3131
#cachedImageNames: Record<string, string> = {
32-
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_10]: `rhel10_0${this.#extension}`,
33-
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9]: `rhel9_6${this.#extension}`,
32+
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_10]: `rhel10${this.#extension}`,
33+
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9]: `rhel9${this.#extension}`,
3434
};
3535

3636
constructor(storagePath: string) {

src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const RHEL_VMS_IMAGE_PROPERTY_KEY = 'rhel-vms.factory.machine.image';
2020
export const RHEL_VMS_IMAGE_PROPERTY_VALUE_LOCAL = 'local image on disk';
2121

2222
// Must match enumed value for rhel-vms.factory.machine.image in package.json
23-
export const RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_10 = 'RHEL 10.0';
24-
export const RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9 = 'RHEL 9.6';
23+
export const RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_10 = 'RHEL 10';
24+
export const RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9 = 'RHEL 9';
2525

2626
export const RHEL_VMS_LOCAL_IMAGE_KEY = 'rhel-vms.localImage';

src/images.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ import { RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9, RHEL_VMS_IMAGE_PROPERTY_VALUE_RHE
2222

2323
const IMAGES: { [provider: string]: { [version: string]: string } } = {
2424
applehv: {
25-
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_10]: 'd32f05024821400932b3653647567abcd34dc03b4243d9a8ae5a11ecd11b1544',
26-
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9]: '73c93ad15404a93b2d5bb3b01474e2827e03eb74316132c1067519e4cb598652',
25+
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_10]: 'a522f6abacab1c5804477332bbd14a467c3f9812d3f2c46ee05c71b07df05bcf', // 10.1
26+
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9]: 'e424cba737c5d6315160111043f40108b3bc458c09c937454a3331c52503d877', // 9.7
2727
},
2828
wsl: {
29-
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_10]: 'dccb2abb166981fa7598e948f9cab029aa1775219f8249fd54760ddd0f2b8910',
30-
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9]: 'dca8920b81a0664788a098b20328ee98ee6f822f1a1106ee85e9146c50ae6b98',
29+
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_10]: 'e1871004d0075e0ce10cfb4c1aae7c1fb56cf2162e9d494d1f9c9d061902fec6', // 10.1
30+
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9]: 'bf4fa1142e0090e7f6fe163bf03d5f0de12ebafce02d4f8ea71dd5de3f1769c8', // 9.7
3131
},
3232
linux_native_x64: {
33-
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_10]: '73473542ff4622524ae200ffabd4064bb2a7ff39ac40a012443a43d429d60019',
34-
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9]: '49443696e7f2410e5647aa16f15eb7b7b08610fea92cdf3eba44ab9ec9ff899f',
33+
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_10]: 'dc74ad1a9ccd3c62a02cc29f7f4715e47fa0fdaf08a8080dd20906f885f29bae', // 10.1
34+
[RHEL_VMS_IMAGE_PROPERTY_VALUE_RHEL_9]: 'e89e0a3e28c3e7fb73a97483b60130d5a3e4bba9481ae282ec6e0551ccf30047', // 9.7
3535
},
3636
};
3737

0 commit comments

Comments
 (0)