Skip to content

Add StorageProfile "Recognized" status condition#4044

Merged
kubevirt-bot merged 1 commit into
kubevirt:mainfrom
arnongilboa:storageprofile_condition
Mar 10, 2026
Merged

Add StorageProfile "Recognized" status condition#4044
kubevirt-bot merged 1 commit into
kubevirt:mainfrom
arnongilboa:storageprofile_condition

Conversation

@arnongilboa
Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:
Explaining if the provisioner or the storage class parameters are not recognized, so ClaimPropertySets are not auto-filled and need to be specified by the user.

jira-ticket: https://issues.redhat.com/browse/CNV-78356

Release note:

Add StorageProfile "Recognized" status condition, explaining if the provisioner or the storage class parameters are not recognized by CDI

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels Feb 24, 2026
provisionerRecognized, parametersRecognized := storagecapabilities.IsRecognized(sc)
switch {
case provisionerRecognized && parametersRecognized:
updateConditionState(&cond.ConditionState, v1.ConditionTrue, "Provisioner is recognized", reasonRecognizedProvisioner)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

probably want to make these constants as well. Since a condition has both a reason and message field. Just call them xxxReason, and xxxMessage

}

// IsRecognized checks if the storage class provisioner and parameters are recognized so capabilities are available
func IsRecognized(sc *storagev1.StorageClass) (bool, bool) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe just make a type string, that maps onto one of the 3 reasons here. Or define that in the types.go. And have a function that returns the type. Then you can use that in the switch in controller. I don't really like bool, bool return type of this function. It gets really hard to tell what the booleans means.

@arnongilboa arnongilboa force-pushed the storageprofile_condition branch from 7cb4a42 to 5f01627 Compare February 24, 2026 15:58
@arnongilboa arnongilboa force-pushed the storageprofile_condition branch from 5f01627 to eb67528 Compare March 8, 2026 14:52
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 8, 2026

Coverage Status

coverage: 49.407% (+0.04%) from 49.364%
when pulling 63e1575 on arnongilboa:storageprofile_condition
into b17a4d3 on kubevirt:main.

Explaining if the provisioner or the storage class parameters are not
recognized, so ClaimPropertySets are not auto-filled and need to be
specified by the user.

Signed-off-by: Arnon Gilboa <[email protected]>
Co-authored-by: Cursor <[email protected]>
@arnongilboa arnongilboa force-pushed the storageprofile_condition branch from eb67528 to 63e1575 Compare March 8, 2026 18:42
Copy link
Copy Markdown
Member

@awels awels left a comment

Choose a reason for hiding this comment

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

/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 9, 2026
@kubevirt-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: awels

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2026
@awels
Copy link
Copy Markdown
Member

awels commented Mar 9, 2026

/test pull-containerized-data-importer-e2e-ceph-wffc

1 similar comment
@arnongilboa
Copy link
Copy Markdown
Collaborator Author

/test pull-containerized-data-importer-e2e-ceph-wffc

@kubevirt-bot kubevirt-bot merged commit c309762 into kubevirt:main Mar 10, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants