From 5352dcdaa7e0218f2ff3432bf1fbb5d94e2e3273 Mon Sep 17 00:00:00 2001 From: abdullah1308 Date: Sat, 26 Aug 2023 01:47:17 +0530 Subject: [PATCH 1/2] Updates error messages for kubeconfig permission Signed-off-by: abdullah1308 --- models/controllers/error.go | 2 +- utils/error.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/controllers/error.go b/models/controllers/error.go index dc56fab2..f73353ad 100644 --- a/models/controllers/error.go +++ b/models/controllers/error.go @@ -15,7 +15,7 @@ func ErrGetControllerStatus(err error) error { } func ErrDeployController(err error) error { - return errors.New(ErrDeployControllerCode, errors.Alert, []string{"Error deploying meshery controller"}, []string{err.Error()}, []string{"Controller configuration may not be valid"}, []string{"Make sure the controller configuration is valid"}) + return errors.New(ErrDeployControllerCode, errors.Alert, []string{"Error deploying meshery controller"}, []string{err.Error()}, []string{"Controller configuration may not be valid", "Insufficient permissions to read kubernetes config"}, []string{"Make sure the controller configuration is valid and the kubernetes config has sufficient read permissions"}) } func ErrGetControllerPublicEndpoint(err error) error { diff --git a/utils/error.go b/utils/error.go index cc1252d7..891123f5 100644 --- a/utils/error.go +++ b/utils/error.go @@ -95,7 +95,7 @@ func ErrReadingRemoteFile(err error) error { } func ErrReadingLocalFile(err error) error { - return errors.New(ErrReadingLocalFileCode, errors.Alert, []string{"error reading local file"}, []string{err.Error()}, []string{"File doesnt exist in the location", "File name is incorrect"}, []string{"Make sure to input the right file name and location"}) + return errors.New(ErrReadingLocalFileCode, errors.Alert, []string{"error reading local file"}, []string{err.Error()}, []string{"File doesnt exist in the location", "File name is incorrect", "Insufficient permissions to read file"}, []string{"Make sure to input the right file name and location. Check file permissions"}) } func ErrGettingLatestReleaseTag(err error) error { From 0e6bf4effea78fe8ad584016677b33240f9252a6 Mon Sep 17 00:00:00 2001 From: Lee Calcote Date: Mon, 28 Aug 2023 14:02:35 -0500 Subject: [PATCH 2/2] Enhanced error messages Signed-off-by: Lee Calcote --- models/controllers/error.go | 2 +- utils/error.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/controllers/error.go b/models/controllers/error.go index f73353ad..ece218aa 100644 --- a/models/controllers/error.go +++ b/models/controllers/error.go @@ -15,7 +15,7 @@ func ErrGetControllerStatus(err error) error { } func ErrDeployController(err error) error { - return errors.New(ErrDeployControllerCode, errors.Alert, []string{"Error deploying meshery controller"}, []string{err.Error()}, []string{"Controller configuration may not be valid", "Insufficient permissions to read kubernetes config"}, []string{"Make sure the controller configuration is valid and the kubernetes config has sufficient read permissions"}) + return errors.New(ErrDeployControllerCode, errors.Alert, []string{"Error deploying Meshery Operator"}, []string{err.Error()}, []string{"Meshery Server could not connect to the Kubernetes cluster. Meshery Operator was not deployed", "Insufficient file permission to read kubeconfig"}, []string{"Verify that the available kubeconfig is accessible by Meshery Server - verify sufficient file permissions (only needs read permission)"}) } func ErrGetControllerPublicEndpoint(err error) error { diff --git a/utils/error.go b/utils/error.go index 891123f5..d5160f00 100644 --- a/utils/error.go +++ b/utils/error.go @@ -95,7 +95,7 @@ func ErrReadingRemoteFile(err error) error { } func ErrReadingLocalFile(err error) error { - return errors.New(ErrReadingLocalFileCode, errors.Alert, []string{"error reading local file"}, []string{err.Error()}, []string{"File doesnt exist in the location", "File name is incorrect", "Insufficient permissions to read file"}, []string{"Make sure to input the right file name and location. Check file permissions"}) + return errors.New(ErrReadingLocalFileCode, errors.Alert, []string{"error reading local file"}, []string{err.Error()}, []string{"File does not exist in the location (~/.kube/config)", "File is absent. Filename is not 'config'.", "Insufficient permissions to read file"}, []string{"Verify that the available kubeconfig is accessible by Meshery Server - verify sufficient file permissions (only needs read permission)."}) } func ErrGettingLatestReleaseTag(err error) error {