-
Notifications
You must be signed in to change notification settings - Fork 544
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(region,host,climc): support container post image overlay (#21942)
- Loading branch information
Showing
21 changed files
with
782 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
pkg/compute/container_drivers/volume_mount/disk_pov_host_path.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package volume_mount | ||
|
||
import ( | ||
"context" | ||
|
||
"yunion.io/x/onecloud/pkg/apis" | ||
"yunion.io/x/onecloud/pkg/httperrors" | ||
"yunion.io/x/onecloud/pkg/mcclient" | ||
) | ||
|
||
type povHostPath struct { | ||
} | ||
|
||
func newDiskPostOverlayHostPath() iDiskPostOverlay { | ||
return &povHostPath{} | ||
} | ||
|
||
func (p povHostPath) validateData(ctx context.Context, userCred mcclient.TokenCredential, ov *apis.ContainerVolumeMountDiskPostOverlay) error { | ||
if len(ov.HostLowerDir) == 0 { | ||
return httperrors.NewNotEmptyError("host_lower_dir is required") | ||
} | ||
for i, hld := range ov.HostLowerDir { | ||
if len(hld) == 0 { | ||
return httperrors.NewNotEmptyError("host_lower_dir %d is empty", i) | ||
} | ||
} | ||
if len(ov.ContainerTargetDir) == 0 { | ||
return httperrors.NewNotEmptyError("container_target_dir is required") | ||
} | ||
return nil | ||
} | ||
|
||
func (p povHostPath) getContainerTargetDirs(ov *apis.ContainerVolumeMountDiskPostOverlay) []string { | ||
return []string{ov.ContainerTargetDir} | ||
} |
Oops, something went wrong.