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

Velero v1.12.0 has no auth provider found for name "oidc" #6933

Closed
ksudarsh00 opened this issue Oct 9, 2023 · 7 comments · Fixed by #6947
Closed

Velero v1.12.0 has no auth provider found for name "oidc" #6933

ksudarsh00 opened this issue Oct 9, 2023 · 7 comments · Fixed by #6947
Assignees

Comments

@ksudarsh00
Copy link

What steps did you take and what happened:

Velero server version: v1.12.0
Velero client version: v1.12.0
Velero client was not able to connect to Velero server when the auth provider is "oidc"

Ran velero --version command and it threw an error "An error occurred: no Auth Provider found for name "oidc""

Velero v1.11.* are working fine when the auth provider is oidc but not working in v1.12.0

Upon debuggging I found out that pkg/client/auth_providers.go is present in v1.11.* but is removed in v1.12.0
v1.11.1 : https://github.com/vmware-tanzu/velero/blob/v1.11.1/pkg/client/auth_providers.go
v1.12.0: https://github.com/vmware-tanzu/velero/tree/v1.12.0/pkg/client

What did you expect to happen:

Velero client should be able to connect to Velero server and should display the client and server versions

The following information will help us better understand what's going on:

If you are using velero v1.7.0+:
Please use velero debug --backup <backupname> --restore <restorename> to generate the support bundle, and attach to this issue, more options please refer to velero debug --help

If you are using earlier versions:
Please provide the output of the following commands (Pasting long output into a GitHub gist or other pastebin is fine.)

  • kubectl logs deployment/velero -n velero
  • velero backup describe <backupname> or kubectl get backup/<backupname> -n velero -o yaml
  • velero backup logs <backupname>
  • velero restore describe <restorename> or kubectl get restore/<restorename> -n velero -o yaml
  • velero restore logs <restorename>

Anything else you would like to add:

Environment:

  • Velero version (use velero version):
  • Velero features (use velero client config get features):
  • Kubernetes version (use kubectl version):
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

  • 👍 for "I would like to see this bug fixed as soon as possible"
  • 👎 for "There are more important bugs to focus on right now"
@draghuram
Copy link
Contributor

See the related thread in Slack: https://kubernetes.slack.com/archives/C6VCGP4MT/p1695924642015059

@draghuram
Copy link
Contributor

We will take a look at this issue at CloudCasa. Please assign to @0x113.

@antrema
Copy link

antrema commented Oct 11, 2023

One solution that work for me:
Add the following import '_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"' in the appropriate section to the file "pkg/client/client.go"

import (
	"fmt"
	"runtime"

	"github.com/pkg/errors"
	"k8s.io/client-go/rest"
	"k8s.io/client-go/tools/clientcmd"

	"github.com/vmware-tanzu/velero/pkg/buildinfo"
	_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
)

And rebuild the CLI:

go build -o bin/velero cmd/velero/velero.go

@ksudarsh00
Copy link
Author

ksudarsh00 commented Oct 11, 2023

This import is present in v1.11.* in auth_providers.go file but is removed in v1.12.0 any reason for that? and the removal is intentional or by mistake? and when will this change be released in v1.12?

@0x113
Copy link
Contributor

0x113 commented Oct 11, 2023

I was able to reproduce the issue with the OIDC auth provider. Will create a Pull Request with a fix shortly.

@ksudarsh00
Copy link
Author

Great!!

@blackpiglet
Copy link
Contributor

Sorry for the inconvenience, and thanks for reporting and fixing this issue.

The needed file was deleted during fixing revive linter errors.
It was used to resolve the blank import warning reported by the revive.
I thought that file was not used, so deleted it.

import (
	_ "k8s.io/client-go/plugin/pkg/client/auth/azure"
	_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
	_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
)

ywk253100 added a commit that referenced this issue Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants