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

WINC-1043: Test upgrading to CSI storage, from in-tree drivers #1705

Merged
merged 4 commits into from Sep 6, 2023

Conversation

sebsoto
Copy link
Contributor

@sebsoto sebsoto commented Jul 25, 2023

Adds various changes required to test upgrading a Windows node from a version of WMCO which supports in-tree storage drivers, to a version that does not.

The changes within Enable upgrading from in-tree to CSI should be reverted when branching for OCP 4.15 occurs, as they will break the tests. Those changes have been labeled with a TODO, and have been purposely been made easily removable.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 25, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 25, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 25, 2023
@sebsoto sebsoto force-pushed the upgradeBlock branch 2 times, most recently from 9d623e6 to e9b35fb Compare July 25, 2023 19:09
@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 25, 2023

/approve cancel

@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 25, 2023

/test vsphere-e2e-upgrade

@openshift-ci openshift-ci bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 25, 2023
@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 25, 2023

/test vsphere-e2e-upgrade

1 similar comment
@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 26, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 26, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 26, 2023

/test vsphere-e2e-upgrade

3 similar comments
@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 26, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 27, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 27, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 31, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 31, 2023

/test vsphere-e2e-upgrade

2 similar comments
@sebsoto
Copy link
Contributor Author

sebsoto commented Jul 31, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 1, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 1, 2023

/test vsphere-e2e-upgrade

3 similar comments
@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 1, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 2, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 2, 2023

/test vsphere-e2e-upgrade

Copy link
Contributor

@saifshaikh48 saifshaikh48 left a comment

Choose a reason for hiding this comment

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

Great work on this, just a few code structure comments

defer func() {
err := tc.client.K8s.CoreV1().PersistentVolumeClaims(tc.workloadNamespace).Delete(context.TODO(),
pvc.GetName(), meta.DeleteOptions{})
log.Printf("error deleting PVC: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

should only print this if err != nil

if err == nil && !skipWorkloadDeletion {
defer func() {
err := tc.deleteDeployment(winServerDeployment.GetName())
log.Printf("error deleting deployment: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Comment on lines +38 to +39
vsphereProvider, ok := tc.CloudProvider.(*vsphere.Provider)
require.True(t, ok, "in tree upgrade must be ran on vSphere")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the cast necessary? We know the cloud provider is vSphere due to the check added on line 24 so doing tc.CloudProvider.CreateInTreePVC() directly should be safe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The cast is necessary in order to use the method, which is specific to the vSphere provider.

Comment on lines +223 to +224
vsphereProvider, ok := tc.CloudProvider.(*vsphere.Provider)
require.True(t, ok, "in tree upgrade must be ran on vSphere")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd prefer checking if cloud provider type is vSphere instead of doing it through a cast

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as above:

The cast is necessary in order to use the method, which is specific to the vSphere provider.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, these comments were only applicable assuming we were to add the methods to the CloudProvider interface

@@ -151,14 +151,23 @@ func (p *Provider) StorageSupport() bool {
return true
}

// CreateInTreePVC creates a PVC which has the potential to be migrated to a CSI PVC on upgrade
func (p *Provider) CreateInTreePVC(client client.Interface, namespace string) (*core.PersistentVolumeClaim, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO any exported method on Provider should be added to the CloudProvider interface and implemented by other providers (even if the implementation is just returning a "sorry, function not supported" error)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would usually agree, but in this case I chose not to make this change as this needs to be reverted after this release, and changes to the interface would make that more complicated.

@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 31, 2023

/test vsphere-e2e-upgrade

Retesting to see whats going on here, failure might be a flake.

@sebsoto
Copy link
Contributor Author

sebsoto commented Sep 5, 2023

/test vsphere-e2e-upgrade

Copy link
Contributor

@saifshaikh48 saifshaikh48 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2023
@mtnbikenc
Copy link
Member

#1733 has merged.
/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 5, 2023
Increases timeout to allow extra time for storage workloads.
Runs a storage workload that is not deleted at the end of the storage
test, in order to test that the workload persists across the upgrade.
Also collects node logs for better debugging.
Deployed pods with a storage mount take a bit longer to delete.
Remove all pods ahead of the deletion test to make timing more
consistent and stop flaking due to this.
Adds test functionality to deploy in-tree PVCs when upgrading from a
WMCO which does not support CSI. This is triggered when the environment
variable `UPGRADE_FROM_IN_TREE` is set to true. This commit should be
reverted in the OCP 4.15 timeline, when there is no longer the
possibility of this scenario.
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2023
@sebsoto
Copy link
Contributor Author

sebsoto commented Sep 5, 2023

/test vsphere-e2e-upgrade

4 similar comments
@sebsoto
Copy link
Contributor Author

sebsoto commented Sep 5, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Sep 5, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Sep 5, 2023

/test vsphere-e2e-upgrade

@sebsoto
Copy link
Contributor Author

sebsoto commented Sep 6, 2023

/test vsphere-e2e-upgrade

@sebsoto sebsoto marked this pull request as ready for review September 6, 2023 12:34
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 6, 2023
@saifshaikh48
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 6, 2023
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 55c20d6 and 2 for PR HEAD 378aa32 in total

@sebsoto
Copy link
Contributor Author

sebsoto commented Sep 6, 2023

/retest-required

1 similar comment
@sebsoto
Copy link
Contributor Author

sebsoto commented Sep 6, 2023

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 6, 2023

@sebsoto: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit e5d47e7 into openshift:master Sep 6, 2023
16 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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants