Skip to content
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

Avoid setting a default value for completionTimeoutPerGiB #3164

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions api/v1beta1/hyperconverged_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type HyperConvergedSpec struct {

// Live migration limits and timeouts are applied so that migration processes do not
// overwhelm the cluster.
// +kubebuilder:default={"completionTimeoutPerGiB": 800, "parallelMigrationsPerCluster": 5, "parallelOutboundMigrationsPerNode": 2, "progressTimeout": 150, "allowAutoConverge": false, "allowPostCopy": false}
// +kubebuilder:default={"parallelMigrationsPerCluster": 5, "parallelOutboundMigrationsPerNode": 2, "progressTimeout": 150, "allowAutoConverge": false, "allowPostCopy": false}
// +optional
LiveMigrationConfig LiveMigrationConfigurations `json:"liveMigrationConfig,omitempty"`

Expand Down Expand Up @@ -337,8 +337,6 @@ type LiveMigrationConfigurations struct {
// higher completionTimeoutPerGiB to let workload with spikes in its memory dirty
// rate to converge.
// The format is a number.
// +kubebuilder:default=800
// +default=800
// +optional
CompletionTimeoutPerGiB *int64 `json:"completionTimeoutPerGiB,omitempty"`

Expand Down Expand Up @@ -868,7 +866,7 @@ type HyperConverged struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:default={"certConfig": {"ca": {"duration": "48h0m0s", "renewBefore": "24h0m0s"}, "server": {"duration": "24h0m0s", "renewBefore": "12h0m0s"}},"featureGates": {"downwardMetrics": false, "withHostPassthroughCPU": false, "enableCommonBootImageImport": true, "deployTektonTaskResources": false, "deployVmConsoleProxy": false, "deployKubeSecondaryDNS": false, "deployKubevirtIpamController": false, "nonRoot": true, "disableMDevConfiguration": false, "persistentReservation": false, "enableManagedTenantQuota": false, "autoResourceLimits": false, "enableApplicationAwareQuota": false, "primaryUserDefinedNetworkBinding": false}, "liveMigrationConfig": {"completionTimeoutPerGiB": 800, "parallelMigrationsPerCluster": 5, "parallelOutboundMigrationsPerNode": 2, "progressTimeout": 150, "allowAutoConverge": false, "allowPostCopy": false}, "resourceRequirements": {"vmiCPUAllocationRatio": 10}, "uninstallStrategy": "BlockUninstallIfWorkloadsExist", "virtualMachineOptions": {"disableFreePageReporting": false, "disableSerialConsoleLog": true}}
// +kubebuilder:default={"certConfig": {"ca": {"duration": "48h0m0s", "renewBefore": "24h0m0s"}, "server": {"duration": "24h0m0s", "renewBefore": "12h0m0s"}},"featureGates": {"downwardMetrics": false, "withHostPassthroughCPU": false, "enableCommonBootImageImport": true, "deployTektonTaskResources": false, "deployVmConsoleProxy": false, "deployKubeSecondaryDNS": false, "deployKubevirtIpamController": false, "nonRoot": true, "disableMDevConfiguration": false, "persistentReservation": false, "enableManagedTenantQuota": false, "autoResourceLimits": false, "enableApplicationAwareQuota": false, "primaryUserDefinedNetworkBinding": false}, "liveMigrationConfig": {"parallelMigrationsPerCluster": 5, "parallelOutboundMigrationsPerNode": 2, "progressTimeout": 150, "allowAutoConverge": false, "allowPostCopy": false}, "resourceRequirements": {"vmiCPUAllocationRatio": 10}, "uninstallStrategy": "BlockUninstallIfWorkloadsExist", "virtualMachineOptions": {"disableFreePageReporting": false, "disableSerialConsoleLog": true}}
// +optional
Spec HyperConvergedSpec `json:"spec,omitempty"`
Status HyperConvergedStatus `json:"status,omitempty"`
Expand Down
4 changes: 0 additions & 4 deletions api/v1beta1/zz_generated.defaults.go

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

1 change: 0 additions & 1 deletion api/v1beta1/zz_generated.openapi.go

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

3 changes: 0 additions & 3 deletions config/crd/bases/hco.kubevirt.io_hyperconvergeds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ spec:
liveMigrationConfig:
allowAutoConverge: false
allowPostCopy: false
completionTimeoutPerGiB: 800
parallelMigrationsPerCluster: 5
parallelOutboundMigrationsPerNode: 2
progressTimeout: 150
Expand Down Expand Up @@ -2252,7 +2251,6 @@ spec:
default:
allowAutoConverge: false
allowPostCopy: false
completionTimeoutPerGiB: 800
parallelMigrationsPerCluster: 5
parallelOutboundMigrationsPerNode: 2
progressTimeout: 150
Expand Down Expand Up @@ -2284,7 +2282,6 @@ spec:
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
type: string
completionTimeoutPerGiB:
default: 800
description: |-
If a migrating VM is big and busy, while the connection to the destination node
is slow, migration may never converge. The completion timeout is calculated
Expand Down
2 changes: 0 additions & 2 deletions controllers/operands/kubevirt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ Version: 1.2.3`)
mc := foundResource.Spec.Configuration.MigrationConfiguration
Expect(mc).ToNot(BeNil())
Expect(mc.BandwidthPerMigration).To(BeNil())
Expect(*mc.CompletionTimeoutPerGiB).To(Equal(int64(800)))
Expect(*mc.ParallelMigrationsPerCluster).To(Equal(uint32(5)))
Expect(*mc.ParallelOutboundMigrationsPerNode).To(Equal(uint32(2)))
Expect(*mc.ProgressTimeout).To(Equal(int64(150)))
Expand Down Expand Up @@ -544,7 +543,6 @@ Version: 1.2.3`)
mc := foundResource.Spec.Configuration.MigrationConfiguration
Expect(mc).ToNot(BeNil())
Expect(mc.BandwidthPerMigration).To(BeNil())
Expect(*mc.CompletionTimeoutPerGiB).To(Equal(int64(800)))
Expect(*mc.ParallelMigrationsPerCluster).To(Equal(uint32(5)))
Expect(*mc.ParallelOutboundMigrationsPerNode).To(Equal(uint32(2)))
Expect(*mc.ProgressTimeout).To(Equal(int64(150)))
Expand Down
3 changes: 0 additions & 3 deletions deploy/crds/hco00.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ spec:
liveMigrationConfig:
allowAutoConverge: false
allowPostCopy: false
completionTimeoutPerGiB: 800
parallelMigrationsPerCluster: 5
parallelOutboundMigrationsPerNode: 2
progressTimeout: 150
Expand Down Expand Up @@ -2252,7 +2251,6 @@ spec:
default:
allowAutoConverge: false
allowPostCopy: false
completionTimeoutPerGiB: 800
parallelMigrationsPerCluster: 5
parallelOutboundMigrationsPerNode: 2
progressTimeout: 150
Expand Down Expand Up @@ -2284,7 +2282,6 @@ spec:
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
type: string
completionTimeoutPerGiB:
default: 800
description: |-
If a migrating VM is big and busy, while the connection to the destination node
is slow, migration may never converge. The completion timeout is calculated
Expand Down
2 changes: 0 additions & 2 deletions tests/func-tests/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ var _ = Describe("Check Default values", Label("defaults"), Serial, func() {
defaultLiveMigrationConfig := v1beta1.LiveMigrationConfigurations{
AllowAutoConverge: ptr.To(false),
AllowPostCopy: ptr.To(false),
CompletionTimeoutPerGiB: ptr.To(int64(800)),
ParallelMigrationsPerCluster: ptr.To(uint32(5)),
ParallelOutboundMigrationsPerNode: ptr.To(uint32(2)),
ProgressTimeout: ptr.To(int64(150)),
Expand All @@ -136,7 +135,6 @@ var _ = Describe("Check Default values", Label("defaults"), Serial, func() {
},
Entry("when removing /spec/liveMigrationConfig/allowAutoConverge", "/spec/liveMigrationConfig/allowAutoConverge"),
Entry("when removing /spec/liveMigrationConfig/allowPostCopy", "/spec/liveMigrationConfig/allowPostCopy"),
Entry("when removing /spec/liveMigrationConfig/completionTimeoutPerGiB", "/spec/liveMigrationConfig/completionTimeoutPerGiB"),
Entry("when removing /spec/liveMigrationConfig/parallelMigrationsPerCluster", "/spec/liveMigrationConfig/parallelMigrationsPerCluster"),
Entry("when removing /spec/liveMigrationConfig/parallelOutboundMigrationsPerNode", "/spec/liveMigrationConfig/parallelOutboundMigrationsPerNode"),
Entry("when removing /spec/liveMigrationConfig/progressTimeout", "/spec/liveMigrationConfig/progressTimeout"),
Expand Down
Loading