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

Fix checkup inconsistencies #42

Merged
merged 5 commits into from
Dec 25, 2024

Conversation

arnongilboa
Copy link
Collaborator

  • 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]>
@@ -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 == "" {
Copy link
Collaborator

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 == "" ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right!

@@ -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 == "" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question

Copy link
Collaborator Author

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,
},
Copy link
Collaborator

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?

Copy link
Collaborator Author

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 {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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

Copy link
Collaborator

@ShellyKa13 ShellyKa13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@arnongilboa arnongilboa merged commit 5d60ff1 into kiagnose:main Dec 25, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants