@@ -53,7 +53,7 @@ const (
5353// +kubebuilder:object:generate=false
5454type AnalysisResult struct {
5555 ExternalID string
56- ExternalType string
56+ ConfigType string
5757 Summary string // Summary of the analysis
5858 Analysis map [string ]any // Detailed metadata of the analysis
5959 AnalysisType AnalysisType // Type of analysis, e.g. availability, compliance, cost, security, performance.
@@ -72,7 +72,7 @@ type AnalysisResult struct {
7272func (t * AnalysisResult ) ToConfigAnalysis () models.ConfigAnalysis {
7373 return models.ConfigAnalysis {
7474 ExternalID : t .ExternalID ,
75- ExternalType : t . ExternalType ,
75+ ConfigType : t . ConfigType ,
7676 Analyzer : t .Analyzer ,
7777 Message : strings .Join (t .Messages , ";" ),
7878 Severity : string (t .Severity ),
@@ -89,7 +89,7 @@ func (t *AnalysisResult) ToConfigAnalysis() models.ConfigAnalysis {
8989// +kubebuilder:object:generate=false
9090type ChangeResult struct {
9191 ExternalID string
92- ExternalType string
92+ ConfigType string
9393 ExternalChangeID string
9494 Action ChangeAction
9595 ChangeType string
@@ -102,7 +102,7 @@ type ChangeResult struct {
102102}
103103
104104func (c ChangeResult ) String () string {
105- return fmt .Sprintf ("%s/%s: %s" , c .ExternalType , c .ExternalID , c .ChangeType )
105+ return fmt .Sprintf ("%s/%s: %s" , c .ConfigType , c .ExternalID , c .ChangeType )
106106}
107107
108108func (result AnalysisResult ) String () string {
@@ -163,11 +163,11 @@ func (s *ScrapeResults) AddChange(change ChangeResult) *ScrapeResults {
163163 return s
164164}
165165
166- func (s * ScrapeResults ) Analysis (analyzer string , externalType string , id string ) * AnalysisResult {
166+ func (s * ScrapeResults ) Analysis (analyzer string , configType string , id string ) * AnalysisResult {
167167 result := AnalysisResult {
168- Analyzer : analyzer ,
169- ExternalType : externalType ,
170- ExternalID : id ,
168+ Analyzer : analyzer ,
169+ ConfigType : configType ,
170+ ExternalID : id ,
171171 }
172172 * s = append (* s , ScrapeResult {
173173 AnalysisResult : & result ,
@@ -187,13 +187,8 @@ type ScrapeResult struct {
187187 CreatedAt * time.Time `json:"created_at,omitempty"`
188188 DeletedAt * time.Time `json:"deleted_at,omitempty"`
189189 LastModified time.Time `json:"last_modified,omitempty"`
190- Type string `json:"type,omitempty"`
191- ExternalType string `json:"external_type,omitempty"`
192- Account string `json:"account,omitempty"`
193- Network string `json:"network,omitempty"`
194- Subnet string `json:"subnet,omitempty"`
195- Region string `json:"region,omitempty"`
196- Zone string `json:"zone,omitempty"`
190+ ConfigClass string `json:"config_class,omitempty"`
191+ Type string `json:"config_type,omitempty"`
197192 Name string `json:"name,omitempty"`
198193 Namespace string `json:"namespace,omitempty"`
199194 ID string `json:"id,omitempty"`
@@ -211,7 +206,7 @@ type ScrapeResult struct {
211206 Ignore []string `json:"-"`
212207 Action string `json:",omitempty"`
213208 ParentExternalID string `json:"-"`
214- ParentExternalType string `json:"-"`
209+ ParentType string `json:"-"`
215210}
216211
217212func NewScrapeResult (base BaseScraper ) * ScrapeResult {
@@ -236,12 +231,7 @@ func (s ScrapeResult) Clone(config interface{}) ScrapeResult {
236231 clone := ScrapeResult {
237232 LastModified : s .LastModified ,
238233 Aliases : s .Aliases ,
239- Type : s .Type ,
240- Account : s .Account ,
241- Network : s .Network ,
242- Subnet : s .Subnet ,
243- Region : s .Region ,
244- Zone : s .Zone ,
234+ ConfigClass : s .ConfigClass ,
245235 Name : s .Name ,
246236 Namespace : s .Namespace ,
247237 ID : s .ID ,
@@ -256,7 +246,7 @@ func (s ScrapeResult) Clone(config interface{}) ScrapeResult {
256246}
257247
258248func (r ScrapeResult ) String () string {
259- s := fmt .Sprintf ("%s/%s (%s)" , r .Type , r .Name , r .ID )
249+ s := fmt .Sprintf ("%s/%s (%s)" , r .ConfigClass , r .Name , r .ID )
260250
261251 if len (r .Changes ) > 0 {
262252 s += fmt .Sprintf (" changes=%d" , len (r .Changes ))
0 commit comments