Skip to content

Commit fa5f6f4

Browse files
committed
chore(resmgr): move cluster-scoped types out of the blueprint files
Removing vm_high_availability / auto_resource_rebalancing from pcd_cluster_blueprint (v0.1.6) left rebalanceAPI unreferenced, which golangci-lint's `unused` check flags on main. haAPI, haAttrTypes and rebalanceAttrTypes are still live but belong to pcd_cluster, not the blueprint; relocate them beside their siblings in cluster_resource.go and drop the dead type. No behavior change; build, vet, unit tests and golangci-lint 2.12.2 (the CI version) all pass.
1 parent fddd13f commit fa5f6f4

3 files changed

Lines changed: 14 additions & 20 deletions

File tree

internal/services/resmgr/blueprint_data_source.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@ type blueprintAPI struct {
5959
StorageBackends json.RawMessage `json:"storageBackends"`
6060
}
6161

62-
type haAPI struct {
63-
Enabled bool `json:"enabled"`
64-
}
65-
66-
type rebalanceAPI struct {
67-
Enabled bool `json:"enabled"`
68-
RebalancingStrategy string `json:"rebalancingStrategy"`
69-
RebalancingFrequencyMins int64 `json:"rebalancingFrequencyMins"`
70-
}
71-
7262
type virtualNetworkingAPI struct {
7363
Enabled bool `json:"enabled"`
7464
UnderlayType string `json:"underlayType"`

internal/services/resmgr/blueprint_resource.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,6 @@ type blueprintResourceModel struct {
5252
StorageBackendsJSON types.String `tfsdk:"storage_backends_json"`
5353
}
5454

55-
var haAttrTypes = map[string]attr.Type{
56-
"enabled": types.BoolType,
57-
}
58-
59-
var rebalanceAttrTypes = map[string]attr.Type{
60-
"enabled": types.BoolType,
61-
"rebalancing_strategy": types.StringType,
62-
"rebalancing_frequency_mins": types.Int64Type,
63-
}
64-
6555
func (r *blueprintResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
6656
resp.TypeName = req.ProviderTypeName + "_cluster_blueprint"
6757
}

internal/services/resmgr/cluster_resource.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ type clusterModel struct {
4545
CPU types.Object `tfsdk:"cpu"`
4646
}
4747

48+
var haAttrTypes = map[string]attr.Type{
49+
"enabled": types.BoolType,
50+
}
51+
52+
var rebalanceAttrTypes = map[string]attr.Type{
53+
"enabled": types.BoolType,
54+
"rebalancing_strategy": types.StringType,
55+
"rebalancing_frequency_mins": types.Int64Type,
56+
}
57+
4858
var clusterGPUAttrTypes = map[string]attr.Type{
4959
"enabled": types.BoolType,
5060
"mode": types.StringType,
@@ -77,6 +87,10 @@ type clusterRebalanceAPI struct {
7787
RebalancingFrequencyMins *int64 `json:"rebalancingFrequencyMins,omitempty"`
7888
}
7989

90+
type haAPI struct {
91+
Enabled bool `json:"enabled"`
92+
}
93+
8094
type clusterGPUAPI struct {
8195
Enabled bool `json:"enabled"`
8296
Mode string `json:"mode"`

0 commit comments

Comments
 (0)