/
zone_ingress_insight_types_helpers.go
60 lines (49 loc) 路 1.42 KB
/
zone_ingress_insight_types_helpers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
proto "github.com/kumahq/kuma/api/mesh/v1alpha1"
"github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/model"
"github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/registry"
)
func (cb *ZoneIngressInsight) GetObjectMeta() *metav1.ObjectMeta {
return &cb.ObjectMeta
}
func (cb *ZoneIngressInsight) SetObjectMeta(m *metav1.ObjectMeta) {
cb.ObjectMeta = *m
}
func (cb *ZoneIngressInsight) GetMesh() string {
return cb.Mesh
}
func (cb *ZoneIngressInsight) SetMesh(mesh string) {
cb.Mesh = mesh
}
func (cb *ZoneIngressInsight) GetSpec() map[string]interface{} {
return cb.Spec
}
func (cb *ZoneIngressInsight) SetSpec(spec map[string]interface{}) {
cb.Spec = spec
}
func (cb *ZoneIngressInsight) Scope() model.Scope {
return model.ScopeNamespace
}
func (l *ZoneIngressInsightList) 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(&proto.ZoneIngressInsight{}, &ZoneIngressInsight{
TypeMeta: metav1.TypeMeta{
APIVersion: GroupVersion.String(),
Kind: "ZoneIngressInsight",
},
})
registry.RegisterListType(&proto.ZoneIngressInsight{}, &ZoneIngressInsightList{
TypeMeta: metav1.TypeMeta{
APIVersion: GroupVersion.String(),
Kind: "ZoneIngressInsightList",
},
})
}