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: GenerateDatastoreMapForBlockVolumes fails if there are no entities #2443

Conversation

Mattes83
Copy link
Contributor

What this PR does / why we need it:
We have a multi vcenter setup in which all datastores are currently in only one vcenter.
This leads to many errors like the following:
{"level":"error","time":"2023-06-22T11:14:01.916433945Z","caller":"common/authmanager.go:247","msg":"failed to get datastores with required priv for vCenter \"xxx\". Error: ServerFaultCode: \nRequired parameter entities is missing\n\nwhile parsing call information for method HasUserPrivilegeOnEntities\nat line 2, column 66\n\nwhile parsing SOAP body\nat line 2, column 60\n\nwhile parsing SOAP envelope\nat line 2, column 0\n\nwhile parsing HTTP request for method hasUserPrivilegeOnEntities\non object of type vim.AuthorizationManager\nat line 1, column 0","TraceId":"2b45f0db-1d50-4299-9f15-f6a34f8807ec","stacktrace":"sigs.k8s.io/vsphere-csi-driver/v3/pkg/csi/service/common.GenerateDatastoreMapForBlockVolumes\n\t/build/pkg/csi/service/common/authmanager.go:247\nsigs.k8s.io/vsphere-csi-driver/v3/pkg/csi/service/common.(*AuthManager).refreshDatastoreMapForBlockVolumes\n\t/build/pkg/csi/service/common/authmanager.go:158\nsigs.k8s.io/vsphere-csi-driver/v3/pkg/csi/service/common.ComputeDatastoreMapForBlockVolumes\n\t/build/pkg/csi/service/common/authmanager.go:199"} {"level":"warn","time":"2023-06-22T11:14:01.916459756Z","caller":"common/authmanager.go:166","msg":"auth manager: failed to get updated datastoreMapForBlockVolumes for vCenter \"xxx\", Err: ServerFaultCode: \nRequired parameter entities is missing\n\nwhile parsing call information for method HasUserPrivilegeOnEntities\nat line 2, column 66\n\nwhile parsing SOAP body\nat line 2, column 60\n\nwhile parsing SOAP envelope\nat line 2, column 0\n\nwhile parsing HTTP request for method hasUserPrivilegeOnEntities\non object of type vim.AuthorizationManager\nat line 1, column 0","TraceId":"2b45f0db-1d50-4299-9f15-f6a34f8807ec"}

We also suspect this to be responsible for the need to restart the csi vsphere controller from time to time to get volumes provisioned.

Testing done:
Not sure if I need to write a test for this. If yes i'd appreciate a hint on where to add it.
Special notes for your reviewer:

Release note:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 22, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @Mattes83. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 22, 2023
@divyenpatel
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 22, 2023
@shalini-b
Copy link
Collaborator

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 22, 2023
@divyenpatel
Copy link
Member

@Mattes83 we are trying to understand the usecase. So you have just added another vCenter in the config secret and at later point of time, planning to add nodes and datastores?

@Mattes83
Copy link
Contributor Author

Mattes83 commented Jun 23, 2023

Yes, exactly. We are currently in the process of migrating clusters from one vcenter to another. In between we have nodes in multiple vcenters.
At the beginning and at the end of the migration we have credentials for both vcenters inside the cluster, but nodes and datastores are only in one vcenter.
Of course this can be solved by removing the not needed config, but there may be a timeframe in which there are credentials for unused vcenters

Copy link
Member

@divyenpatel divyenpatel left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 23, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyenpatel, Mattes83, shalini-b

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 [divyenpatel,shalini-b]

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

@k8s-ci-robot k8s-ci-robot merged commit 6426480 into kubernetes-sigs:master Jun 23, 2023
13 checks passed
shalini-b added a commit to shalini-b/vsphere-csi-driver that referenced this pull request Jun 23, 2023
k8s-ci-robot pushed a commit that referenced this pull request Jun 23, 2023
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/vmware-vsphere-csi-driver that referenced this pull request Jul 19, 2023
rajguptavm pushed a commit to rajguptavm/vsphere-csi-driver that referenced this pull request Jul 20, 2023
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-3.0.2-candidate release-3.0.2-cherry-picked size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants