Skip to content

Commit 35bfdf4

Browse files
Cleanup: restructure kpis, extractors into compute + storage subfolders [skip ci]
1 parent 96c56f5 commit 35bfdf4

File tree

88 files changed

+462
-485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+462
-485
lines changed

helm/bundles/cortex-nova/templates/knowledges.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ spec:
192192
apiVersion: cortex.cloud/v1alpha1
193193
kind: Knowledge
194194
metadata:
195-
name: sap-host-details
195+
name: host-details
196196
spec:
197197
operator: cortex-nova
198198
extractor:

helm/bundles/cortex-nova/templates/kpis.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,52 +30,52 @@ spec:
3030
apiVersion: cortex.cloud/v1alpha1
3131
kind: KPI
3232
metadata:
33-
name: sap-host-total-allocatable-capacity
33+
name: host-total-allocatable-capacity
3434
spec:
3535
operator: cortex-nova
36-
impl: sap_host_total_allocatable_capacity_kpi
36+
impl: host_total_allocatable_capacity_kpi
3737
dependencies:
3838
knowledges:
39-
- name: sap-host-details
39+
- name: host-details
4040
- name: host-utilization
4141
description: |
42-
This KPI tracks the total allocatable capacity of SAP hosts.
42+
This KPI tracks the total allocatable capacity of hosts.
4343
---
4444
apiVersion: cortex.cloud/v1alpha1
4545
kind: KPI
4646
metadata:
47-
name: sap-host-capacity
47+
name: host-capacity
4848
spec:
4949
operator: cortex-nova
50-
impl: sap_host_capacity_kpi
50+
impl: host_capacity_kpi
5151
dependencies:
5252
knowledges:
53-
- name: sap-host-details
53+
- name: host-details
5454
- name: host-utilization
5555
description: |
56-
This KPI tracks the total allocatable capacity of SAP hosts.
56+
This KPI tracks the total allocatable capacity of hosts.
5757
---
5858
apiVersion: cortex.cloud/v1alpha1
5959
kind: KPI
6060
metadata:
61-
name: sap-host-running-vms
61+
name: host-running-vms
6262
spec:
6363
operator: cortex-nova
64-
impl: sap_host_running_vms_kpi
64+
impl: host_running_vms_kpi
6565
dependencies:
6666
knowledges:
67-
- name: sap-host-details
67+
- name: host-details
6868
- name: host-utilization
6969
description: |
70-
This KPI tracks the total number of running VMs on SAP hosts.
70+
This KPI tracks the total number of running VMs on hosts.
7171
---
7272
apiVersion: cortex.cloud/v1alpha1
7373
kind: KPI
7474
metadata:
75-
name: sap-flavors-running-vms
75+
name: flavors-running-vms
7676
spec:
7777
operator: cortex-nova
78-
impl: sap_flavor_running_vms_kpi
78+
impl: flavor_running_vms_kpi
7979
dependencies:
8080
datasources:
8181
- name: nova-servers
@@ -131,7 +131,7 @@ spec:
131131
impl: kvm_host_capacity_kpi
132132
dependencies:
133133
knowledges:
134-
- name: sap-host-details
134+
- name: host-details
135135
- name: host-utilization
136136
description: |
137137
This KPI tracks the total, utilized, reserved and failover capacity of KVM hosts.

internal/knowledge/extractor/plugins/shared/host_az.go renamed to internal/knowledge/extractor/plugins/compute/host_az.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2025 SAP SE
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package shared
4+
package compute
55

66
import (
77
_ "embed"

internal/knowledge/extractor/plugins/shared/host_az.sql renamed to internal/knowledge/extractor/plugins/compute/host_az.sql

File renamed without changes.

internal/knowledge/extractor/plugins/shared/host_az_test.go renamed to internal/knowledge/extractor/plugins/compute/host_az_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2025 SAP SE
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package shared
4+
package compute
55

66
import (
77
"os"
@@ -15,7 +15,7 @@ import (
1515
testlib "github.com/cobaltcore-dev/cortex/pkg/testing"
1616
)
1717

18-
func TestHostDetailsExtractor_Init(t *testing.T) {
18+
func TestHostAZExtractor_Init(t *testing.T) {
1919
extractor := &HostAZExtractor{}
2020
config := v1alpha1.KnowledgeSpec{}
2121
if err := extractor.Init(nil, nil, config); err != nil {

internal/knowledge/extractor/plugins/shared/host_capabilities.go renamed to internal/knowledge/extractor/plugins/compute/host_capabilities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2025 SAP SE
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package shared
4+
package compute
55

66
import (
77
_ "embed"

internal/knowledge/extractor/plugins/shared/host_capabilities.sql renamed to internal/knowledge/extractor/plugins/compute/host_capabilities.sql

File renamed without changes.

internal/knowledge/extractor/plugins/shared/host_capabilities_test.go renamed to internal/knowledge/extractor/plugins/compute/host_capabilities_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2025 SAP SE
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package shared
4+
package compute
55

66
import (
77
"testing"

internal/knowledge/extractor/plugins/sap/host_details.go renamed to internal/knowledge/extractor/plugins/compute/host_details.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2025 SAP SE
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package sap
4+
package compute
55

66
import (
77
"context"
@@ -11,7 +11,6 @@ import (
1111

1212
"github.com/cobaltcore-dev/cortex/api/v1alpha1"
1313
"github.com/cobaltcore-dev/cortex/internal/knowledge/extractor/plugins"
14-
"github.com/cobaltcore-dev/cortex/internal/knowledge/extractor/plugins/shared"
1514
"sigs.k8s.io/controller-runtime/pkg/client"
1615
)
1716

@@ -76,7 +75,7 @@ func (e *HostDetailsExtractor) Extract() ([]plugins.Feature, error) {
7675
return nil, err
7776
}
7877
pinnedProjects, err := v1alpha1.
79-
UnboxFeatureList[shared.HostPinnedProjects](pinnedProjectsKnowledge.Status.Raw)
78+
UnboxFeatureList[HostPinnedProjects](pinnedProjectsKnowledge.Status.Raw)
8079
if err != nil {
8180
return nil, err
8281
}
@@ -109,7 +108,7 @@ func (e *HostDetailsExtractor) Extract() ([]plugins.Feature, error) {
109108
return nil, err
110109
}
111110
hostAZs, err := v1alpha1.
112-
UnboxFeatureList[shared.HostAZ](azKnowledge.Status.Raw)
111+
UnboxFeatureList[HostAZ](azKnowledge.Status.Raw)
113112
if err != nil {
114113
return nil, err
115114
}

internal/knowledge/extractor/plugins/sap/host_details.sql renamed to internal/knowledge/extractor/plugins/compute/host_details.sql

File renamed without changes.

0 commit comments

Comments
 (0)