Skip to content

Commit

Permalink
feat(cvi): apply new controller design
Browse files Browse the repository at this point in the history
Signed-off-by: Isteb4k <[email protected]>
  • Loading branch information
Isteb4k committed Jun 3, 2024
1 parent 82152b5 commit f6b7ed5
Show file tree
Hide file tree
Showing 53 changed files with 3,699 additions and 1,067 deletions.
25 changes: 25 additions & 0 deletions .mirrord/mirrord.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"feature": {
"network": {
"incoming": "steal",
"outgoing": true
},
"fs": {
"mode": "read",
"read_only": "^/tmp/"
},
"env": true
},
"agent": {
"communication_timeout": 600,
"startup_timeout": 5600
},
"internal_proxy": {
"start_idle_timeout": 1300,
"idle_timeout": 150
},
"target": {
"namespace": "d8-virtualization",
"path": "deployment/virtualization-controller/container/virtualization-controller"
}
}
4 changes: 3 additions & 1 deletion api/core/v1alpha2/cluster_virtual_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,7 @@ const (
)

type ClusterVirtualImageStatus struct {
ImageStatus `json:",inline"`
ImageStatus `json:",inline"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}
38 changes: 38 additions & 0 deletions api/core/v1alpha2/cvicondition/condition.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package cvicondition

type Type = string

const (
DatasourceReady Type = "DatasourceReady"
ProvisioningPodStarted Type = "ProvisioningPodStarted"
UserUploadStarted Type = "UserUploadStarted"
Ready Type = "Ready"
)

type DatasourceReadyReason = string

const (
ContainerRegistrySecretNotFound DatasourceReadyReason = "ContainerRegistrySecretNotFound"
ImageNotReady DatasourceReadyReason = "ImageNotReady"
ClusterImageNotReady DatasourceReadyReason = "ClusterImageNotReady"
)

type ProvisioningPodStartedReason = string

const (
PodNotStarted ProvisioningPodStartedReason = "PodNotStarted"
)

type UserUploadStartedReason = string

const (
NonUploadDataSource UserUploadStartedReason = "NonUploadDataSource"
NotStartedYet UserUploadStartedReason = "NotStartedYet"
)

type ReadyReason = string

const (
BadImageChecksum ReadyReason = "BadImageChecksum"
ImportFailed ReadyReason = "ImportFailed"
)
2 changes: 1 addition & 1 deletion api/core/v1alpha2/finalizers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
FinalizerVMOPProtection = "virtualization.deckhouse.io/vmop-protection"
FinalizerVMCPUProtection = "virtualization.deckhouse.io/vmcpu-protection"

FinalizerCVMICleanup = "virtualization.deckhouse.io/cvi-cleanup"
FinalizerCVICleanup = "virtualization.deckhouse.io/cvi-cleanup"
FinalizerVMICleanup = "virtualization.deckhouse.io/vi-cleanup"
FinalizerVMDCleanup = "virtualization.deckhouse.io/vd-cleanup"
FinalizerVMCleanup = "virtualization.deckhouse.io/vm-cleanup"
Expand Down
32 changes: 17 additions & 15 deletions api/core/v1alpha2/image_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ const (
ImageFailed ImagePhase = "Failed"
ImagePVCLost ImagePhase = "PVCLost"
ImageUnknown ImagePhase = "Unknown"
ImageTerminating ImagePhase = "Terminating"
)

type ImageStatus struct {
DownloadSpeed ImageStatusSpeed `json:"downloadSpeed"`
Size ImageStatusSize `json:"size"`
Format string `json:"format"`
// FIXME: create ClusterImageStatus without Capacity and PersistentVolumeClaim
Capacity string `json:"capacity,omitempty"`
CDROM bool `json:"cdrom"`
Target ImageStatusTarget `json:"target"`
Phase ImagePhase `json:"phase"`
Progress string `json:"progress,omitempty"`
UploadCommand string `json:"uploadCommand,omitempty"`
FailureReason string `json:"failureReason"`
FailureMessage string `json:"failureMessage"`
Format string `json:"format,omitempty"`
// FIXME: create ClusterImageStatus without Capacity and PersistentVolumeClaim.
Capacity string `json:"capacity,omitempty"`
CDROM bool `json:"cdrom,omitempty"`
Target ImageStatusTarget `json:"target"`
Phase ImagePhase `json:"phase,omitempty"`
Progress string `json:"progress,omitempty"`
UploadCommand string `json:"uploadCommand,omitempty"`
// TODO remove.
FailureReason string `json:"failureReason,omitempty"`
FailureMessage string `json:"failureMessage,omitempty"`
}

type ImageStatusSpeed struct {
Expand All @@ -35,14 +37,14 @@ type ImageStatusSpeed struct {
}

type ImageStatusSize struct {
Stored string `json:"stored"`
StoredBytes string `json:"storedBytes"`
Unpacked string `json:"unpacked"`
UnpackedBytes string `json:"unpackedBytes"`
Stored string `json:"stored,omitempty"`
StoredBytes string `json:"storedBytes,omitempty"`
Unpacked string `json:"unpacked,omitempty"`
UnpackedBytes string `json:"unpackedBytes,omitempty"`
}

type ImageStatusTarget struct {
RegistryURL string `json:"registryURL"`
RegistryURL string `json:"registryURL,omitempty"`
// FIXME: create ClusterImageStatus without Capacity and PersistentVolumeClaim
PersistentVolumeClaim string `json:"persistentVolumeClaimName,omitempty"`
}
23 changes: 15 additions & 8 deletions api/core/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f6b7ed5

Please sign in to comment.