ARTESCA-14623 // implement Metalk8sVolumeProvider#4530
ARTESCA-14623 // implement Metalk8sVolumeProvider#4530bert-e merged 2 commits intodevelopment/129.0from
Conversation
Hello hervedombya,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
| "scope": "metalk8s" | ||
| } | ||
| }, | ||
| "providers": { |
There was a problem hiding this comment.
Why do you need a new providers entry in the micro-app-configuration file ?
|
|
||
| expect(volumes).toHaveLength(1); | ||
| expect(volumes[0]).toMatchObject({ | ||
| IP: '192.168.1.100', |
There was a problem hiding this comment.
I think we can also return the k8s node name
| expect(volumes[0]).toMatchObject({ | ||
| IP: '192.168.1.100', | ||
| devicePath: '/dev/sda', | ||
| metadata: { name: 'test-volume' }, |
There was a problem hiding this comment.
No need for the metadata layer, the name could be at the root and changed to pvName
| }); | ||
|
|
||
| describe('listLocalPersistentVolumes', () => { | ||
| it('should return local persistent volumes for a given node.', async () => { |
There was a problem hiding this comment.
We should have additional tests for sparseloopdevice and lvmLogicalVolume
| ).rejects.toThrow('Failed to find IP for node non-existent-node'); | ||
| }); | ||
|
|
||
| it('should raise an error if volume recovery fails', async () => { |
There was a problem hiding this comment.
| it('should raise an error if volume recovery fails', async () => { | |
| it('should raise an error if volume retrieval fails', async () => { |
| ): Promise<LocalPersistentVolume[]>; | ||
| } | ||
|
|
||
| export default class K8SLocalVolumeProvider implements K8SLocalVolumeAdapter { |
There was a problem hiding this comment.
| export default class K8SLocalVolumeProvider implements K8SLocalVolumeAdapter { | |
| export default class Metalk8sLocalVolumeProvider implements K8SLocalVolumeAdapter { |
| { | ||
| ...isLocalPv, | ||
| IP: nodeIP.address, | ||
| devicePath: item.spec?.rawBlockDevice?.devicePath, |
There was a problem hiding this comment.
Missing handling sparseloopdevice and lvm volumes
There was a problem hiding this comment.
You can refer to this documentation for data format of both https://metal-k8s.readthedocs.io/en/stable/operation/volume_management/volume_creation_deletion_cli.html
| nodeName: string; | ||
| }; | ||
|
|
||
| export interface Metalk8sLocalVolumeAdapter { |
There was a problem hiding this comment.
The interface should not be linked to Metalk8s
| devicePath: | ||
| item.spec?.rawBlockDevice?.devicePath || item.metadata['name'], |
There was a problem hiding this comment.
I wonder if you might be missing an info on which adapter to use to retrieve the disk capacity.
There was a problem hiding this comment.
I suggest to return the volumeType : 'rawBlockDevice' | 'sparseLoopDevice' | 'lvmLogicalVolume'
There was a problem hiding this comment.
Use Virtual | Hardware
1ed8dca to
c4559dc
Compare
feat: implement K8SLocalVolumeProvider and remove Metalk8sLocalVolumeProvider feat: add K8SLocalVolumeProvider implementation and associated tests Add Metalk8sLocalVolumeProvider implementation and tests Enhance Metalk8sLocalVolumeProvider to support additional volume types and improve error handling in volume listing Remove Metalk8sLocalVolumeProvider entry from micro-app-configuration Add volumeType property to LocalPersistentVolume and refactor Metalk8sLocalVolumeProvider Refactor LocalPersistentVolume to use VolumeType enum for volumeType property
c4559dc to
5aecf3d
Compare
| const volumes = await provider.listLocalPersistentVolumes('test-node'); | ||
|
|
||
| expect(volumes).toHaveLength(3); | ||
| expect(volumes[0]).toMatchObject({ |
There was a problem hiding this comment.
We should also test virtual| hardware here IMO
|
/approve |
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option The following options are set: approve |
Build failedThe build for commit did not succeed in branch improvement/ARTESCA-14623 The following options are set: approve |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue ARTESCA-14623. Goodbye hervedombya. The following options are set: approve |
feat: implement K8SLocalVolumeProvider and remove Metalk8sLocalVolumeProvider
feat: add K8SLocalVolumeProvider implementation and associated tests
Component:
Context:
Summary:
Acceptance criteria:
Closes: #ISSUE_NUMBER