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

feat: use config value if no address passed to login command #1975

Merged
merged 3 commits into from
May 8, 2024

Conversation

devholic
Copy link
Contributor

@devholic devholic commented May 8, 2024

Fixes #1974

This commit uses the address in config if no address is passed to the login command.

Copy link

netlify bot commented May 8, 2024

Deploy Preview for docs-kargo-akuity-io ready!

Name Link
🔨 Latest commit 79629c2
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/663b5054cf2c97000969057f
😎 Deploy Preview https://deploy-preview-1975.kargo.akuity.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


cmd := &cobra.Command{
Use: "login SERVER_ADDRESS (--admin | --kubeconfig | --sso)",
Args: option.ExactArgs(1),
Use: "login [SERVER_ADDRESS] (--admin | --kubeconfig | --sso)",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would it better to show config address like below?

Suggested change
Use: "login [SERVER_ADDRESS] (--admin | --kubeconfig | --sso)",
Use: "login [SERVER_ADDRESS | <default address here>] (--admin | --kubeconfig | --sso)",

Copy link
Contributor

Choose a reason for hiding this comment

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

The current is fine, as the default address is not actually being used as an argument but as a fallback.

Instead, it may be better to instruct people how to make use of the default address in the Example section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an example for omitted server address: c327f72

Copy link

codecov bot commented May 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 46.21%. Comparing base (aaa7e05) to head (79629c2).

Files Patch % Lines
internal/cli/cmd/login/login.go 0.00% 10 Missing ⚠️
internal/cli/option/option.go 0.00% 7 Missing ⚠️
cmd/cli/root.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1975      +/-   ##
==========================================
- Coverage   46.25%   46.21%   -0.04%     
==========================================
  Files         235      235              
  Lines       16005    16017      +12     
==========================================
  Hits         7403     7403              
- Misses       8242     8254      +12     
  Partials      360      360              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@devholic devholic requested a review from hiddeco May 8, 2024 05:37
devholic pushed a commit that referenced this pull request May 8, 2024
Copy link
Contributor

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

LGTM!

@devholic devholic enabled auto-merge May 8, 2024 10:06
@devholic devholic disabled auto-merge May 8, 2024 10:07
Sunghoon Kang and others added 3 commits May 8, 2024 19:13
Fixes #1974

This commit uses the address in config if no address is passed to the
login command.

Signed-off-by: Sunghoon Kang <hoon@akuity.io>
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
@devholic devholic enabled auto-merge May 8, 2024 10:13
@devholic devholic added this pull request to the merge queue May 8, 2024
Merged via the queue into main with commit a1ce4ab May 8, 2024
13 of 16 checks passed
@devholic devholic deleted the hoon/#1974 branch May 8, 2024 10:25
@hiddeco hiddeco added this to the v0.7.0 milestone May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kargo CLI should infer options from the ~/.config/kargo/config file
2 participants