fix resource bug
diff --git a/api/mesh/v1alpha1/dataplane.pb.go b/api/mesh/v1alpha1/dataplane.pb.go
index fc8181d..e44d81f 100644
--- a/api/mesh/v1alpha1/dataplane.pb.go
+++ b/api/mesh/v1alpha1/dataplane.pb.go
@@ -809,7 +809,7 @@
0x70, 0x68, 0x61, 0x31, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
- 0xfe, 0x10, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x12, 0x49, 0x0a,
+ 0x86, 0x11, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x12, 0x49, 0x0a,
0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x29, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76,
0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e,
@@ -938,17 +938,18 @@
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a,
- 0x6f, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x13, 0x0a, 0x11, 0x44, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61,
+ 0x77, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x13, 0x0a, 0x11, 0x44, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61,
0x6e, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x0b,
0x12, 0x09, 0x44, 0x61, 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0xaa, 0x8c, 0x89, 0xa6, 0x01,
0x06, 0x22, 0x04, 0x6d, 0x65, 0x73, 0x68, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x04, 0x52, 0x02, 0x10,
0x01, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x0d, 0x3a, 0x0b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x70,
0x6c, 0x61, 0x6e, 0x65, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x0e, 0x3a, 0x0c, 0x12, 0x0a, 0x64, 0x61,
- 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x02, 0x68, 0x01,
- 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61,
- 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x6b, 0x75, 0x62, 0x65,
- 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f,
- 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x74, 0x61, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x02, 0x58, 0x01,
+ 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x02, 0x68, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68,
+ 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75,
+ 0x62, 0x62, 0x6f, 0x2d, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, 0x61,
+ 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
+ 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/api/mesh/v1alpha1/dataplane.proto b/api/mesh/v1alpha1/dataplane.proto
index b371b83..c8a708e 100644
--- a/api/mesh/v1alpha1/dataplane.proto
+++ b/api/mesh/v1alpha1/dataplane.proto
@@ -19,6 +19,7 @@
option (dubbo.mesh.resource).dds.send_to_zone = true;
option (dubbo.mesh.resource).ws.name = "dataplane";
option (dubbo.mesh.resource).ws.plural = "dataplanes";
+ option (dubbo.mesh.resource).scope_namespace = true;
option (dubbo.mesh.resource).allow_to_inspect = true;
// Networking describes inbound and outbound interfaces of a data plane proxy.
diff --git a/api/mesh/v1alpha1/zone_ingress.pb.go b/api/mesh/v1alpha1/zone_ingress.pb.go
index e370950..51f4c1c 100644
--- a/api/mesh/v1alpha1/zone_ingress.pb.go
+++ b/api/mesh/v1alpha1/zone_ingress.pb.go
@@ -247,7 +247,7 @@
0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31,
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x5f, 0x61, 0x64, 0x6d,
- 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x05, 0x0a, 0x0b, 0x5a, 0x6f, 0x6e,
+ 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x05, 0x0a, 0x0b, 0x5a, 0x6f, 0x6e,
0x65, 0x49, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x7a, 0x6f, 0x6e, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x4b, 0x0a, 0x0a,
0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
@@ -286,18 +286,19 @@
0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
- 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x78, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x15, 0x0a, 0x13, 0x5a,
- 0x6f, 0x6e, 0x65, 0x49, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
- 0x63, 0x65, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x0d, 0x12, 0x0b, 0x5a, 0x6f, 0x6e, 0x65, 0x49, 0x6e,
- 0x67, 0x72, 0x65, 0x73, 0x73, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x06, 0x22, 0x04, 0x6d, 0x65, 0x73,
- 0x68, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x04, 0x52, 0x02, 0x10, 0x01, 0xaa, 0x8c, 0x89, 0xa6, 0x01,
- 0x0f, 0x3a, 0x0d, 0x0a, 0x0b, 0x7a, 0x6f, 0x6e, 0x65, 0x69, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73,
- 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x11, 0x3a, 0x0f, 0x12, 0x0d, 0x7a, 0x6f, 0x6e, 0x65, 0x69, 0x6e,
- 0x67, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x02, 0x68, 0x01, 0x42,
- 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70,
- 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x6b, 0x75, 0x62, 0x65, 0x72,
- 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76,
- 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x80, 0x01, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x15, 0x0a, 0x13,
+ 0x5a, 0x6f, 0x6e, 0x65, 0x49, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x75,
+ 0x72, 0x63, 0x65, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x0d, 0x12, 0x0b, 0x5a, 0x6f, 0x6e, 0x65, 0x49,
+ 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x06, 0x22, 0x04, 0x6d, 0x65,
+ 0x73, 0x68, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x04, 0x52, 0x02, 0x10, 0x01, 0xaa, 0x8c, 0x89, 0xa6,
+ 0x01, 0x0f, 0x3a, 0x0d, 0x0a, 0x0b, 0x7a, 0x6f, 0x6e, 0x65, 0x69, 0x6e, 0x67, 0x72, 0x65, 0x73,
+ 0x73, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x11, 0x3a, 0x0f, 0x12, 0x0d, 0x7a, 0x6f, 0x6e, 0x65, 0x69,
+ 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x02, 0x68, 0x01,
+ 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x02, 0x58, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68,
+ 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75,
+ 0x62, 0x62, 0x6f, 0x2d, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, 0x61,
+ 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
+ 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/api/mesh/v1alpha1/zone_ingress.proto b/api/mesh/v1alpha1/zone_ingress.proto
index d36b94f..c91437d 100644
--- a/api/mesh/v1alpha1/zone_ingress.proto
+++ b/api/mesh/v1alpha1/zone_ingress.proto
@@ -18,6 +18,7 @@
option (dubbo.mesh.resource).ws.name = "zoneingress";
option (dubbo.mesh.resource).ws.plural = "zoneingresses";
option (dubbo.mesh.resource).allow_to_inspect = true;
+ option (dubbo.mesh.resource).scope_namespace = true;
string zone = 1;
diff --git a/api/mesh/v1alpha1/zoneegress.pb.go b/api/mesh/v1alpha1/zoneegress.pb.go
index 302aed7..b12e1ff 100644
--- a/api/mesh/v1alpha1/zoneegress.pb.go
+++ b/api/mesh/v1alpha1/zoneegress.pb.go
@@ -162,7 +162,7 @@
0x65, 0x73, 0x68, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x23, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c,
0x70, 0x68, 0x61, 0x31, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd5, 0x02, 0x0a, 0x0a, 0x5a, 0x6f, 0x6e, 0x65, 0x45,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdd, 0x02, 0x0a, 0x0a, 0x5a, 0x6f, 0x6e, 0x65, 0x45,
0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x4a, 0x0a, 0x0a, 0x6e, 0x65, 0x74,
0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e,
@@ -176,18 +176,19 @@
0x74, 0x12, 0x35, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1f, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31,
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x76, 0x6f, 0x79, 0x41, 0x64, 0x6d, 0x69,
- 0x6e, 0x52, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x74, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x14,
+ 0x6e, 0x52, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x7c, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x14,
0x0a, 0x12, 0x5a, 0x6f, 0x6e, 0x65, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x0c, 0x12, 0x0a, 0x5a, 0x6f, 0x6e, 0x65,
0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x06, 0x22, 0x04, 0x6d, 0x65,
0x73, 0x68, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x04, 0x52, 0x02, 0x10, 0x01, 0xaa, 0x8c, 0x89, 0xa6,
0x01, 0x0e, 0x3a, 0x0c, 0x0a, 0x0a, 0x7a, 0x6f, 0x6e, 0x65, 0x65, 0x67, 0x72, 0x65, 0x73, 0x73,
0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x10, 0x3a, 0x0e, 0x12, 0x0c, 0x7a, 0x6f, 0x6e, 0x65, 0x65, 0x67,
- 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x02, 0x68, 0x01, 0x42, 0x36,
- 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61,
- 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e,
- 0x65, 0x74, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31,
- 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x02, 0x68, 0x01, 0xaa, 0x8c,
+ 0x89, 0xa6, 0x01, 0x02, 0x58, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
+ 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62,
+ 0x6f, 0x2d, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69,
+ 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/api/mesh/v1alpha1/zoneegress.proto b/api/mesh/v1alpha1/zoneegress.proto
index c2d2390..14150db 100644
--- a/api/mesh/v1alpha1/zoneegress.proto
+++ b/api/mesh/v1alpha1/zoneegress.proto
@@ -15,6 +15,7 @@
option (dubbo.mesh.resource).ws.name = "zoneegress";
option (dubbo.mesh.resource).ws.plural = "zoneegresses";
option (dubbo.mesh.resource).allow_to_inspect = true;
+ option (dubbo.mesh.resource).scope_namespace = true;
// Zone field contains Zone name where egress is serving, field will be
// automatically set by Global Kuma CP
diff --git a/api/mesh/v1alpha1/zoneegressinsight.pb.go b/api/mesh/v1alpha1/zoneegressinsight.pb.go
index aa7f24b..eb6c5c2 100644
--- a/api/mesh/v1alpha1/zoneegressinsight.pb.go
+++ b/api/mesh/v1alpha1/zoneegressinsight.pb.go
@@ -34,7 +34,7 @@
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- // List of ADS subscriptions created by a given Zone Kuma CP.
+ // List of ADS subscriptions created by a given Zone Dubbo CP.
Subscriptions []*DiscoverySubscription `protobuf:"bytes,1,rep,name=subscriptions,proto3" json:"subscriptions,omitempty"`
}
diff --git a/build/tools-darwin-amd64/resource-gen b/build/tools-darwin-amd64/resource-gen
new file mode 100755
index 0000000..ad3633e
--- /dev/null
+++ b/build/tools-darwin-amd64/resource-gen
Binary files differ
diff --git a/deploy/charts/admin/crds/dubbo.io_dataplanes.yaml b/deploy/charts/admin/crds/dubbo.io_dataplanes.yaml
index 17c4922..8c22bdd 100644
--- a/deploy/charts/admin/crds/dubbo.io_dataplanes.yaml
+++ b/deploy/charts/admin/crds/dubbo.io_dataplanes.yaml
@@ -14,7 +14,7 @@
listKind: DataplaneList
plural: dataplanes
singular: dataplane
- scope: Cluster
+ scope: Namespaced
versions:
- name: v1alpha1
schema:
diff --git a/deploy/charts/admin/crds/dubbo.io_zoneegresses.yaml b/deploy/charts/admin/crds/dubbo.io_zoneegresses.yaml
index a8a62d9..3437323 100644
--- a/deploy/charts/admin/crds/dubbo.io_zoneegresses.yaml
+++ b/deploy/charts/admin/crds/dubbo.io_zoneegresses.yaml
@@ -14,7 +14,7 @@
listKind: ZoneEgressList
plural: zoneegresses
singular: zoneegress
- scope: Cluster
+ scope: Namespaced
versions:
- name: v1alpha1
schema:
diff --git a/deploy/charts/admin/crds/dubbo.io_zoneegressinsights.yaml b/deploy/charts/admin/crds/dubbo.io_zoneegressinsights.yaml
new file mode 100644
index 0000000..ad7c88f
--- /dev/null
+++ b/deploy/charts/admin/crds/dubbo.io_zoneegressinsights.yaml
@@ -0,0 +1,51 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: zoneegressinsights.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: ZoneEgressInsight
+ listKind: ZoneEgressInsightList
+ plural: zoneegressinsights
+ singular: zoneegressinsight
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ schema:
+ openAPIV3Schema:
+ properties:
+ apiVersion:
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
+ type: string
+ kind:
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
+ type: string
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo ZoneEgressInsight
+ resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
diff --git a/deploy/charts/admin/crds/dubbo.io_zoneingresses.yaml b/deploy/charts/admin/crds/dubbo.io_zoneingresses.yaml
index ddadb94..afc12c4 100644
--- a/deploy/charts/admin/crds/dubbo.io_zoneingresses.yaml
+++ b/deploy/charts/admin/crds/dubbo.io_zoneingresses.yaml
@@ -14,7 +14,7 @@
listKind: ZoneIngressList
plural: zoneingresses
singular: zoneingress
- scope: Cluster
+ scope: Namespaced
versions:
- name: v1alpha1
schema:
diff --git a/pkg/admin/server/server.go b/pkg/admin/server/server.go
index a2bd219..eba846c 100644
--- a/pkg/admin/server/server.go
+++ b/pkg/admin/server/server.go
@@ -19,13 +19,19 @@
import (
"context"
- "github.com/apache/dubbo-kubernetes/pkg/config/admin"
- "github.com/apache/dubbo-kubernetes/pkg/core/logger"
- "github.com/gin-gonic/gin"
"net/http"
"strconv"
)
+import (
+ "github.com/gin-gonic/gin"
+)
+
+import (
+ "github.com/apache/dubbo-kubernetes/pkg/config/admin"
+ "github.com/apache/dubbo-kubernetes/pkg/core/logger"
+)
+
type AdminServer struct {
Engine *gin.Engine
adminCfg admin.Admin
diff --git a/pkg/bufman/pkg/dag/dag.go b/pkg/bufman/pkg/dag/dag.go
index e3857c5..1d4da8e 100644
--- a/pkg/bufman/pkg/dag/dag.go
+++ b/pkg/bufman/pkg/dag/dag.go
@@ -22,23 +22,6 @@
"strings"
)
-// Largely adopted from https://github.com/stevenle/topsort, with modifications.
-//
-// Copyright 2013 Steven Le. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// See https://github.com/stevenle/topsort/blob/master/LICENSE.
// CycleError is an error if the Graph had a cycle.
type CycleError[Key comparable] struct {
Keys []Key
diff --git a/pkg/core/bootstrap/bootstrap.go b/pkg/core/bootstrap/bootstrap.go
index ca34cf6..36e8805 100644
--- a/pkg/core/bootstrap/bootstrap.go
+++ b/pkg/core/bootstrap/bootstrap.go
@@ -19,12 +19,8 @@
import (
"context"
- "github.com/apache/dubbo-kubernetes/pkg/core/managers/apis/zone"
- "github.com/apache/dubbo-kubernetes/pkg/core/resources/apis/system"
- k8s_extensions "github.com/apache/dubbo-kubernetes/pkg/plugins/extensions/k8s"
"net/http"
"net/url"
- kube_ctrl "sigs.k8s.io/controller-runtime"
"strings"
"sync"
)
@@ -36,6 +32,8 @@
"dubbo.apache.org/dubbo-go/v3/config_center"
"github.com/pkg/errors"
+
+ kube_ctrl "sigs.k8s.io/controller-runtime"
)
import (
@@ -57,9 +55,11 @@
mesh_managers "github.com/apache/dubbo-kubernetes/pkg/core/managers/apis/mesh"
metadata_managers "github.com/apache/dubbo-kubernetes/pkg/core/managers/apis/metadata"
"github.com/apache/dubbo-kubernetes/pkg/core/managers/apis/tag_route"
+ "github.com/apache/dubbo-kubernetes/pkg/core/managers/apis/zone"
core_plugins "github.com/apache/dubbo-kubernetes/pkg/core/plugins"
dubbo_registry "github.com/apache/dubbo-kubernetes/pkg/core/registry"
"github.com/apache/dubbo-kubernetes/pkg/core/resources/apis/mesh"
+ "github.com/apache/dubbo-kubernetes/pkg/core/resources/apis/system"
core_manager "github.com/apache/dubbo-kubernetes/pkg/core/resources/manager"
"github.com/apache/dubbo-kubernetes/pkg/core/resources/registry"
core_store "github.com/apache/dubbo-kubernetes/pkg/core/resources/store"
@@ -71,6 +71,7 @@
"github.com/apache/dubbo-kubernetes/pkg/intercp"
"github.com/apache/dubbo-kubernetes/pkg/intercp/catalog"
"github.com/apache/dubbo-kubernetes/pkg/intercp/envoyadmin"
+ k8s_extensions "github.com/apache/dubbo-kubernetes/pkg/plugins/extensions/k8s"
mesh_cache "github.com/apache/dubbo-kubernetes/pkg/xds/cache/mesh"
xds_context "github.com/apache/dubbo-kubernetes/pkg/xds/context"
xds_server "github.com/apache/dubbo-kubernetes/pkg/xds/server"
diff --git a/pkg/core/governance/governance_config.go b/pkg/core/governance/governance_config.go
index acd2ca9..3b5d4b0 100644
--- a/pkg/core/governance/governance_config.go
+++ b/pkg/core/governance/governance_config.go
@@ -19,13 +19,14 @@
import (
"errors"
- "github.com/dubbogo/go-zookeeper/zk"
)
import (
"dubbo.apache.org/dubbo-go/v3/common"
"dubbo.apache.org/dubbo-go/v3/config_center"
"dubbo.apache.org/dubbo-go/v3/registry"
+
+ "github.com/dubbogo/go-zookeeper/zk"
)
const group = "dubbo"
diff --git a/pkg/core/managers/apis/condition_route/condition_route_manager.go b/pkg/core/managers/apis/condition_route/condition_route_manager.go
index 9b13095..8b9daa2 100644
--- a/pkg/core/managers/apis/condition_route/condition_route_manager.go
+++ b/pkg/core/managers/apis/condition_route/condition_route_manager.go
@@ -18,10 +18,13 @@
package condition_route
import (
+ kube_ctrl "sigs.k8s.io/controller-runtime"
+)
+
+import (
config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
core_manager "github.com/apache/dubbo-kubernetes/pkg/core/resources/manager"
core_store "github.com/apache/dubbo-kubernetes/pkg/core/resources/store"
- kube_ctrl "sigs.k8s.io/controller-runtime"
)
type conditionRouteManager struct {
diff --git a/pkg/core/managers/apis/dataplane/dataplane_manager.go b/pkg/core/managers/apis/dataplane/dataplane_manager.go
index 036a0ef..2f4a56b 100644
--- a/pkg/core/managers/apis/dataplane/dataplane_manager.go
+++ b/pkg/core/managers/apis/dataplane/dataplane_manager.go
@@ -19,16 +19,17 @@
import (
"context"
- config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
- kube_ctrl "sigs.k8s.io/controller-runtime"
)
import (
"github.com/pkg/errors"
+
+ kube_ctrl "sigs.k8s.io/controller-runtime"
)
import (
mesh_proto "github.com/apache/dubbo-kubernetes/api/mesh/v1alpha1"
+ config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
"github.com/apache/dubbo-kubernetes/pkg/core"
"github.com/apache/dubbo-kubernetes/pkg/core/logger"
core_mesh "github.com/apache/dubbo-kubernetes/pkg/core/resources/apis/mesh"
diff --git a/pkg/core/managers/apis/dynamic_config/dynamic_config.go b/pkg/core/managers/apis/dynamic_config/dynamic_config.go
index 2f4e71d..c8701d7 100644
--- a/pkg/core/managers/apis/dynamic_config/dynamic_config.go
+++ b/pkg/core/managers/apis/dynamic_config/dynamic_config.go
@@ -18,10 +18,13 @@
package dynamic_config
import (
+ kube_ctrl "sigs.k8s.io/controller-runtime"
+)
+
+import (
config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
core_manager "github.com/apache/dubbo-kubernetes/pkg/core/resources/manager"
core_store "github.com/apache/dubbo-kubernetes/pkg/core/resources/store"
- kube_ctrl "sigs.k8s.io/controller-runtime"
)
type dynamicConfigManager struct {
diff --git a/pkg/core/managers/apis/mapping/mapping_manager.go b/pkg/core/managers/apis/mapping/mapping_manager.go
index 96b5d1c..44d057d 100644
--- a/pkg/core/managers/apis/mapping/mapping_manager.go
+++ b/pkg/core/managers/apis/mapping/mapping_manager.go
@@ -19,11 +19,14 @@
import (
"context"
- config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
+)
+
+import (
kube_ctrl "sigs.k8s.io/controller-runtime"
)
import (
+ config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
"github.com/apache/dubbo-kubernetes/pkg/core"
core_manager "github.com/apache/dubbo-kubernetes/pkg/core/resources/manager"
core_model "github.com/apache/dubbo-kubernetes/pkg/core/resources/model"
diff --git a/pkg/core/managers/apis/mesh/mesh_manager.go b/pkg/core/managers/apis/mesh/mesh_manager.go
index a90c029..d1f79b4 100644
--- a/pkg/core/managers/apis/mesh/mesh_manager.go
+++ b/pkg/core/managers/apis/mesh/mesh_manager.go
@@ -19,17 +19,18 @@
import (
"context"
- config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
- kube_ctrl "sigs.k8s.io/controller-runtime"
"time"
)
import (
"github.com/pkg/errors"
+
+ kube_ctrl "sigs.k8s.io/controller-runtime"
)
import (
dubbo_cp "github.com/apache/dubbo-kubernetes/pkg/config/app/dubbo-cp"
+ config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
config_store "github.com/apache/dubbo-kubernetes/pkg/config/core/resources/store"
core_mesh "github.com/apache/dubbo-kubernetes/pkg/core/resources/apis/mesh"
core_manager "github.com/apache/dubbo-kubernetes/pkg/core/resources/manager"
diff --git a/pkg/core/managers/apis/metadata/metadata_manager.go b/pkg/core/managers/apis/metadata/metadata_manager.go
index c3df46c..812738c 100644
--- a/pkg/core/managers/apis/metadata/metadata_manager.go
+++ b/pkg/core/managers/apis/metadata/metadata_manager.go
@@ -19,16 +19,17 @@
import (
"context"
- config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
- kube_ctrl "sigs.k8s.io/controller-runtime"
)
import (
"github.com/pkg/errors"
+
+ kube_ctrl "sigs.k8s.io/controller-runtime"
)
import (
mesh_proto "github.com/apache/dubbo-kubernetes/api/mesh/v1alpha1"
+ config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
"github.com/apache/dubbo-kubernetes/pkg/core"
"github.com/apache/dubbo-kubernetes/pkg/core/logger"
core_mesh "github.com/apache/dubbo-kubernetes/pkg/core/resources/apis/mesh"
diff --git a/pkg/core/managers/apis/tag_route/tag_route.go b/pkg/core/managers/apis/tag_route/tag_route.go
index b30ed47..4dead7c 100644
--- a/pkg/core/managers/apis/tag_route/tag_route.go
+++ b/pkg/core/managers/apis/tag_route/tag_route.go
@@ -18,10 +18,13 @@
package tag_route
import (
+ kube_ctrl "sigs.k8s.io/controller-runtime"
+)
+
+import (
config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
core_manager "github.com/apache/dubbo-kubernetes/pkg/core/resources/manager"
core_store "github.com/apache/dubbo-kubernetes/pkg/core/resources/store"
- kube_ctrl "sigs.k8s.io/controller-runtime"
)
type tagRouteManager struct {
diff --git a/pkg/core/managers/apis/zone/zone_manager.go b/pkg/core/managers/apis/zone/zone_manager.go
index fd59f02..a6fae6d 100644
--- a/pkg/core/managers/apis/zone/zone_manager.go
+++ b/pkg/core/managers/apis/zone/zone_manager.go
@@ -19,6 +19,9 @@
import (
"context"
+)
+
+import (
core_manager "github.com/apache/dubbo-kubernetes/pkg/core/resources/manager"
"github.com/apache/dubbo-kubernetes/pkg/core/resources/model"
core_store "github.com/apache/dubbo-kubernetes/pkg/core/resources/store"
diff --git a/pkg/core/managers/apis/zone/zone_manager_suite_test.go b/pkg/core/managers/apis/zone/zone_manager_suite_test.go
index 58564df..8cc4b01 100644
--- a/pkg/core/managers/apis/zone/zone_manager_suite_test.go
+++ b/pkg/core/managers/apis/zone/zone_manager_suite_test.go
@@ -19,18 +19,23 @@
import (
"context"
- "github.com/apache/dubbo-kubernetes/api/system/v1alpha1"
- "github.com/apache/dubbo-kubernetes/pkg/util/proto"
"time"
+)
+import (
. "github.com/onsi/ginkgo/v2"
- . "github.com/onsi/gomega"
+ . "github.com/onsi/gomega"
+)
+
+import (
+ "github.com/apache/dubbo-kubernetes/api/system/v1alpha1"
"github.com/apache/dubbo-kubernetes/pkg/core/managers/apis/zone"
"github.com/apache/dubbo-kubernetes/pkg/core/resources/apis/system"
"github.com/apache/dubbo-kubernetes/pkg/core/resources/model"
"github.com/apache/dubbo-kubernetes/pkg/core/resources/store"
"github.com/apache/dubbo-kubernetes/pkg/plugins/resources/memory"
+ "github.com/apache/dubbo-kubernetes/pkg/util/proto"
)
var _ = Describe("Zone Manager", func() {
diff --git a/pkg/core/managers/apis/zone/zone_manager_test.go b/pkg/core/managers/apis/zone/zone_manager_test.go
index daf8e7d..8460fc5 100644
--- a/pkg/core/managers/apis/zone/zone_manager_test.go
+++ b/pkg/core/managers/apis/zone/zone_manager_test.go
@@ -18,10 +18,13 @@
package zone_test
import (
- "github.com/apache/dubbo-kubernetes/pkg/test"
"testing"
)
+import (
+ "github.com/apache/dubbo-kubernetes/pkg/test"
+)
+
func TestZoneManager(t *testing.T) {
test.RunSpecs(t, "Zone Manager Suite")
}
diff --git a/pkg/core/managers/apis/zone/zone_validator.go b/pkg/core/managers/apis/zone/zone_validator.go
index bf1df3a..bab9cbe 100644
--- a/pkg/core/managers/apis/zone/zone_validator.go
+++ b/pkg/core/managers/apis/zone/zone_validator.go
@@ -19,11 +19,17 @@
import (
"context"
+)
+
+import (
+ "github.com/pkg/errors"
+)
+
+import (
"github.com/apache/dubbo-kubernetes/pkg/core/resources/apis/system"
"github.com/apache/dubbo-kubernetes/pkg/core/resources/model"
"github.com/apache/dubbo-kubernetes/pkg/core/resources/store"
"github.com/apache/dubbo-kubernetes/pkg/core/validators"
- "github.com/pkg/errors"
)
type Validator struct {
diff --git a/pkg/core/resources/apis/mesh/zz_generated.resources.go b/pkg/core/resources/apis/mesh/zz_generated.resources.go
index d016e31..88d5b74 100644
--- a/pkg/core/resources/apis/mesh/zz_generated.resources.go
+++ b/pkg/core/resources/apis/mesh/zz_generated.resources.go
@@ -5,6 +5,7 @@
package mesh
import (
+ "errors"
"fmt"
)
@@ -1104,6 +1105,234 @@
}
const (
+ ZoneEgressInsightType model.ResourceType = "ZoneEgressInsight"
+)
+
+var _ model.Resource = &ZoneEgressInsightResource{}
+
+type ZoneEgressInsightResource struct {
+ Meta model.ResourceMeta
+ Spec *mesh_proto.ZoneEgressInsight
+}
+
+func NewZoneEgressInsightResource() *ZoneEgressInsightResource {
+ return &ZoneEgressInsightResource{
+ Spec: &mesh_proto.ZoneEgressInsight{},
+ }
+}
+
+func (t *ZoneEgressInsightResource) GetMeta() model.ResourceMeta {
+ return t.Meta
+}
+
+func (t *ZoneEgressInsightResource) SetMeta(m model.ResourceMeta) {
+ t.Meta = m
+}
+
+func (t *ZoneEgressInsightResource) GetSpec() model.ResourceSpec {
+ return t.Spec
+}
+
+func (t *ZoneEgressInsightResource) SetSpec(spec model.ResourceSpec) error {
+ protoType, ok := spec.(*mesh_proto.ZoneEgressInsight)
+ if !ok {
+ return fmt.Errorf("invalid type %T for Spec", spec)
+ } else {
+ if protoType == nil {
+ t.Spec = &mesh_proto.ZoneEgressInsight{}
+ } else {
+ t.Spec = protoType
+ }
+ return nil
+ }
+}
+
+func (t *ZoneEgressInsightResource) Descriptor() model.ResourceTypeDescriptor {
+ return ZoneEgressInsightResourceTypeDescriptor
+}
+
+var _ model.ResourceList = &ZoneEgressInsightResourceList{}
+
+type ZoneEgressInsightResourceList struct {
+ Items []*ZoneEgressInsightResource
+ Pagination model.Pagination
+}
+
+func (l *ZoneEgressInsightResourceList) GetItems() []model.Resource {
+ res := make([]model.Resource, len(l.Items))
+ for i, elem := range l.Items {
+ res[i] = elem
+ }
+ return res
+}
+
+func (l *ZoneEgressInsightResourceList) GetItemType() model.ResourceType {
+ return ZoneEgressInsightType
+}
+
+func (l *ZoneEgressInsightResourceList) NewItem() model.Resource {
+ return NewZoneEgressInsightResource()
+}
+
+func (l *ZoneEgressInsightResourceList) AddItem(r model.Resource) error {
+ if trr, ok := r.(*ZoneEgressInsightResource); ok {
+ l.Items = append(l.Items, trr)
+ return nil
+ } else {
+ return model.ErrorInvalidItemType((*ZoneEgressInsightResource)(nil), r)
+ }
+}
+
+func (l *ZoneEgressInsightResourceList) GetPagination() *model.Pagination {
+ return &l.Pagination
+}
+
+func (l *ZoneEgressInsightResourceList) SetPagination(p model.Pagination) {
+ l.Pagination = p
+}
+
+var ZoneEgressInsightResourceTypeDescriptor = model.ResourceTypeDescriptor{
+ Name: ZoneEgressInsightType,
+ Resource: NewZoneEgressInsightResource(),
+ ResourceList: &ZoneEgressInsightResourceList{},
+ ReadOnly: true,
+ AdminOnly: false,
+ Scope: model.ScopeGlobal,
+ DDSFlags: model.ZoneToGlobalFlag,
+ WsPath: "zoneegressinsights",
+ DubboctlArg: "",
+ DubboctlListArg: "",
+ AllowToInspect: false,
+ IsPolicy: false,
+ SingularDisplayName: "Zone Egress Insight",
+ PluralDisplayName: "Zone Egress Insights",
+ IsExperimental: false,
+}
+
+func init() {
+ registry.RegisterType(ZoneEgressInsightResourceTypeDescriptor)
+}
+
+const (
+ ZoneEgressOverviewType model.ResourceType = "ZoneEgressOverview"
+)
+
+var _ model.Resource = &ZoneEgressOverviewResource{}
+
+type ZoneEgressOverviewResource struct {
+ Meta model.ResourceMeta
+ Spec *mesh_proto.ZoneEgressOverview
+}
+
+func NewZoneEgressOverviewResource() *ZoneEgressOverviewResource {
+ return &ZoneEgressOverviewResource{
+ Spec: &mesh_proto.ZoneEgressOverview{},
+ }
+}
+
+func (t *ZoneEgressOverviewResource) GetMeta() model.ResourceMeta {
+ return t.Meta
+}
+
+func (t *ZoneEgressOverviewResource) SetMeta(m model.ResourceMeta) {
+ t.Meta = m
+}
+
+func (t *ZoneEgressOverviewResource) GetSpec() model.ResourceSpec {
+ return t.Spec
+}
+
+func (t *ZoneEgressOverviewResource) SetSpec(spec model.ResourceSpec) error {
+ protoType, ok := spec.(*mesh_proto.ZoneEgressOverview)
+ if !ok {
+ return fmt.Errorf("invalid type %T for Spec", spec)
+ } else {
+ if protoType == nil {
+ t.Spec = &mesh_proto.ZoneEgressOverview{}
+ } else {
+ t.Spec = protoType
+ }
+ return nil
+ }
+}
+
+func (t *ZoneEgressOverviewResource) Descriptor() model.ResourceTypeDescriptor {
+ return ZoneEgressOverviewResourceTypeDescriptor
+}
+
+func (t *ZoneEgressOverviewResource) SetOverviewSpec(resource model.Resource, insight model.Resource) error {
+ t.SetMeta(resource.GetMeta())
+ overview := &mesh_proto.ZoneEgressOverview{
+ ZoneEgress: resource.GetSpec().(*mesh_proto.ZoneEgress),
+ }
+ if insight != nil {
+ ins, ok := insight.GetSpec().(*mesh_proto.ZoneEgressInsight)
+ if !ok {
+ return errors.New("failed to convert to insight type 'ZoneEgressInsight'")
+ }
+ overview.ZoneEgressInsight = ins
+ }
+ return t.SetSpec(overview)
+}
+
+var _ model.ResourceList = &ZoneEgressOverviewResourceList{}
+
+type ZoneEgressOverviewResourceList struct {
+ Items []*ZoneEgressOverviewResource
+ Pagination model.Pagination
+}
+
+func (l *ZoneEgressOverviewResourceList) GetItems() []model.Resource {
+ res := make([]model.Resource, len(l.Items))
+ for i, elem := range l.Items {
+ res[i] = elem
+ }
+ return res
+}
+
+func (l *ZoneEgressOverviewResourceList) GetItemType() model.ResourceType {
+ return ZoneEgressOverviewType
+}
+
+func (l *ZoneEgressOverviewResourceList) NewItem() model.Resource {
+ return NewZoneEgressOverviewResource()
+}
+
+func (l *ZoneEgressOverviewResourceList) AddItem(r model.Resource) error {
+ if trr, ok := r.(*ZoneEgressOverviewResource); ok {
+ l.Items = append(l.Items, trr)
+ return nil
+ } else {
+ return model.ErrorInvalidItemType((*ZoneEgressOverviewResource)(nil), r)
+ }
+}
+
+func (l *ZoneEgressOverviewResourceList) GetPagination() *model.Pagination {
+ return &l.Pagination
+}
+
+func (l *ZoneEgressOverviewResourceList) SetPagination(p model.Pagination) {
+ l.Pagination = p
+}
+
+var ZoneEgressOverviewResourceTypeDescriptor = model.ResourceTypeDescriptor{
+ Name: ZoneEgressOverviewType,
+ Resource: NewZoneEgressOverviewResource(),
+ ResourceList: &ZoneEgressOverviewResourceList{},
+ ReadOnly: false,
+ AdminOnly: false,
+ Scope: model.ScopeGlobal,
+ WsPath: "",
+ DubboctlArg: "",
+ DubboctlListArg: "",
+ AllowToInspect: false,
+ IsPolicy: false,
+ SingularDisplayName: "Zone Egress Overview",
+ PluralDisplayName: "Zone Egress Overviews",
+ IsExperimental: false,
+}
+
+const (
ZoneIngressType model.ResourceType = "ZoneIngress"
)
@@ -1320,3 +1549,122 @@
func init() {
registry.RegisterType(ZoneIngressInsightResourceTypeDescriptor)
}
+
+const (
+ ZoneIngressOverviewType model.ResourceType = "ZoneIngressOverview"
+)
+
+var _ model.Resource = &ZoneIngressOverviewResource{}
+
+type ZoneIngressOverviewResource struct {
+ Meta model.ResourceMeta
+ Spec *mesh_proto.ZoneIngressOverview
+}
+
+func NewZoneIngressOverviewResource() *ZoneIngressOverviewResource {
+ return &ZoneIngressOverviewResource{
+ Spec: &mesh_proto.ZoneIngressOverview{},
+ }
+}
+
+func (t *ZoneIngressOverviewResource) GetMeta() model.ResourceMeta {
+ return t.Meta
+}
+
+func (t *ZoneIngressOverviewResource) SetMeta(m model.ResourceMeta) {
+ t.Meta = m
+}
+
+func (t *ZoneIngressOverviewResource) GetSpec() model.ResourceSpec {
+ return t.Spec
+}
+
+func (t *ZoneIngressOverviewResource) SetSpec(spec model.ResourceSpec) error {
+ protoType, ok := spec.(*mesh_proto.ZoneIngressOverview)
+ if !ok {
+ return fmt.Errorf("invalid type %T for Spec", spec)
+ } else {
+ if protoType == nil {
+ t.Spec = &mesh_proto.ZoneIngressOverview{}
+ } else {
+ t.Spec = protoType
+ }
+ return nil
+ }
+}
+
+func (t *ZoneIngressOverviewResource) Descriptor() model.ResourceTypeDescriptor {
+ return ZoneIngressOverviewResourceTypeDescriptor
+}
+
+func (t *ZoneIngressOverviewResource) SetOverviewSpec(resource model.Resource, insight model.Resource) error {
+ t.SetMeta(resource.GetMeta())
+ overview := &mesh_proto.ZoneIngressOverview{
+ ZoneIngress: resource.GetSpec().(*mesh_proto.ZoneIngress),
+ }
+ if insight != nil {
+ ins, ok := insight.GetSpec().(*mesh_proto.ZoneIngressInsight)
+ if !ok {
+ return errors.New("failed to convert to insight type 'ZoneIngressInsight'")
+ }
+ overview.ZoneIngressInsight = ins
+ }
+ return t.SetSpec(overview)
+}
+
+var _ model.ResourceList = &ZoneIngressOverviewResourceList{}
+
+type ZoneIngressOverviewResourceList struct {
+ Items []*ZoneIngressOverviewResource
+ Pagination model.Pagination
+}
+
+func (l *ZoneIngressOverviewResourceList) GetItems() []model.Resource {
+ res := make([]model.Resource, len(l.Items))
+ for i, elem := range l.Items {
+ res[i] = elem
+ }
+ return res
+}
+
+func (l *ZoneIngressOverviewResourceList) GetItemType() model.ResourceType {
+ return ZoneIngressOverviewType
+}
+
+func (l *ZoneIngressOverviewResourceList) NewItem() model.Resource {
+ return NewZoneIngressOverviewResource()
+}
+
+func (l *ZoneIngressOverviewResourceList) AddItem(r model.Resource) error {
+ if trr, ok := r.(*ZoneIngressOverviewResource); ok {
+ l.Items = append(l.Items, trr)
+ return nil
+ } else {
+ return model.ErrorInvalidItemType((*ZoneIngressOverviewResource)(nil), r)
+ }
+}
+
+func (l *ZoneIngressOverviewResourceList) GetPagination() *model.Pagination {
+ return &l.Pagination
+}
+
+func (l *ZoneIngressOverviewResourceList) SetPagination(p model.Pagination) {
+ l.Pagination = p
+}
+
+var ZoneIngressOverviewResourceTypeDescriptor = model.ResourceTypeDescriptor{
+ Name: ZoneIngressOverviewType,
+ Resource: NewZoneIngressOverviewResource(),
+ ResourceList: &ZoneIngressOverviewResourceList{},
+ ReadOnly: false,
+ AdminOnly: false,
+ Scope: model.ScopeGlobal,
+ WsPath: "",
+ DubboctlArg: "",
+ DubboctlListArg: "",
+ AllowToInspect: false,
+ IsPolicy: false,
+ SingularDisplayName: "Zone Ingress Overview",
+ PluralDisplayName: "Zone Ingress Overviews",
+ IsExperimental: false,
+}
diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go
index 7b795a5..d779b7d 100644
--- a/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.deepcopy.go
@@ -753,6 +753,68 @@
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ZoneEgressInsight) DeepCopyInto(out *ZoneEgressInsight) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ if in.Spec != nil {
+ in, out := &in.Spec, &out.Spec
+ *out = new(v1.JSON)
+ (*in).DeepCopyInto(*out)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZoneEgressInsight.
+func (in *ZoneEgressInsight) DeepCopy() *ZoneEgressInsight {
+ if in == nil {
+ return nil
+ }
+ out := new(ZoneEgressInsight)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *ZoneEgressInsight) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ZoneEgressInsightList) DeepCopyInto(out *ZoneEgressInsightList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]ZoneEgressInsight, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZoneEgressInsightList.
+func (in *ZoneEgressInsightList) DeepCopy() *ZoneEgressInsightList {
+ if in == nil {
+ return nil
+ }
+ out := new(ZoneEgressInsightList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *ZoneEgressInsightList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ZoneEgressList) DeepCopyInto(out *ZoneEgressList) {
*out = *in
out.TypeMeta = in.TypeMeta
diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.mesh.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.mesh.go
index 047589b..8a65fcf 100644
--- a/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.mesh.go
+++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/zz_generated.mesh.go
@@ -120,7 +120,7 @@
}
// +kubebuilder:object:root=true
-// +kubebuilder:resource:categories=dubbo,scope=Cluster
+// +kubebuilder:resource:categories=dubbo,scope=Namespaced
type Dataplane struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -136,7 +136,7 @@
}
// +kubebuilder:object:root=true
-// +kubebuilder:resource:scope=Namespaced
+// +kubebuilder:resource:scope=Cluster
type DataplaneList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
@@ -190,7 +190,7 @@
}
func (cb *Dataplane) Scope() model.Scope {
- return model.ScopeCluster
+ return model.ScopeNamespace
}
func (l *DataplaneList) GetItems() []model.KubernetesObject {
@@ -896,7 +896,7 @@
}
// +kubebuilder:object:root=true
-// +kubebuilder:resource:categories=dubbo,scope=Cluster
+// +kubebuilder:resource:categories=dubbo,scope=Namespaced
type ZoneEgress struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -912,7 +912,7 @@
}
// +kubebuilder:object:root=true
-// +kubebuilder:resource:scope=Namespaced
+// +kubebuilder:resource:scope=Cluster
type ZoneEgressList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
@@ -966,7 +966,7 @@
}
func (cb *ZoneEgress) Scope() model.Scope {
- return model.ScopeCluster
+ return model.ScopeNamespace
}
func (l *ZoneEgressList) GetItems() []model.KubernetesObject {
@@ -993,7 +993,104 @@
}
// +kubebuilder:object:root=true
-// +kubebuilder:resource:categories=dubbo,scope=Cluster
+// +kubebuilder:resource:categories=dubbo,scope=Namespaced
+type ZoneEgressInsight struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ // Mesh is the name of the dubbo mesh this resource belongs to.
+ // It may be omitted for cluster-scoped resources.
+ //
+ // +kubebuilder:validation:Optional
+ Mesh string `json:"mesh,omitempty"`
+ // Spec is the specification of the Dubbo ZoneEgressInsight resource.
+ // +kubebuilder:validation:Optional
+ Spec *apiextensionsv1.JSON `json:"spec,omitempty"`
+}
+
+// +kubebuilder:object:root=true
+// +kubebuilder:resource:scope=Cluster
+type ZoneEgressInsightList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []ZoneEgressInsight `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&ZoneEgressInsight{}, &ZoneEgressInsightList{})
+}
+
+func (cb *ZoneEgressInsight) GetObjectMeta() *metav1.ObjectMeta {
+ return &cb.ObjectMeta
+}
+
+func (cb *ZoneEgressInsight) SetObjectMeta(m *metav1.ObjectMeta) {
+ cb.ObjectMeta = *m
+}
+
+func (cb *ZoneEgressInsight) GetMesh() string {
+ return cb.Mesh
+}
+
+func (cb *ZoneEgressInsight) SetMesh(mesh string) {
+ cb.Mesh = mesh
+}
+
+func (cb *ZoneEgressInsight) GetSpec() (core_model.ResourceSpec, error) {
+ spec := cb.Spec
+ m := mesh_proto.ZoneEgressInsight{}
+
+ if spec == nil || len(spec.Raw) == 0 {
+ return &m, nil
+ }
+
+ err := util_proto.FromJSON(spec.Raw, &m)
+ return &m, err
+}
+
+func (cb *ZoneEgressInsight) SetSpec(spec core_model.ResourceSpec) {
+ if spec == nil {
+ cb.Spec = nil
+ return
+ }
+
+ s, ok := spec.(*mesh_proto.ZoneEgressInsight)
+ if !ok {
+ panic(fmt.Sprintf("unexpected protobuf message type %T", spec))
+ }
+
+ cb.Spec = &apiextensionsv1.JSON{Raw: util_proto.MustMarshalJSON(s)}
+}
+
+func (cb *ZoneEgressInsight) Scope() model.Scope {
+ return model.ScopeNamespace
+}
+
+func (l *ZoneEgressInsightList) GetItems() []model.KubernetesObject {
+ result := make([]model.KubernetesObject, len(l.Items))
+ for i := range l.Items {
+ result[i] = &l.Items[i]
+ }
+ return result
+}
+
+func init() {
+ registry.RegisterObjectType(&mesh_proto.ZoneEgressInsight{}, &ZoneEgressInsight{
+ TypeMeta: metav1.TypeMeta{
+ APIVersion: GroupVersion.String(),
+ Kind: "ZoneEgressInsight",
+ },
+ })
+ registry.RegisterListType(&mesh_proto.ZoneEgressInsight{}, &ZoneEgressInsightList{
+ TypeMeta: metav1.TypeMeta{
+ APIVersion: GroupVersion.String(),
+ Kind: "ZoneEgressInsightList",
+ },
+ })
+}
+
+// +kubebuilder:object:root=true
+// +kubebuilder:resource:categories=dubbo,scope=Namespaced
type ZoneIngress struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -1009,7 +1106,7 @@
}
// +kubebuilder:object:root=true
-// +kubebuilder:resource:scope=Namespaced
+// +kubebuilder:resource:scope=Cluster
type ZoneIngressList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
@@ -1063,7 +1160,7 @@
}
func (cb *ZoneIngress) Scope() model.Scope {
- return model.ScopeCluster
+ return model.ScopeNamespace
}
func (l *ZoneIngressList) GetItems() []model.KubernetesObject {
diff --git a/pkg/plugins/runtime/k8s/plugin.go b/pkg/plugins/runtime/k8s/plugin.go
index 5a342a0..095d7d8 100644
--- a/pkg/plugins/runtime/k8s/plugin.go
+++ b/pkg/plugins/runtime/k8s/plugin.go
@@ -18,7 +18,6 @@
package k8s
import (
- "github.com/apache/dubbo-kubernetes/pkg/core/managers/apis/zone"
"github.com/pkg/errors"
kube_ctrl "sigs.k8s.io/controller-runtime"
@@ -29,12 +28,12 @@
import (
config_core "github.com/apache/dubbo-kubernetes/pkg/config/core"
"github.com/apache/dubbo-kubernetes/pkg/core"
+ "github.com/apache/dubbo-kubernetes/pkg/core/managers/apis/zone"
core_plugins "github.com/apache/dubbo-kubernetes/pkg/core/plugins"
core_registry "github.com/apache/dubbo-kubernetes/pkg/core/resources/registry"
core_runtime "github.com/apache/dubbo-kubernetes/pkg/core/runtime"
k8s_common "github.com/apache/dubbo-kubernetes/pkg/plugins/common/k8s"
k8s_extensions "github.com/apache/dubbo-kubernetes/pkg/plugins/extensions/k8s"
- "github.com/apache/dubbo-kubernetes/pkg/plugins/resources/k8s"
k8s_registry "github.com/apache/dubbo-kubernetes/pkg/plugins/resources/k8s/native/pkg/registry"
k8s_controllers "github.com/apache/dubbo-kubernetes/pkg/plugins/runtime/k8s/controllers"
k8s_webhooks "github.com/apache/dubbo-kubernetes/pkg/plugins/runtime/k8s/webhooks"
@@ -70,14 +69,14 @@
// Mutators and Validators convert resources from Request (not from the Store)
// these resources doesn't have ResourceVersion, we can't cache them
- simpleConverter := k8s.NewSimpleConverter()
- if err := addValidators(mgr, rt, simpleConverter); err != nil {
- return err
- }
-
- if err := addMutators(mgr, rt, simpleConverter); err != nil {
- return err
- }
+ //simpleConverter := k8s.NewSimpleConverter()
+ //if err := addValidators(mgr, rt, simpleConverter); err != nil {
+ // return err
+ //}
+ //
+ //if err := addMutators(mgr, rt, simpleConverter); err != nil {
+ // return err
+ //}
return nil
}
diff --git a/pkg/plugins/runtime/k8s/webhooks/containerpatch_validator.go b/pkg/plugins/runtime/k8s/webhooks/containerpatch_validator.go
index 2fb28af..fe178b4 100644
--- a/pkg/plugins/runtime/k8s/webhooks/containerpatch_validator.go
+++ b/pkg/plugins/runtime/k8s/webhooks/containerpatch_validator.go
@@ -19,9 +19,15 @@
import (
"context"
+)
+
+import (
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+)
+
+import (
k8s_common "github.com/apache/dubbo-kubernetes/pkg/plugins/common/k8s"
mesh_k8s "github.com/apache/dubbo-kubernetes/pkg/plugins/resources/k8s/native/api/v1alpha1"
- "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
type ContainerPatchValidator struct {
diff --git a/pkg/plugins/runtime/k8s/webhooks/policy_namespace_validator.go b/pkg/plugins/runtime/k8s/webhooks/policy_namespace_validator.go
index 4b71734..ad46971 100644
--- a/pkg/plugins/runtime/k8s/webhooks/policy_namespace_validator.go
+++ b/pkg/plugins/runtime/k8s/webhooks/policy_namespace_validator.go
@@ -20,9 +20,15 @@
import (
"context"
"fmt"
+)
+
+import (
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+)
+
+import (
core_model "github.com/apache/dubbo-kubernetes/pkg/core/resources/model"
"github.com/apache/dubbo-kubernetes/pkg/core/resources/registry"
- "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
type PolicyNamespaceValidator struct {
diff --git a/pkg/plugins/runtime/k8s/webhooks/service_validator.go b/pkg/plugins/runtime/k8s/webhooks/service_validator.go
index 22534d3..0414bba 100644
--- a/pkg/plugins/runtime/k8s/webhooks/service_validator.go
+++ b/pkg/plugins/runtime/k8s/webhooks/service_validator.go
@@ -20,11 +20,18 @@
import (
"context"
"fmt"
+ "net/http"
+)
+
+import (
+ kube_core "k8s.io/api/core/v1"
+
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+)
+
+import (
core_mesh "github.com/apache/dubbo-kubernetes/pkg/core/resources/apis/mesh"
"github.com/apache/dubbo-kubernetes/pkg/core/validators"
- kube_core "k8s.io/api/core/v1"
- "net/http"
- "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
// ServiceValidator validates Dubbo-specific annotations on Services.
diff --git a/pkg/plugins/runtime/k8s/webhooks/zone_validator.go b/pkg/plugins/runtime/k8s/webhooks/zone_validator.go
index 16d4b03..d5c20da 100644
--- a/pkg/plugins/runtime/k8s/webhooks/zone_validator.go
+++ b/pkg/plugins/runtime/k8s/webhooks/zone_validator.go
@@ -19,12 +19,19 @@
import (
"context"
+ "net/http"
+)
+
+import (
+ v1 "k8s.io/api/admission/v1"
+
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+)
+
+import (
"github.com/apache/dubbo-kubernetes/pkg/core/managers/apis/zone"
k8s_common "github.com/apache/dubbo-kubernetes/pkg/plugins/common/k8s"
mesh_k8s "github.com/apache/dubbo-kubernetes/pkg/plugins/resources/k8s/native/api/v1alpha1"
- v1 "k8s.io/api/admission/v1"
- "net/http"
- "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
func NewZoneValidatorWebhook(validator zone.Validator, unsafeDelete bool) k8s_common.AdmissionValidator {