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

Malformed Info log String in authmanager.go #3110

Open
scranshoff opened this issue Nov 18, 2024 · 0 comments
Open

Malformed Info log String in authmanager.go #3110

scranshoff opened this issue Nov 18, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@scranshoff
Copy link
Contributor

Is this a BUG REPORT or FEATURE REQUEST?:

/kind bug

What happened:

Malformed Info log string in authmanager.go occurs because of bad string concatenation.

Example output:

{"level":"info","time":"2024-11-14T17:22:56.632405175Z","caller":"common/authmanager.go:472","msg":"auth manager: user vcenter.example.local on vCenter [{{} "ClusterComputeResource:domain-c8" [{{} "Host.Config.Storage" %!q(bool=false)}]}] doesn't have privileges for any ClusterComputeResource. HasUserPrivilegeOnEntities returns [Host.Config.Storage], when checking privileges [ClusterComputeResource:domain-c13] on entities %!v(MISSING).user@example.local","TraceId":"50a0d607-5fd0-460c-a2fc-0729cbdfa6aa"}

What you expected to happen:

Variables to be correctly placed in the Info log string

Example output:

{"level":"info","time":"2024-11-14T17:22:56.632405175Z","caller":"common/authmanager.go:472","msg":"auth manager: user user@example.local on vCenter vcenter.example.local doesn't have privileges for any ClusterComputeResource. HasUserPrivilegeOnEntities returns [{{} "ClusterComputeResource:domain-c13" [{{} "Host.Config.Storage" %!q(bool=false)}]}] , when checking privileges [Host.Config.Storage] on entities [ClusterComputeResource:domain-c13].","TraceId":"50a0d607-5fd0-460c-a2fc-0729cbdfa6aa"}

How to reproduce it (as minimally and precisely as possible):

To reproduce:

  • Do not assign "Host.Config.Storage" Permissions to the user specified in the vsphere-csi-config-secret secret
  • Attempt to create a PVC with RWX capabilities
  • Check the logs of the controller for the above info log

Anything else we need to know?:

Environment:

  • csi-vsphere version: 3.3.0
  • vsphere-cloud-controller-manager version: ANY
  • Kubernetes version: ANY
  • vSphere version: ANY
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants