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: Project create cmd fix #307

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rizul2108
Copy link
Contributor

This PR fixes issue #306

There was error in this below function
https://github.com/goharbor/harbor-cli/blob/8dd8abb21c626fca3cb8488d027bb71c120967b0/pkg/utils/config.go#L171C1-L180C1
here we were creating a new viper client using viper.new and everywhere v as new client has been used instead viper should be used as it acts a global client for whole project and if v was used it acted as a local new client for that function only and because of this new client the current-credential-name string in below line was found to be empty as it had no context of the global configurations

credentialName := viper.GetString("current-credential-name")

So I removed viper.new and v and used viper directly in that function and now the create command works properly as expected

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
@bupd
Copy link
Contributor

bupd commented Jan 19, 2025

@rizul2108 please do rebase

@rizul2108
Copy link
Contributor Author

@bupd this is okay?

Copy link
Contributor

@bupd bupd left a comment

Choose a reason for hiding this comment

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

lgtm

@rizul2108
Copy link
Contributor Author

Can you merge this pr @bupd

@bupd
Copy link
Contributor

bupd commented Feb 25, 2025

fixes #306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants