Skip to content

versionfilter: latest Selects Older Image from AWS ECR Despite imagePushedAt Timestamp #5751

@eMe-404

Description

@eMe-404

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The versionfilter of kind: latest is not correctly identifying the most recently published artifact when targeting a Helm chart in an AWS ECR repository.

When multiple image tags exist, the filter selects a version with an older imagePushedAt timestamp instead of the one with the newest timestamp, which contradicts the expected behavior of the latest filter.

Expected Behavior

Expected Behavior

UpdateCLI should select 2.3.0-Test-Promotion.1 as the result because its imagePushedAt timestamp is the most recent.

Actual Behavior

UpdateCLI incorrectly selects 1.5.0-Test-Promotion-troubleshooting-v5.2, which has an older imagePushedAt timestamp.

Supporting Evidence

The aws ecr describe-images command confirms the imagePushedAt timestamp for the incorrectly selected version is older:

{
  "imageDetails": [
    {
      "repositoryName": "atlas-helm/prometheus-agent",
      "imageTags": [ "1.5.0-Test-Promotion-troubleshooting-v5.2" ],
      "imagePushedAt": "2025-03-25T15:58:14.235000+08:00"
    }
  ]
}

This suggests the filter might not be correctly parsing or sorting by the imagePushedAt field from the ECR API response.

Steps To Reproduce

Steps to Reproduce

  1. Configure an UpdateCLI source for an OCI Helm chart in AWS ECR using versionfilter: latest.
    sources:
      my-chart:
        kind: helmchart
        spec:
          url: "oci://<aws_account_id>.dkr.ecr.<region>.amazonaws.com/my-repo"
          name: "my-chart"
          auth:
            helm:
              username: "AWS"
              password: '{{ requiredEnv "ECR_TOKEN" }}'
          versionfilter:
            kind: latest
  2. Ensure the repository contains at least two versions with different imagePushedAt timestamps, for example:
    • Version A: 2.3.0-Test-Promotion.1 (Pushed at: 2025-07-29)
    • Version B: 1.5.0-Test-Promotion-troubleshooting-v5.2 (Pushed at: 2025-03-25)
  3. Run updatecli apply.

Environment

- OS:  Ubuntu 24.04.2
- updatecli: updatecli/updatecli-action@v2
Set default value for version to v0.104.0
VERSION

Application:	0.104.0
Golang     :	1.24.5 linux/amd64
Build Time :	2025-07-13T07:48:55Z

Pipeline Graph

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions