Feat: add egress_address_ranges attribute to ske resource (#672)
* feat: add egress_address_ranges attribute to ske resource * docs: generate new docs for ske
This commit is contained in:
parent
170041f807
commit
c4e25f560b
5 changed files with 40 additions and 5 deletions
|
|
@ -77,6 +77,7 @@ type Model struct {
|
|||
Network types.Object `tfsdk:"network"`
|
||||
Hibernations types.List `tfsdk:"hibernations"`
|
||||
Extensions types.Object `tfsdk:"extensions"`
|
||||
EgressAddressRanges types.List `tfsdk:"egress_address_ranges"`
|
||||
}
|
||||
|
||||
// Struct corresponding to Model.NodePools[i]
|
||||
|
|
@ -374,6 +375,11 @@ func (r *clusterResource) Schema(_ context.Context, _ resource.SchemaRequest, re
|
|||
Description: "Flag to specify if privileged mode for containers is enabled or not.\nThis should be used with care since it also disables a couple of other features like the use of some volume type (e.g. PVCs).\nDeprecated as of Kubernetes 1.25 and later",
|
||||
Optional: true,
|
||||
},
|
||||
"egress_address_ranges": schema.ListAttribute{
|
||||
Description: "The outgoing network ranges (in CIDR notation) of traffic originating from workload on the cluster.",
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
"node_pools": schema.ListNestedAttribute{
|
||||
Description: "One or more `node_pool` block as defined below.",
|
||||
Required: true,
|
||||
|
|
@ -1320,6 +1326,15 @@ func mapFields(ctx context.Context, cl *ske.Cluster, m *Model) error {
|
|||
m.AllowPrivilegedContainers = types.BoolPointerValue(cl.Kubernetes.AllowPrivilegedContainers)
|
||||
}
|
||||
|
||||
m.EgressAddressRanges = types.ListNull(types.StringType)
|
||||
if cl.Status != nil {
|
||||
var diags diag.Diagnostics
|
||||
m.EgressAddressRanges, diags = types.ListValueFrom(ctx, types.StringType, cl.Status.EgressAddressRanges)
|
||||
if diags.HasError() {
|
||||
return fmt.Errorf("map egressAddressRanges: %w", core.DiagsToError(diags))
|
||||
}
|
||||
}
|
||||
|
||||
err := mapNodePools(ctx, cl, m)
|
||||
if err != nil {
|
||||
return fmt.Errorf("map node_pools: %w", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue