Skip to content

Commit

Permalink
Add image state Downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
futuretea authored and guangbochen committed Sep 18, 2021
1 parent c85d5e9 commit 1e3ea9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/constants/constants_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const (
FieldImageSize = "size"
FieldImageStorageClassName = "storage_class_name"

StateImageUploading = "Uploading"
StateImageFailed = "Failed"
StateImageUploading = "Uploading"
StateImageDownloading = "Downloading"
StateImageFailed = "Failed"
)
7 changes: 6 additions & 1 deletion pkg/importer/resource_image_importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ func ResourceImageStateGetter(obj *harvsterv1.VirtualMachineImage) (*StateGetter
if imported {
state = constants.StateCommonActive
} else {
state = constants.StateImageUploading
switch obj.Spec.SourceType {
case harvsterv1.VirtualMachineImageSourceTypeDownload:
state = constants.StateImageDownloading
default:
state = constants.StateImageUploading
}
}
} else {
state = constants.StateImageFailed
Expand Down

0 comments on commit 1e3ea9f

Please sign in to comment.