X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=depRicKubernetesOperator%2Finternal%2Fcontroller%2FgetEndPoints.go;fp=depRicKubernetesOperator%2Finternal%2Fcontroller%2FgetEndPoints.go;h=b426a8914c06844bc28a8f956a25ef0a6f08c235;hb=9fb18847091767093c624c715137c621113d71c4;hp=0000000000000000000000000000000000000000;hpb=43d5525ce82538f64e50c12caeaa23572eddc7fe;p=ric-plt%2Fric-dep.git diff --git a/depRicKubernetesOperator/internal/controller/getEndPoints.go b/depRicKubernetesOperator/internal/controller/getEndPoints.go new file mode 100644 index 0000000..b426a89 --- /dev/null +++ b/depRicKubernetesOperator/internal/controller/getEndPoints.go @@ -0,0 +1,133 @@ +package controller + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + rbacv1 "k8s.io/api/rbac/v1" +) + + +func GetEndpoints() []*unstructured.Unstructured { + + endpoints1 := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "Endpoints", + "metadata": map[string]interface{}{ + "name": "aux-entry", + "namespace": "ricplt", + }, + "subsets": []interface{}{ + map[string]interface{}{ + "ports": []interface{}{ + map[string]interface{}{ + "name": "aux-entry-http-ingress-port", + "port": 32080, + }, + map[string]interface{}{ + "name": "aux-entry-https-ingress-port", + "port": 32443, + }, + }, + "addresses": []interface{}{ + map[string]interface{}{ + "ip": "10.0.0.1", + }, + }, + }, + }, + }, + } + + endpoints2 := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "Endpoints", + "metadata": map[string]interface{}{ + "name": "aux-entry", + "namespace": "ricxapp", + }, + "subsets": []interface{}{ + map[string]interface{}{ + "addresses": []interface{}{ + map[string]interface{}{ + "ip": "10.0.0.1", + }, + }, + "ports": []interface{}{ + map[string]interface{}{ + "name": "aux-entry-http-ingress-port", + "port": 32080, + }, + map[string]interface{}{ + "port": 32443, + "name": "aux-entry-https-ingress-port", + }, + }, + }, + }, + }, + } + + endpoints3 := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "Endpoints", + "metadata": map[string]interface{}{ + "namespace": "ricplt", + "name": "aux-entry", + }, + "subsets": []interface{}{ + map[string]interface{}{ + "addresses": []interface{}{ + map[string]interface{}{ + "ip": "10.0.0.1", + }, + }, + "ports": []interface{}{ + map[string]interface{}{ + "name": "aux-entry-http-ingress-port", + "port": 32080, + }, + map[string]interface{}{ + "name": "aux-entry-https-ingress-port", + "port": 32443, + }, + }, + }, + }, + }, + } + + endpoints4 := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "Endpoints", + "metadata": map[string]interface{}{ + "name": "aux-entry", + "namespace": "ricxapp", + }, + "subsets": []interface{}{ + map[string]interface{}{ + "addresses": []interface{}{ + map[string]interface{}{ + "ip": "10.0.0.1", + }, + }, + "ports": []interface{}{ + map[string]interface{}{ + "name": "aux-entry-http-ingress-port", + "port": 32080, + }, + map[string]interface{}{ + "name": "aux-entry-https-ingress-port", + "port": 32443, + }, + }, + }, + }, + }, + } + + return []*unstructured.Unstructured{endpoints1, endpoints2, endpoints3, endpoints4} +} \ No newline at end of file