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

neonvm: drop generated default value in CRD #1313

Merged
merged 2 commits into from
Mar 11, 2025
Merged
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
1 change: 1 addition & 0 deletions neonvm-controller/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ spec:
- "--concurrency-limit=128"
- "--skip-update-validation-for="
- "--disable-runner-cgroup"
- "--default-cpu-scaling-mode=QmpScaling"
# See #775 and its links.
# * cache.writeback=on - don't set O_DSYNC (don't flush every write)
# * cache.direct=on - use O_DIRECT (don't abuse host's page cache!)
Expand Down
3 changes: 1 addition & 2 deletions neonvm/apis/neonvm/v1/virtualmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ type VirtualMachineSpec struct {
TargetRevision *RevisionWithTime `json:"targetRevision,omitempty"`

// Controls how CPU scaling is performed, either hotplug new CPUs with QMP, or enable them in sysfs.
// +kubebuilder:default:=QmpScaling
// +optional
CpuScalingMode *CpuScalingMode `json:"cpuScalingMode,omitempty"`

Expand Down Expand Up @@ -243,7 +242,7 @@ func (p *CpuScalingMode) FlagFunc(value string) error {
string(CpuScalingModeSysfs),
}

if !slices.Contains(possibleValues, value) {
if !slices.Contains(possibleValues, value) || value == "" {
return fmt.Errorf("Unknown CpuScalingMode %q, must be one of %v", value, possibleValues)
}

Expand Down
1 change: 0 additions & 1 deletion neonvm/config/crd/bases/vm.neon.tech_virtualmachines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,6 @@ spec:
type: object
type: object
cpuScalingMode:
default: QmpScaling
description: Controls how CPU scaling is performed, either hotplug
new CPUs with QMP, or enable them in sysfs.
enum:
Expand Down
Loading