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 API related CMDS crash on wrong apikey #486

Merged
merged 2 commits into from
Jan 2, 2025
Merged

fix API related CMDS crash on wrong apikey #486

merged 2 commits into from
Jan 2, 2025

Conversation

uzaxirr
Copy link
Member

@uzaxirr uzaxirr commented Dec 18, 2024

fixes: #464

Previously, the loadConfig function always attempted to fetch regionsToFeature(which calls the GET regions API) , even for commands that didn’t need this data (e.g., civo apikey remove).

If the saved API key was invalid, this API call would fail, causing the entire command to break.
By introducing the SkipAPIInitialization flag, commands can signal that API-dependent logic should be skipped, avoiding unnecessary API interactions for the cmds that dont require interaction with API

@uzaxirr uzaxirr self-assigned this Dec 18, 2024
config/config.go Outdated Show resolved Hide resolved
Co-authored-by: Harsh Thakur <[email protected]>
@uzaxirr uzaxirr merged commit 7dc05b6 into master Jan 2, 2025
1 check passed
@uzaxirr uzaxirr deleted the fix-hang branch January 2, 2025 14: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.

Can't remove a wrong Apikey through civo cli
3 participants