You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(test): fix command to create generic-for-e2e vmclass (#2393)
* refactor(test): optimize vmc precheck run method
- rename defaultVMClassName to requiredVMClassName for clarity
- extract defaultClassAnnotation as constant to avoid duplication
- refactor loop to single pass through vmclasses
- extract getVMClassName helper function to package level
- add comments explaining variables purpose
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
Co-authored-by: Roman Sysoev <roman.sysoev@flant.com>
returnfmt.Errorf("%s=no to disable this precheck: cluster has no default class, e2e tests require %q to be default. Run: kubectl annotate vmclass/%s virtualmachineclass.virtualization.deckhouse.io/is-default-class=true",
returnfmt.Errorf("%s=no to disable this precheck: cluster has no default class and no %q class. Run: kubectl get vmclass/generic -o json | jq 'del(.status) | .metadata.annotations = {\"virtualmachineclass.virtualization.deckhouse.io/is-default-class\":\"true\"}' | kubectl create -f -",
119
-
vmcModuleCheckEnvName, defaultVMClassName)
102
+
// Build issues and fix commands
103
+
varissues, cmds []string
104
+
105
+
// Handle default class issue
106
+
ifdefaultClass!=nil {
107
+
issues=append(issues, fmt.Sprintf("cluster has wrong default vmclass %q", getVMClassName(defaultClass)))
0 commit comments