Ver Fonte

Ignore bingen encoding for types that are not ready to use (#3495)

Niko Kovacevic há 5 meses atrás
pai
commit
76a4bffbe4

+ 5 - 5
core/pkg/model/kubemodel/kubemodel.go

@@ -12,11 +12,11 @@ type KubeModelSet struct {
 	Window     Window                `json:"window"`               // @bingen:field[version=1]
 	Cluster    *Cluster              `json:"cluster"`              // @bingen:field[version=1]
 	Namespaces map[string]*Namespace `json:"namespaces"`           // @bingen:field[version=1]
-	Containers map[string]*Container `json:"containers,omitempty"` // @bingen:field[version=1]
-	Owners     map[string]*Owner     `json:"owners,omitempty"`     // @bingen:field[version=1]
-	Nodes      map[string]*Node      `json:"nodes,omitempty"`      // @bingen:field[version=1]
-	Pods       map[string]*Pod       `json:"pods,omitempty"`       // @bingen:field[version=1]
-	Services   map[string]*Service   `json:"services,omitempty"`   // @bingen:field[version=1]
+	Containers map[string]*Container `json:"containers,omitempty"` // @bingen:field[ignore]
+	Owners     map[string]*Owner     `json:"owners,omitempty"`     // @bingen:field[ignore]
+	Nodes      map[string]*Node      `json:"nodes,omitempty"`      // @bingen:field[ignore]
+	Pods       map[string]*Pod       `json:"pods,omitempty"`       // @bingen:field[ignore]
+	Services   map[string]*Service   `json:"services,omitempty"`   // @bingen:field[ignore]
 	idx        *kubeModelSetIndexes  // @bingen:field[ignore]
 }
 

+ 15 - 16
core/pkg/model/kubemodel/node.go

@@ -2,24 +2,23 @@ package kubemodel
 
 import "time"
 
-// @bingen:generate:Node
 type Node struct {
-	UID                          string            `json:"uid"`                          // @bingen:field[version=1]
-	ClusterUID                   string            `json:"clusterUid"`                   // @bingen:field[version=1]
-	ProviderResourceUID          string            `json:"providerResourceUid"`          // @bingen:field[version=1]
-	Name                         string            `json:"name"`                         // @bingen:field[version=1]
-	Labels                       map[string]string `json:"labels,omitempty"`             // @bingen:field[version=1]
-	Annotations                  map[string]string `json:"annotations,omitempty"`        // @bingen:field[version=1]
-	Start                        time.Time         `json:"start"`                        // @bingen:field[version=1]
-	End                          time.Time         `json:"end"`                          // @bingen:field[version=1]
-	CpuMillicoreSecondsAllocated uint64            `json:"cpuMillicoreSecondsAllocated"` // @bingen:field[version=1]
-	RAMByteSecondsAllocated      uint64            `json:"ramByteSecondsAllocated"`      // @bingen:field[version=1]
+	UID                          string            `json:"uid"`
+	ClusterUID                   string            `json:"clusterUid"`
+	ProviderResourceUID          string            `json:"providerResourceUid"`
+	Name                         string            `json:"name"`
+	Labels                       map[string]string `json:"labels,omitempty"`
+	Annotations                  map[string]string `json:"annotations,omitempty"`
+	Start                        time.Time         `json:"start"`
+	End                          time.Time         `json:"end"`
+	CpuMillicoreSecondsAllocated uint64            `json:"cpuMillicoreSecondsAllocated"`
+	RAMByteSecondsAllocated      uint64            `json:"ramByteSecondsAllocated"`
 	// PublicIPSeconds represents the cumulative public IP allocation (count × seconds) for this node.
 	// Calculated as: number of ExternalIP addresses from Kubernetes node Status.Addresses × window duration in seconds.
 	// Used for cost attribution of public IP addresses associated with the node.
-	PublicIPSecondsAllocated uint64 `json:"publicIpSecondsAllocated"` // @bingen:field[version=1]
-	CpuMillicoreUsageAverage uint64 `json:"cpuMillicoreUsageAverage"` // @bingen:field[version=1]
-	CpuMillicoreUsageMax     uint64 `json:"cpuMillicoreUsageMax"`     // @bingen:field[version=1]
-	RAMByteUsageAverage      uint64 `json:"ramByteUsageAverage"`      // @bingen:field[version=1]
-	RAMByteUsageMax          uint64 `json:"ramByteUsageMax"`          // @bingen:field[version=1]
+	PublicIPSecondsAllocated uint64 `json:"publicIpSecondsAllocated"`
+	CpuMillicoreUsageAverage uint64 `json:"cpuMillicoreUsageAverage"`
+	CpuMillicoreUsageMax     uint64 `json:"cpuMillicoreUsageMax"`
+	RAMByteUsageAverage      uint64 `json:"ramByteUsageAverage"`
+	RAMByteUsageMax          uint64 `json:"ramByteUsageMax"`
 }

+ 9 - 11
core/pkg/model/kubemodel/owner.go

@@ -2,7 +2,6 @@ package kubemodel
 
 import "time"
 
-// @bingen:generate:OwnerKind
 type OwnerKind string
 
 const (
@@ -15,15 +14,14 @@ const (
 )
 
 // Owner represents a Kubernetes resource owner
-// @bingen:generate:Owner
 type Owner struct {
-	UID         string            `json:"uid"`                   // @bingen:field[version=1]
-	OwnerUID    string            `json:"ownerUid"`              // @bingen:field[version=1]
-	Name        string            `json:"name"`                  // @bingen:field[version=1]
-	Kind        OwnerKind         `json:"kind"`                  // @bingen:field[version=1]
-	Controller  bool              `json:"controller"`            // @bingen:field[version=1]
-	Labels      map[string]string `json:"labels,omitempty"`      // @bingen:field[version=1]
-	Annotations map[string]string `json:"annotations,omitempty"` // @bingen:field[version=1]
-	Start       time.Time         `json:"start"`                 // @bingen:field[version=1]
-	End         time.Time         `json:"end"`                   // @bingen:field[version=1]
+	UID         string            `json:"uid"`
+	OwnerUID    string            `json:"ownerUid"`
+	Name        string            `json:"name"`
+	Kind        OwnerKind         `json:"kind"`
+	Controller  bool              `json:"controller"`
+	Labels      map[string]string `json:"labels,omitempty"`
+	Annotations map[string]string `json:"annotations,omitempty"`
+	Start       time.Time         `json:"start"`
+	End         time.Time         `json:"end"`
 }

+ 13 - 14
core/pkg/model/kubemodel/pod.go

@@ -2,19 +2,18 @@ package kubemodel
 
 import "time"
 
-// @bingen:generate:Pod
 type Pod struct {
-	UID                        string            `json:"uid"`                        // @bingen:field[version=1]
-	NamespaceUID               string            `json:"namespaceUid"`               // @bingen:field[version=1]
-	OwnerUID                   string            `json:"ownerUid"`                   // @bingen:field[version=1]
-	NodeUID                    string            `json:"nodeUid"`                    // @bingen:field[version=1]
-	Name                       string            `json:"name"`                       // @bingen:field[version=1]
-	Labels                     map[string]string `json:"labels,omitempty"`           // @bingen:field[version=1]
-	Annotations                map[string]string `json:"annotations,omitempty"`      // @bingen:field[version=1]
-	Start                      time.Time         `json:"start"`                      // @bingen:field[version=1]
-	End                        time.Time         `json:"end"`                        // @bingen:field[version=1]
-	CpuMillicoreUsageMax       uint64            `json:"cpuMillicoreUsageMax"`       // @bingen:field[version=1]
-	RAMByteUsageMax            uint64            `json:"ramByteUsageMax"`            // @bingen:field[version=1]
-	NetworkTransferBytes       uint64            `json:"networkTransferBytes"`       // @bingen:field[version=1]
-	NetworkReceiveBytes        uint64            `json:"networkReceiveBytes"`        // @bingen:field[version=1]
+	UID                  string            `json:"uid"`
+	NamespaceUID         string            `json:"namespaceUid"`
+	OwnerUID             string            `json:"ownerUid"`
+	NodeUID              string            `json:"nodeUid"`
+	Name                 string            `json:"name"`
+	Labels               map[string]string `json:"labels,omitempty"`
+	Annotations          map[string]string `json:"annotations,omitempty"`
+	Start                time.Time         `json:"start"`
+	End                  time.Time         `json:"end"`
+	CpuMillicoreUsageMax uint64            `json:"cpuMillicoreUsageMax"`
+	RAMByteUsageMax      uint64            `json:"ramByteUsageMax"`
+	NetworkTransferBytes uint64            `json:"networkTransferBytes"`
+	NetworkReceiveBytes  uint64            `json:"networkReceiveBytes"`
 }

+ 18 - 19
core/pkg/model/kubemodel/service.go

@@ -2,7 +2,6 @@ package kubemodel
 
 import "time"
 
-// @bingen:generate:ServiceType
 type ServiceType string
 
 const (
@@ -14,26 +13,26 @@ const (
 
 // @bingen:generate:ServicePort
 type ServicePort struct {
-	Name       string `json:"name"`       // @bingen:field[version=1]
-	Port       uint16 `json:"port"`       // @bingen:field[version=1]
-	TargetPort uint16 `json:"targetPort"` // @bingen:field[version=1]
-	NodePort   uint16 `json:"nodePort"`   // @bingen:field[version=1]
-	Protocol   string `json:"protocol"`   // @bingen:field[version=1]
+	Name       string `json:"name"`
+	Port       uint16 `json:"port"`
+	TargetPort uint16 `json:"targetPort"`
+	NodePort   uint16 `json:"nodePort"`
+	Protocol   string `json:"protocol"`
 }
 
 // @bingen:generate:Service
 type Service struct {
-	UID                  string            `json:"uid"`                   // @bingen:field[version=1]
-	ClusterUID           string            `json:"clusterUid"`            // @bingen:field[version=1]
-	NamespaceUID         string            `json:"namespaceUid"`          // @bingen:field[version=1]
-	Name                 string            `json:"name"`                  // @bingen:field[version=1]
-	Type                 ServiceType       `json:"type"`                  // @bingen:field[version=1]
-	Hostname             string            `json:"hostname,omitempty"`    // @bingen:field[version=1]
-	Labels               map[string]string `json:"labels,omitempty"`      // @bingen:field[version=1]
-	Annotations          map[string]string `json:"annotations,omitempty"` // @bingen:field[version=1]
-	Ports                []ServicePort     `json:"ports,omitempty"`       // @bingen:field[version=1]
-	Start                time.Time         `json:"start"`                 // @bingen:field[version=1]
-	End                  time.Time         `json:"end"`                   // @bingen:field[version=1]
-	NetworkTransferBytes uint64            `json:"networkTransferBytes"`  // @bingen:field[version=1]
-	NetworkReceiveBytes  uint64            `json:"networkReceiveBytes"`   // @bingen:field[version=1]
+	UID                  string            `json:"uid"`
+	ClusterUID           string            `json:"clusterUid"`
+	NamespaceUID         string            `json:"namespaceUid"`
+	Name                 string            `json:"name"`
+	Type                 ServiceType       `json:"type"`
+	Hostname             string            `json:"hostname,omitempty"`
+	Labels               map[string]string `json:"labels,omitempty"`
+	Annotations          map[string]string `json:"annotations,omitempty"`
+	Ports                []ServicePort     `json:"ports,omitempty"`
+	Start                time.Time         `json:"start"`
+	End                  time.Time         `json:"end"`
+	NetworkTransferBytes uint64            `json:"networkTransferBytes"`
+	NetworkReceiveBytes  uint64            `json:"networkReceiveBytes"`
 }