Skip to content

Commit 2fe097f

Browse files
committed
Refactor discovery error handling, update CRD group, and clean up Makefile
Signed-off-by: Lee Calcote <[email protected]>
1 parent 442cea3 commit 2fe097f

File tree

6 files changed

+11
-14248
lines changed

6 files changed

+11
-14248
lines changed

install/Makefile.core.mk

-13
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,6 @@ GOBIN = $(GOPATH)/bin
2626

2727
SHELL :=/bin/bash -o pipefail
2828

29-
#-----------------------------------------------------------------------------
30-
# Components
31-
#-----------------------------------------------------------------------------
32-
ADAPTER_URLS := "localhost:10000 localhost:10001 localhost:10002 localhost:10004 localhost:10005 localhost:10006 localhost:10007 localhost:10009 localhost:10010 localhost:10012"
33-
34-
#-----------------------------------------------------------------------------
35-
# Providers
36-
#-----------------------------------------------------------------------------
37-
REMOTE_PROVIDER_LOCAL="http://localhost:9876"
38-
MESHERY_CLOUD_DEV="http://localhost:9876"
39-
MESHERY_CLOUD_PROD="https://meshery.layer5.io"
40-
MESHERY_CLOUD_STAGING="https://staging-meshery.layer5.io"
41-
4229
#-----------------------------------------------------------------------------
4330
# Server
4431
#-----------------------------------------------------------------------------

internal/config/crd_config.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import (
1717
)
1818

1919
var (
20-
namespace = "meshery" // Namespace for the Custom Resource
21-
crName = "meshery-meshsync" // Name of the custom resource
22-
version = "v1alpha1" // Version of the Custom Resource
23-
group = "meshery.layer5.io" //Group for the Custom Resource
24-
resource = "meshsyncs" //Name of the Resource
20+
namespace = "meshery" // Namespace for the Custom Resource
21+
crName = "meshery-meshsync" // Name of the custom resource
22+
version = "v1alpha1" // Version of the Custom Resource
23+
group = "meshery.io" //Group for the Custom Resource
24+
resource = "meshsyncs" //Name of the Resource
2525
)
2626

2727
func GetMeshsyncCRDConfigs(dyClient dynamic.Interface) (*MeshsyncConfig, error) {

internal/config/crd_config_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313

1414
var (
1515
Kind string = "MeshSync"
16-
APIVersion string = "meshery.layer5.io/v1alpha1"
17-
URL string = "https://layer5.io"
16+
APIVersion string = "meshery.io/v1alpha1"
17+
URL string = "https://meshery.io"
1818
fakeDyClient *fake.FakeDynamicClient
1919
ctx = context.Background()
2020
)
@@ -107,8 +107,8 @@ func TestBlackListResources(t *testing.T) {
107107
// excempted local pipelines: pods, replicasets
108108

109109
// counting expected pipelines after blacklist
110-
expectedGlobalCount := len(meshsyncConfig.Pipelines["global"]) - 1 //excluding namespaces
111-
expectedLocalCount := len(meshsyncConfig.Pipelines["local"]) - 2 //excluding pods, replicasets
110+
expectedGlobalCount := len(meshsyncConfig.Pipelines["global"]) - 1 //excluding namespaces
111+
expectedLocalCount := len(meshsyncConfig.Pipelines["local"]) - 2 //excluding pods, replicasets
112112

113113
if len(meshsyncConfig.Pipelines["global"]) != expectedGlobalCount {
114114
t.Errorf("global pipelines not well configured expected %d", expectedGlobalCount)

internal/config/error.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ const (
99
)
1010

1111
func ErrInitConfig(err error) error {
12-
return errors.New(ErrInitConfigCode, errors.Alert, []string{"Error while config init", err.Error()}, []string{}, []string{}, []string{})
12+
return errors.New(ErrInitConfigCode, errors.Alert, []string{"Error while initializing MeshSync configuration. ", err.Error()}, []string{"Missing or outdated CRD. "}, []string{"Missing or outdated CRD."}, []string{"Confirm that meshsyncs custom resource is present in the cluster."})
1313
}

0 commit comments

Comments
 (0)