feat(iaas): min/max acc tests (#811)

* feat(iaas): security group min/max acc test

* feat(iaas): image min/max acc test

* feat(iaas): KeyPair min/max acc test

* feat(iaas): Network area min/max acc test
- fix: wrong atLeast-validator for `minimum_prefix_length`

* feat(iaas): Network min/max acc test

* feat(iaas): Volume min/max acc test
- fix: volume update doesn't work if no name was defined
- fix: volume.server_id can not be set
- fix: error message volume.size returns value but was null

* feat(iaas): Network interfaces min/max acc test

* feat(iaas): Affinity groups acc test

* feat(iaas): Server min/max acc test
- stackit_server_volume_attach
- stackit_server_network_interface_attach
- stackit_server_service_account_attach

* fix(iaas): acc test
- image: fix read of Config.VirtioScsi
- keypair: add missing RequiresReplace() for name
- server: add missing UserData read in datasource and resource

* feat(iaas): public ip acc test
- fix: when a nic is assigned to a public ip, the field network_interface_id leads to recreation
This commit is contained in:
Marcel Jacek 2025-05-09 08:49:04 +02:00 committed by GitHub
parent b5f955124a
commit c7c64a5806
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 3494 additions and 995 deletions

View file

@ -167,7 +167,6 @@ func (r *volumeResource) Schema(_ context.Context, _ resource.SchemaRequest, res
"server_id": schema.StringAttribute{
Description: "The server ID of the server to which the volume is attached to.",
Computed: true,
Optional: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
@ -234,6 +233,7 @@ func (r *volumeResource) Schema(_ context.Context, _ resource.SchemaRequest, res
"size": schema.Int64Attribute{
Description: "The size of the volume in GB. It can only be updated to a larger value than the current size. Either `size` or `source` must be provided",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Int64{
volumeResizeModifier{},
},
@ -575,6 +575,10 @@ func mapFields(ctx context.Context, volumeResp *iaas.Volume, model *Model) error
model.AvailabilityZone = types.StringPointerValue(volumeResp.AvailabilityZone)
model.Description = types.StringPointerValue(volumeResp.Description)
model.Name = types.StringPointerValue(volumeResp.Name)
// Workaround for volumes with no names which return an empty string instead of nil
if name := volumeResp.Name; name != nil && *name == "" {
model.Name = types.StringNull()
}
model.Labels = labels
model.PerformanceClass = types.StringPointerValue(volumeResp.PerformanceClass)
model.ServerId = types.StringPointerValue(volumeResp.ServerId)