-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix checkup inconsistencies #42
Conversation
arnongilboa
commented
Dec 19, 2024
- Skip checks when no default storage class - the PVC bound and VM checks cannot be executed without default storage class or default virt storage class, so skip them. Also added virt storage class support which was somehow missing.
- Prefer boot sources (official DataImportCrons and OS images) from the OpenShift Virtulization OS images namespace over other namespaces where users may have created test boot sources.
- Do not check PVC existence if VM DV source is snapshot.
The PVC bound and VM checks cannot be executed without default storage class or default virt storage class, so skip them. Added virt storage class support which was somehow missing. Signed-off-by: Arnon Gilboa <[email protected]>
We should prefer the official DataImportCrons and OS images from the OpenShift Virtulization OS images namespace over other namespaces where users may have created test boot sources. Signed-off-by: Arnon Gilboa <[email protected]>
Signed-off-by: Arnon Gilboa <[email protected]>
f388db1
to
1d3ffbd
Compare
pkg/internal/checkup/checkup.go
Outdated
@@ -786,6 +813,13 @@ func (c *Checkup) Config() config.Config { | |||
|
|||
func (c *Checkup) checkVMIBoot(ctx context.Context, errStr *string) error { | |||
log.Print("checkVMIBoot") | |||
|
|||
if c.defaultStorageClass == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you dont need to also check: && c.checkupConfig.StorageClass == ""
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right!
pkg/internal/checkup/checkup.go
Outdated
@@ -980,6 +1014,12 @@ func (c *Checkup) checkConcurrentVMIBoot(ctx context.Context, errStr *string) er | |||
numOfVMs := c.checkupConfig.NumOfVMs | |||
log.Printf("checkConcurrentVMIBoot numOfVMs:%d", numOfVMs) | |||
|
|||
if c.defaultStorageClass == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same answer:)
reporter.VMBootFromGoldenImageKey: checkup.MessageSkipNoDefaultStorageClass, | ||
reporter.ConcurrentVMBootKey: checkup.MessageSkipNoDefaultStorageClass, | ||
}, | ||
expectedErr: checkup.ErrNoDefaultStorageClass, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt you add also virt storage class tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I should :)
ns := namespaces.Items[i].Name | ||
if err := c.checkDataImportCrons(ctx, ns, &cs); err != nil { | ||
|
||
if ns, err := c.client.GetNamespace(ctx, defaultGoldenImagesNamespace); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question, dont you get in the namespaces list also "openshift-virtualization-os-images"? if so why do you need this commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to prefer it over other namespaces if we have DataImportCrons there, but use DICs from the other namespaces if not. It can be written as a single loop but it will be a bit more clumsy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see that inside checkDataImportCrons you eventually update some values so now I understand
Signed-off-by: Arnon Gilboa <[email protected]>
Signed-off-by: Arnon Gilboa <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve