Closed RickyHolland closed 2 years ago
How are you tagging the images? There are several related reports in this repo, under the same heading, see for more information:
You are correct that the timestamp (or lack of timestamp) is the reason your automation is not progressing. Flux v1 hard-depends on those timestamps for ordering the images in your repository to determine which one is the latest, and if it finds any images matching the regex filter that do not have timestamps, then it cannot know if that one should be the latest. It balks and you get this error message.
The good news is Flux v2 no longer has this dependency on the build timestamps. If you are building images with a serial number tag, you are already following the guidance here: https://fluxcd.io/docs/guides/sortable-image-tags/ so an upgrade should be an easy quick win here (🤞)
I am honestly not sure how those images are produced without a timestamp, but if you have made using reproducible builds an intentional decision (or if anyone did) then it is likely on purpose, as builds that carry a timestamp are incompatible with reproducibility.
If there's any more information that I can provide, I'll be happy to assist you with finding migration docs to support your upgrade from Flux v1 to Flux v2.
Thanks for the prompt reply @kingdonb.
We did some more troubleshooting on this issue today and seem to have resolved the issue by simply enclosing the tag in quotes.
image:
repository: merchstack/merchstack-vnext
tag: '256'
Whereas previously it was unquoted.
image:
repository: merchstack/merchstack-vnext
tag: 256
Following this change newly built images (for example with the tag 257) are automatically deployed by Flux and the manifest within the repo is also updated accordingly.
I have never seen that mode of failure before, but I'll be aware of it now. Thanks for reporting back and I think we can close this! 🎉
Describe the bug
We are currently utlising the automated image update functionality of Flux and have had success with it in most use cases but we are having a problem with a particular deployment and its image tags.
For context, our container images in this paticular scenario are being tagged as "imageName: buildNo", so an example would be "imageName: 230" and, following code changes, a new image would be built and tagged as "imageName: 231". What we are finding though is that Flux is not able to automatically deploy new images when tagged as such. Although Flux detects that a new image is available it is failing to update the deployment with the following error.
ts=2022-02-15T10:47:59.063660596Z caller=images.go:106 component=sync-loop workload=prod:helmrelease/merchstack-vnext-prod container=backend repo=merchstack/merchstack-vnext pattern=regexp:[0-9]+ current=merchstack/merchstack-vnext warning="image with zero created timestamp" current="merchstack/merchstack-vnext (0001-01-01 00:00:00 +0000 UTC)" latest="merchstack/merchstack-vnext:240 (2022-02-14 20:19:27.888522263 +0000 UTC)" action="skip container"
We've done further research into the "image with zero created timestamp" error and have so far been unable to find anything of use. We have even tried ensuring a build date/time is tagged to the image via the following command, but still no luck.
We can validate that Flux is successfully detecting the image but so far has been unable to deploy it.
We do have Flux's automated image update function working elsewhere, it just seems to be an issue with how we are tagging these particular images.
For context we are deploying our application via Helm using the Flux HelmOperator. We are using the following annotations to enable and control the automated image update function.
Steps to reproduce
Install Flux and the Flux HelmOperator. Create a release that uses the same image tag scheme as above.
Expected behavior
The new image should deploy automatically.
Kubernetes version / Distro / Cloud provider
AWS EKS - Kubernetes 1.21
Flux version
1.21
Git provider
GitHub
Container Registry provider
DockerHub
Additional context
No response
Maintenance Acknowledgement
Code of Conduct