What steps did you take and what happened:
I tried to port-forward for a pod in VC:
Create a nginx pod in a virtual cluster
Use a command like this kubectl port-forward xxxx 9999:80
Then I got an error:
error: error upgrading connection: pods "xxxx" is forbidden: User "system:serviceaccount:vc-manager:vn-agent" cannot create resource "pods/portForward" in API group "" in the namespace "xxxxx"
What did you expect to happen:
Port-forward command should be succeeded.
What steps did you take and what happened: I tried to port-forward for a pod in VC:
kubectl port-forward xxxx 9999:80
What did you expect to happen: Port-forward command should be succeeded.
Anything else you would like to add: It seems that the
"portForward"
here should be"portforward"
. https://github.com/kubernetes-sigs/cluster-api-provider-nested/blob/cd4b6eb6e248326e6152f7684ac6d25b01fa5fbf/virtualcluster/pkg/vn-agent/server/translate.go#L123-L125I tried to fix this and have tested on my local environment, and it was working.
Environment:
kubectl version
): Super cluster: v1.25.2, Virtual cluster: v1.25.0/etc/os-release
):/kind bug [One or more /area label. See https://github.com/kubernetes-sigs/cluster-api-provider-nested/labels?q=area for the list of labels]