hetznercloud / terraform-provider-hcloud

Terraform Hetzner Cloud provider
https://registry.terraform.io/providers/hetznercloud/hcloud/latest
Mozilla Public License 2.0
495 stars 72 forks source link

Incorrect date format reported by "hcloud_image" datasource #368

Closed rkosegi closed 3 years ago

rkosegi commented 3 years ago

When trying to retrieve image details using hcloud_image datasource, I noticed that created property has redundant timezone offset:

# module.database.data.hcloud_image.my_image:
data "hcloud_image" "my_image" {
    created       = "2021-05-19 13:08:35 +0000 +0000"
.....
}

Notice +0000 +0000 at the end. This doesn't seems to be valid ISO8601 format

LKaemmerling commented 3 years ago

Hey @rkosegi,

which image do you try to query? When I query our API directly I can not get this result. Can you give me an ID?

rkosegi commented 3 years ago

It's image built using packer, here is full output

# module.database.data.hcloud_image.galera_image:
data "hcloud_image" "galera_image" {
    created       = "2021-05-19 13:08:35 +0000 +0000"
    description   = "galera"
    id            = 38594507
    labels        = {
        "component" = "database"
    }
    most_recent   = true
    os_flavor     = "ubuntu"
    rapid_deploy  = false
    type          = "snapshot"
    with_selector = "component=database"
}
LKaemmerling commented 3 years ago

Hey @rkosegi,

thank you for the issue. I was able to reproduce it and submitted a MR to fix the issue (#385). This will be fixed in the next release.