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

CNV-32485: Use cluster-wise eviction strategy configuration #1554

Merged

Conversation

upalatucci
Copy link
Member

@upalatucci upalatucci commented Sep 19, 2023

📝 Description

EvictionStrategy on 4.14 can be configured cluster-wise using the Hyperconverge configuration

When VM does not specify an evictionStrategy, the vmi will be created with the configured strategy.

This means that on other screens like the schedule tab, when we show 'No eviction strategy' we have to show the cluster strategy.

Steps:

  1. create a common hook to fetch cluster configuration
  2. edit pending changes considering the cluster configuration
  3. Create a common component to show the EvictionStrategy in all the schedule tab that use the cluster configuration (other than the template schedule tab with its specific component)
  4. on checkbox uncheck, set the evictionStrategy to None instead of deleting it. Deleting the strategy means 'Use the cluster strategy'

🎥 Demo

Before

Screenshot from 2023-09-19 14-05-34
Screenshot from 2023-09-19 14-05-28

After

reading from the cluster configuration

Screenshot from 2023-09-19 14-04-48
Screenshot from 2023-09-19 14-04-42

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Sep 19, 2023

@upalatucci: This pull request references CNV-32485 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.15.0" version, but no target version was set.

In response to this:

📝 Description

EvictionStrategy on 4.14 can be configured cluster-wise using the Hyperconverge configuration

When VM does not specify an evictionStrategy, the vmi will be created with the configured strategy.

This means that on other screens like the schedule tab, when we show 'No eviction strategy' we have to show the cluster strategy.

🎥 Demo

Before

Screenshot from 2023-09-19 14-05-34
Screenshot from 2023-09-19 14-05-28

After

reading from the cluster configuration

Screenshot from 2023-09-19 14-04-48
Screenshot from 2023-09-19 14-04-42

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the approved This issue is something we want to fix label Sep 19, 2023
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Sep 19, 2023

@upalatucci: This pull request references CNV-32485 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.15.0" version, but no target version was set.

In response to this:

📝 Description

EvictionStrategy on 4.14 can be configured cluster-wise using the Hyperconverge configuration

When VM does not specify an evictionStrategy, the vmi will be created with the configured strategy.

This means that on other screens like the schedule tab, when we show 'No eviction strategy' we have to show the cluster strategy.

Steps:

  1. create a common hook to fetch cluster configuration
  2. edit pending changes considering the cluster configuration
  3. Create a common component to show the EvictionStrategy in all the schedule tab that use the cluster configuration (other than the template schedule tab)
  4. on checkbox uncheck, set the evictionStrategy to None instead of deleting it. Deleting the strategy means 'Use the cluster strategy'

🎥 Demo

Before

Screenshot from 2023-09-19 14-05-34
Screenshot from 2023-09-19 14-05-28

After

reading from the cluster configuration

Screenshot from 2023-09-19 14-04-48
Screenshot from 2023-09-19 14-04-42

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Sep 19, 2023

@upalatucci: This pull request references CNV-32485 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.15.0" version, but no target version was set.

In response to this:

📝 Description

EvictionStrategy on 4.14 can be configured cluster-wise using the Hyperconverge configuration

When VM does not specify an evictionStrategy, the vmi will be created with the configured strategy.

This means that on other screens like the schedule tab, when we show 'No eviction strategy' we have to show the cluster strategy.

Steps:

  1. create a common hook to fetch cluster configuration
  2. edit pending changes considering the cluster configuration
  3. Create a common component to show the EvictionStrategy in all the schedule tab that use the cluster configuration (other than the template schedule tab with its specific component)
  4. on checkbox uncheck, set the evictionStrategy to None instead of deleting it. Deleting the strategy means 'Use the cluster strategy'

🎥 Demo

Before

Screenshot from 2023-09-19 14-05-34
Screenshot from 2023-09-19 14-05-28

After

reading from the cluster configuration

Screenshot from 2023-09-19 14-04-48
Screenshot from 2023-09-19 14-04-42

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

return;
}

setChecked(EVICTION_STRATEGY_DEFAULT === EVICTION_STRATEGIES.LiveMigrate);
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Member Author

@upalatucci upalatucci Sep 19, 2023

Choose a reason for hiding this comment

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

If the vm and the hyperconverge do not have a strategy, make it true.
I can even use true directly

I should use that outside the useEffect and as a default value of the useState btw

Copy link
Member

@pcbailey pcbailey left a comment

Choose a reason for hiding this comment

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

It's looking great! I just had a few small suggestions.

@upalatucci
Copy link
Member Author

/retest

@pcbailey
Copy link
Member

Looks good to me. I'd like for @metalice to take another look, though.

@metalice
Copy link
Member

/lgtm
/retest

@openshift-ci openshift-ci bot added the lgtm Passed code review, ready for merge label Sep 19, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: metalice, upalatucci

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [metalice,upalatucci]

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

@pcbailey
Copy link
Member

/retest

1 similar comment
@metalice
Copy link
Member

/retest

@openshift-merge-robot openshift-merge-robot merged commit a607a94 into kubevirt-ui:main Sep 20, 2023
8 checks passed
@gouyang
Copy link
Member

gouyang commented Sep 20, 2023

/cherry-pick release-4.14

@openshift-cherrypick-robot
Copy link
Collaborator

@gouyang: #1554 failed to apply on top of branch "release-4.14":

Applying: Use cluster-wise eviction strategy configuration
Using index info to reconstruct a base tree...
M	src/utils/components/PendingChanges/utils/helpers.ts
M	src/utils/resources/vm/utils/selectors.ts
M	src/utils/resources/vmi/utils/selectors.ts
Falling back to patching base and 3-way merge...
Removing src/views/virtualmachines/details/tabs/configuration/scheduling/components/EvictionStrategy.tsx
Removing src/views/catalog/wizard/tabs/scheduling/components/EvictionStrategy.tsx
Auto-merging src/utils/resources/vmi/utils/selectors.ts
Auto-merging src/utils/resources/vm/utils/selectors.ts
CONFLICT (content): Merge conflict in src/utils/resources/vm/utils/selectors.ts
Auto-merging src/utils/components/PendingChanges/utils/helpers.ts
CONFLICT (content): Merge conflict in src/utils/components/PendingChanges/utils/helpers.ts
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Use cluster-wise eviction strategy configuration
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.14

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This issue is something we want to fix jira/valid-reference lgtm Passed code review, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants