Skip to content

feat(CCE): cce node pool resource add param partition #6740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/resources/cce_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ The following arguments are supported:
which is supported by clusters of v1.23.6-r0 to v1.25 or clusters of v1.25.2-r0 or later versions.
The [object](#hostname_config) structure is documented below.

* `partition` - (Optional, String, NonUpdatable) Specifies the partition to which the node belongs. Value options:
+ **center**: center cloud.
+ The availability zone ID of the edge station.

<a name="extension_nics"></a>
The `extension_nics` block supports:

Expand Down
4 changes: 4 additions & 0 deletions docs/resources/cce_node_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ The following arguments are supported:
which is supported by clusters of v1.23.6-r0 to v1.25 or clusters of v1.25.2-r0 or later versions.
The [object](#hostname_config) structure is documented below.

* `partition` - (Optional, String, NonUpdatable) Specifies the partition to which the node belongs. Value options:
+ **center**: center cloud.
+ The availability zone ID of the edge station.

* `extension_scale_groups` - (Optional, List) Specifies the configurations of extended scaling groups in the node pool.
The [object](#extension_scale_groups) structure is documented below.

Expand Down
9 changes: 4 additions & 5 deletions huaweicloud/services/cce/resource_huaweicloud_cce_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ func ResourceNode() *schema.Resource {
},
},
},
"partition": {
Type: schema.TypeString,
Optional: true,
},
"enterprise_project_id": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -350,11 +354,6 @@ func ResourceNode() *schema.Resource {
Optional: true,
Deprecated: "will be removed after v1.26.0",
},
"partition": {
Type: schema.TypeString,
Optional: true,
Description: "schema: Internal",
},
},
}
}
Expand Down
10 changes: 9 additions & 1 deletion huaweicloud/services/cce/resource_huaweicloud_cce_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var nodePoolNonUpdatableParams = []string{
"extend_params.*.agency_name", "extend_params.*.kube_reserved_mem", "extend_params.*.system_reserved_mem",
"extend_params.*.security_reinforcement_type", "extend_params.*.market_type", "extend_params.*.spot_price",
"security_groups", "pod_security_groups", "ecs_group_id", "hostname_config", "hostname_config.*.type",
"max_pods", "preinstall", "postinstall", "extend_param",
"max_pods", "preinstall", "postinstall", "extend_param", "partition",
}

func ResourceNodePool() *schema.Resource {
Expand Down Expand Up @@ -245,6 +245,10 @@ func ResourceNodePool() *schema.Resource {
},
},
},
"partition": {
Type: schema.TypeString,
Optional: true,
},
"enterprise_project_id": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -544,6 +548,10 @@ func buildNodePoolCreateOpts(d *schema.ResourceData, cfg *config.Config) (*nodep
}
}

if v, ok := d.GetOk("partition"); ok {
createOpts.Spec.NodeTemplate.Partition = v.(string)
}

log.Printf("[DEBUG] Create Options: %#v", createOpts)
// Add loginSpec here, so it wouldn't go in the above log entry
loginSpec, err := buildResourceNodeLoginSpec(d)
Expand Down
Loading