Skip to content

Commit

Permalink
Update sdk-go and fix date-time type
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-toa authored and outscale-rce committed Sep 11, 2024
1 parent 270c3f8 commit b0b4ca4
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 93 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/hashicorp/terraform-plugin-mux v0.12.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0
github.com/nav-inc/datetime v0.1.3
github.com/outscale/osc-sdk-go/v2 v2.21.0
github.com/outscale/osc-sdk-go/v2 v2.23.0
github.com/spf13/cast v1.6.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ github.com/nav-inc/datetime v0.1.3 h1:PaybPUsScX+Cd3TEa1tYpfwU61deCEhMTlCO2hONm1
github.com/nav-inc/datetime v0.1.3/go.mod h1:gKGf5G+cW7qkTo5TC/sieNyz6lYdrA9cf1PNV+pXIOE=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/outscale/osc-sdk-go/v2 v2.21.0 h1:8MqhexV+ALG76CvY8EpuQlr0+hC5VFrWQY4fHqdT358=
github.com/outscale/osc-sdk-go/v2 v2.21.0/go.mod h1:kzhtUErCzKYl87bZ+kDMphDafmnwbsyFJY9iHF7NgNE=
github.com/outscale/osc-sdk-go/v2 v2.23.0 h1:Ib134+ThQHmMtURcMTD9eTiAKeF1gSufbH3RdYa9+bY=
github.com/outscale/osc-sdk-go/v2 v2.23.0/go.mod h1:kzhtUErCzKYl87bZ+kDMphDafmnwbsyFJY9iHF7NgNE=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,14 @@ func buildOutscaleOapiSnapshootDataSourceFilters(set *schema.Set, filter *oscgo.
if err != nil {
return err
}
filter.SetToCreationDate(valDate)
filter.SetToCreationDate(valDate.UTC().Format("2006-01-02T15:04:05.999Z"))

case "from_creation_date":
valDate, err := utils.ParsingfilterToDateFormat("from_creation_date", values[0])
if err != nil {
return err
}
filter.SetFromCreationDate(valDate)
filter.SetFromCreationDate(valDate.UTC().Format("2006-01-02T15:04:05.999Z"))

case "permissions_to_create_volume_account_ids":
filter.SetPermissionsToCreateVolumeAccountIds(values)
Expand Down
4 changes: 1 addition & 3 deletions outscale/data_source_outscale_volumes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func TestAccOthers_VolumeDataSource_multipleVIdsFilters(t *testing.T) {
}

func TestAccVM_withVolumesDataSource(t *testing.T) {
t.Parallel()
omi := os.Getenv("OUTSCALE_IMAGEID")
keypair := os.Getenv("OUTSCALE_KEYPAIR")

Expand All @@ -59,8 +58,7 @@ func TestAccVM_withVolumesDataSource(t *testing.T) {
Config: testAccCheckOutscaleVolumesDataSourceConfigWithVM(utils.GetRegion(), omi, keypair),
Check: resource.ComposeTestCheckFunc(
testAccCheckOutscaleVolumeDataSourceID("data.outscale_volumes.outscale_volumes"),
// resource.TestCheckResourceAttr("data.outscale_volumes.outscale_volumes", "volumes.0.size", "1"),
// resource.TestCheckResourceAttr("data.outscale_volumes.outscale_volumes", "volumes.0.volume_type", "standard"),
resource.TestCheckResourceAttrSet("data.outscale_volumes.outscale_volumes", "volumes.#"),
),
},
},
Expand Down
16 changes: 8 additions & 8 deletions outscale/data_source_outscale_vpn_connections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ func testAccOutscaleVPNConnectionsDataSourceConfigBasic(publicIP string) string
}
resource "outscale_vpn_connection" "foo" {
client_gateway_id = "${outscale_client_gateway.customer_gateway.id}"
virtual_gateway_id = "${outscale_virtual_gateway.virtual_gateway.id}"
client_gateway_id = outscale_client_gateway.customer_gateway.id
virtual_gateway_id = outscale_virtual_gateway.virtual_gateway.id
connection_type = "ipsec.1"
static_routes_only = true
tags {
key = "Name"
value = "test-VPN"
key = "Name"
value = "test-VPN"
}
}
data "outscale_vpn_connections" "test" {
vpn_connection_ids = ["${outscale_vpn_connection.foo.id}"]
vpn_connection_ids = [outscale_vpn_connection.foo.id]
}
`, publicIP)
}
Expand All @@ -81,15 +81,15 @@ func testAccOutscaleVPNConnectionsDataSourceConfigWithFilters(publicIP string) s
}
resource "outscale_vpn_connection" "foo" {
client_gateway_id = "${outscale_client_gateway.customer_gateway.id}"
virtual_gateway_id = "${outscale_virtual_gateway.virtual_gateway.id}"
client_gateway_id = outscale_client_gateway.customer_gateway.id
virtual_gateway_id = outscale_virtual_gateway.virtual_gateway.id
connection_type = "ipsec.1"
}
data "outscale_vpn_connections" "test" {
filter {
name = "vpn_connection_ids"
values = ["${outscale_vpn_connection.foo.id}"]
values = [outscale_vpn_connection.foo.id]
}
}
`, publicIP)
Expand Down
2 changes: 1 addition & 1 deletion outscale/resource_outscale_load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ func ResourceOutscaleLoadBalancerUpdate(d *schema.ResourceData, meta interface{}
s := tag["key"].(string)
remove = append(remove,
oscgo.ResourceLoadBalancerTag{
Key: &s,
Key: s,
})
}
if len(remove) < 1 {
Expand Down
Loading

0 comments on commit b0b4ca4

Please sign in to comment.