Skip to content

fix: Project create cmd fix #307

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

Merged
merged 2 commits into from
Mar 11, 2025
Merged

Conversation

rizul2108
Copy link
Collaborator

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

Unverified

This user has not yet uploaded their public signing key.
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
@bupd
Copy link
Collaborator

bupd commented Jan 19, 2025

@rizul2108 please do rebase

Unverified

This user has not yet uploaded their public signing key.
@rizul2108
Copy link
Collaborator Author

@bupd this is okay?

Copy link
Collaborator

@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
Collaborator Author

Can you merge this pr @bupd

@bupd
Copy link
Collaborator

bupd commented Feb 25, 2025

fixes #306

@Vad1mo Vad1mo merged commit 3cff25f into goharbor:main Mar 11, 2025
5 checks passed
@rizul2108 rizul2108 deleted the project-create-fix branch April 18, 2025 04:37
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.

None yet

3 participants