You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnerrors.New(ErrCreateDirCode, errors.Alert, []string{fmt.Sprintf("error creating directory at %s", filepath)}, []string{err.Error()}, []string{"invalid path provided", "insufficient permissions"}, []string{"provide a valid path", "retry by using an absolute path", "check for sufficient permissions for the user"})
152
156
}
153
157
158
+
funcErrConvertToByte(errerror) error {
159
+
returnerrors.New(ErrConvertToByteCode, errors.Alert, []string{("error converting data to []byte")}, []string{err.Error()}, []string{"Unsupported data types", "invalid configuration data", "failed serialization of data"}, []string{"check for any custom types in the data that might not be serializable", "Verify that the data type being passed is valid for conversion to []byte"})
returnerrors.New(ErrApplyHelmChartCode, errors.Alert, []string{"Error applying helm chart"}, []string{err.Error()}, []string{"Chart could be invalid"}, []string{"Make sure to apply valid chart"})
52
53
}
53
54
54
-
// ErrApplyHelmChart is the error which occurs in the process of applying helm chart
55
+
// ErrNewKubeClient is the error which occurs when creating a new Kubernetes clientset
55
56
funcErrNewKubeClient(errerror) error {
56
57
returnerrors.New(ErrNewKubeClientCode, errors.Alert, []string{"Error creating kubernetes clientset"}, []string{err.Error()}, []string{"Kubernetes config is not accessible to meshery or not valid"}, []string{"Upload your kubernetes config via the settings dashboard. If uploaded, wait for a minute for it to get initialized"})
57
58
}
58
59
59
-
// ErrApplyHelmChart is the error which occurs in the process of applying helm chart
60
+
// ErrNewDynClient is the error which occurs when creating a new dynamic client
60
61
funcErrNewDynClient(errerror) error {
61
62
returnerrors.New(ErrNewDynClientCode, errors.Alert, []string{"Error creating dynamic client"}, []string{err.Error()}, []string{"Kubernetes config is not accessible to meshery or not valid"}, []string{"Upload your kubernetes config via the settings dashboard. If uploaded, wait for a minute for it to get initialized"})
62
63
}
63
64
64
-
// ErrApplyHelmChart is the error which occurs in the process of applying helm chart
65
+
// ErrNewDiscovery is the error which occurs when creating a new discovery client
65
66
funcErrNewDiscovery(errerror) error {
66
67
returnerrors.New(ErrNewDiscoveryCode, errors.Alert, []string{"Error creating discovery client"}, []string{err.Error()}, []string{"Discovery resource is invalid or doesnt exist"}, []string{"Makes sure the you input valid resource for discovery"})
67
68
}
68
69
69
-
// ErrApplyHelmChart is the error which occurs in the process of applying helm chart
70
+
// ErrNewInformer is the error which occurs when creating a new informer
70
71
funcErrNewInformer(errerror) error {
71
72
returnerrors.New(ErrNewInformerCode, errors.Alert, []string{"Error creating informer client"}, []string{err.Error()}, []string{"Informer is invalid or doesnt exist"}, []string{"Makes sure the you input valid resource for the informer"})
returnerrors.New(ErrHelmRepositoryNotFoundCode, errors.Alert, []string{"Helm repo not found"}, []string{fmt.Sprintf("either the repo %s does not exists or is corrupt: %v", repo, err)}, []string{}, []string{})
102
103
}
104
+
105
+
// ErrRestConfigFromKubeConfig returns an error when failing to create a REST config from a kubeconfig file.
106
+
funcErrRestConfigFromKubeConfig(errerror) error {
107
+
returnerrors.New(ErrRestConfigFromKubeConfigCode,
108
+
errors.Alert,
109
+
[]string{"Failed to create REST config from kubeconfig."},
110
+
[]string{fmt.Sprintf("Error occured while creating REST config from kubeconfig: %s", err.Error())},
111
+
[]string{
112
+
"The provided kubeconfig data might be invalid or corrupted.",
113
+
"The kubeconfig might be incomplete or missing required fields."},
114
+
[]string{
115
+
"Verify that the kubeconfig data is valid.",
116
+
"Ensure the kubeconfig contains all necessary cluster, user, and context information.",
117
+
"Check if the kubeconfig data was properly read and passed to the function."},
0 commit comments