Hi, I tried to find a relevant issue (pretty sure...
# general
c
Hi, I tried to find a relevant issue (pretty sure it exists somewhere), but I can't, so I ask here, before opening one. During preview, when checking the details, pulumi shows array elements out of order, making it really hard to figure out what changed, especially when trying to import a resource and some property not the same as on the environment. The actual comparison is fine, so if the input/output array is the same, pulumi does not show any difference, so it's only a problem when there is a difference and it tries to show what it is. It happens in multiple languages (ts, go) and multiple resources (e.g.: kubernetes deployment environment, aws rds parametergroup etc), basically anywhere, where a field is an array. Here's a kubernetes example, from a deployment spec:
Copy code
~ spec: {
  ~ template: {
      ~ spec: {
          ~ containers: [
              ~ [0]: {
                      ~ env: [
                          ~ [0]: {
                                  ~ name : "LOG_LEVEL" => "CLOUDFLARE_CACHE"
                                  ~ value: "debug" => "false"
                                }
                          ~ [1]: {
                                  ~ name : "AWS_REGION" => "CONFIG"
                                  ~ value: "eu-west-1" => "/.dliver-media-service.yml"
                                }
                          ~ [2]: {
                                  ~ name : "AWS_BUCKET" => "MEDIA_CACHE_URL"
                                  ~ value: "bucket" => "media-url"
                                }
                          ~ [3]: {
                                  ~ name : "CLOUDFLARE_API_TOKEN" => "STREAM_CONTROL_HOST"
                                  ~ value: "no-cloudflare-cache-on-dev" => "stream-control"
                                }
                          ~ [4]: {
                                  ~ name : "CLOUDFLARE_CACHE" => "LOG_LEVEL"
                                  ~ value: "false" => "debug"
                                }
                          ~ [5]: {
                                  ~ name : "CLOUDFLARE_ZONE_ID" => "AWS_REGION"
                                  ~ value: "no-zone-id-on-dev" => "eu-west-1"
                                }
                          ~ [6]: {
                                  ~ name : "CONFIG" => "CLOUDFLARE_API_TOKEN"
                                  ~ value: "/.dliver-media-service.yml" => "no-cloudflare-cache-on-dev"
                                }
                          ~ [7]: {
                                  ~ name : "IMAGE_PROCESSOR_HOST" => "REDIS_CACHE_HOST"
                                  ~ value: "image-processor" => "redis-cache"
                                }
                          ~ [8]: {
                                  ~ name : "MEDIA_CACHE_URL" => "REDIS_CACHE_DATABASE"
                                  ~ value: "media-url" => "7"
                                }
                          ~ [9]: {
                                  ~ name : "STREAM_CONTROL_HOST" => "JWT_SECRET"
                                  ~ value: "stream-control" => "[secret]"
                                }
                          ~ [10]: {
                                  ~ name : "REDIS_CACHE_HOST" => "AWS_BUCKET"
                                  ~ value: "redis-cache" => "bucket"
                                }
                          ~ [11]: {
                                  ~ name : "REDIS_CACHE_DATABASE" => "CLOUDFLARE_ZONE_ID"
                                  ~ value: "7" => "no-zone-id-on-dev"
                                }
                          ~ [12]: {
                                  ~ name : "JWT_SECRET" => "IMAGE_PROCESSOR_HOST"
                                  ~ value: "[secret]" => "image-processor"
                                }
                        ]
                    }
            ]
        }
    }
}
I reordered the list manually and the env values were the same... So on top of that, I don't know why it thinks they are different, making it hard to figure out which one is the actual field with the wrong value. 🙂