-
-
Notifications
You must be signed in to change notification settings - Fork 739
feat: add full disk volumes #12104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add full disk volumes #12104
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -304,13 +304,16 @@ func (ctrl *UserVolumeConfigController) handleUserVolumeConfig( | |
| volumeID string, | ||
| ) error { | ||
| switch userVolumeConfig.Type().ValueOr(block.VolumeTypePartition) { | ||
| case block.VolumeTypePartition: | ||
| return ctrl.handlePartitionUserVolumeConfig(userVolumeConfig, v, volumeID) | ||
|
|
||
| case block.VolumeTypeDirectory: | ||
| return ctrl.handleDirectoryUserVolumeConfig(userVolumeConfig, v) | ||
|
|
||
| case block.VolumeTypeDisk, block.VolumeTypeTmpfs, block.VolumeTypeSymlink, block.VolumeTypeOverlay: | ||
| case block.VolumeTypeDisk: | ||
| return ctrl.handleDiskUserVolumeConfig(userVolumeConfig, v, volumeID) | ||
|
|
||
| case block.VolumeTypePartition: | ||
| return ctrl.handlePartitionUserVolumeConfig(userVolumeConfig, v, volumeID) | ||
|
|
||
| case block.VolumeTypeTmpfs, block.VolumeTypeSymlink, block.VolumeTypeOverlay: | ||
| fallthrough | ||
|
|
||
| default: | ||
|
|
@@ -364,6 +367,48 @@ func (ctrl *UserVolumeConfigController) handlePartitionUserVolumeConfig( | |
| return nil | ||
| } | ||
|
|
||
| func (ctrl *UserVolumeConfigController) handleDiskUserVolumeConfig( | ||
| userVolumeConfig configconfig.UserVolumeConfig, | ||
| v *block.VolumeConfig, | ||
| volumeID string, | ||
| ) error { | ||
| diskSelector, ok := userVolumeConfig.Provisioning().DiskSelector().Get() | ||
| if !ok { | ||
| // this shouldn't happen due to validation | ||
| return fmt.Errorf("disk selector not found for volume %q", volumeID) | ||
| } | ||
|
|
||
| v.TypedSpec().Type = block.VolumeTypeDisk | ||
| v.TypedSpec().Locator.Match = diskSelector | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this does work, but by chance a bit (with a specific form of disk selector). we have a problem here, the disk selector is evaluated in: while volume locator in: So anything which does simple But e.g. So I think we need a separate Open to any other ideas as well
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me know if the changes I did make any sense. I've added different |
||
| v.TypedSpec().Provisioning = block.ProvisioningSpec{ | ||
| Wave: block.WaveUserVolumes, | ||
| DiskSelector: block.DiskSelector{ | ||
| Match: diskSelector, | ||
| }, | ||
| PartitionSpec: block.PartitionSpec{ | ||
| TypeUUID: partition.LinuxFilesystemData, | ||
| }, | ||
| FilesystemSpec: block.FilesystemSpec{ | ||
| Type: userVolumeConfig.Filesystem().Type(), | ||
| }, | ||
| } | ||
| v.TypedSpec().Mount = block.MountSpec{ | ||
| TargetPath: userVolumeConfig.Name(), | ||
| ParentID: constants.UserVolumeMountPoint, | ||
| SelinuxLabel: constants.EphemeralSelinuxLabel, | ||
| FileMode: 0o755, | ||
| UID: 0, | ||
| GID: 0, | ||
| ProjectQuotaSupport: userVolumeConfig.Filesystem().ProjectQuotaSupport(), | ||
| } | ||
|
|
||
| if err := convertEncryptionConfiguration(userVolumeConfig.Encryption(), v.TypedSpec()); err != nil { | ||
| return fmt.Errorf("error apply encryption configuration: %w", err) | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| func (ctrl *UserVolumeConfigController) handleDirectoryUserVolumeConfig( | ||
| userVolumeConfig configconfig.UserVolumeConfig, | ||
| v *block.VolumeConfig, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.