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

ecctl: Prefix config parsing error #254

Conversation

marclop
Copy link
Collaborator

@marclop marclop commented Apr 7, 2020

Description

This change changes the ecctl.<struct>.Validate() funcitons
multierrors to use cloud-sdk-go/pkg/multierror.Prefixed to improve the
quality of our errors to always use prefixes.

Additionally, changes the behavior when the ecctl.App fails to be
initialized and the config file used is empty (unexisting, or failed to
read) to throw an error which instructs the user to run "ecctl init".

Related Issues

Resolves #223.
Resolves #220.

How Has This Been Tested?

$ ecctl user
uninitialized ecctl config file, please use "ecctl init" to initialize it: 1 error occurred:
    * invalid configuration options specified: apikey or user and pass must be specified

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)

This change changes the `ecctl.<struct>.Validate()` funcitons
multierrors to use `cloud-sdk-go/pkg/multierror.Prefixed` to improve the
quality of our errors to always use prefixes.

Additionally, changes the behavior when the ecctl.App fails to be
initialized and the config file used is empty (unexisting, or failed to
read) to throw an error which instructs the user to run "ecctl init".

Resolves elastic#223.

Signed-off-by: Marc Lopez <marc5.12@outlook.com>
@marclop marclop added bug Something isn't working loe:small labels Apr 7, 2020
@marclop marclop added this to the 38: Mar 18 - Apr 7 milestone Apr 7, 2020
@marclop marclop requested a review from a team as a code owner April 7, 2020 07:56
@marclop marclop self-assigned this Apr 7, 2020
@marclop marclop requested a review from Kushmaro April 7, 2020 07:56
cmd/root.go Outdated Show resolved Hide resolved
Signed-off-by: Marc Lopez <marc5.12@outlook.com>
Copy link
Contributor

@karencfv karencfv left a comment

Choose a reason for hiding this comment

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

Just the bit about formatting the import block, otherwise looks good!

cmd/root_test.go Outdated Show resolved Hide resolved
Signed-off-by: Marc Lopez <marc5.12@outlook.com>
@marclop marclop merged commit 4cc6cce into elastic:master Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants