Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image update automation appending instead of replacing #267

Closed
freefood89 opened this issue Jun 8, 2022 · 3 comments · Fixed by #268
Closed

Image update automation appending instead of replacing #267

freefood89 opened this issue Jun 8, 2022 · 3 comments · Fixed by #268
Assignees
Labels
bug Something isn't working

Comments

@freefood89
Copy link

freefood89 commented Jun 8, 2022

Hello, I'm experiencing issues with image update automation where the latest tag is being appended to the image tag instead of replacing it.

version: ghcr.io/fluxcd/image-automation-controller:v0.22.1

The tag in the original manifest is gcr.io/xyz/crasample:develop-deadbeef-0, the latest tag is gcr.io/xyz/crasample:develop-deadbeef-3 and the automation result is gcr.io/xyz/crasample:develop-deadbeef-0:develop-deadbeef-3

When the manifest was gcr.io/xyz/crasample:5.0.0 the result was gcr.io/xyz/crasample:5.0.0:develop-deadbeef-3

apiVersion: image.toolkit.fluxcd.io/v1beta1
kind: ImagePolicy
metadata:
  name: crasample-crasample
  namespace: some-namespace
spec:
  filterTags:
    extract: $ts
    pattern: ^develop-[a-fA-F0-9]+-(?P<ts>.*)
  imageRepositoryRef:
    name: crasample-crasample
    namespace: convai
  policy:
    numerical:
      order: asc

apiVersion: apps/v1
kind: Deployment
spec:
  ...
      containers:
      - image: gcr.io/nosidelines/crasample:develop-deadbeef-0 # {"$imagepolicy": "some-namespace:crasample-crasample"}
~ flux get all -n some-namespace
NAME                               	LAST SCAN                	SUSPENDED	READY	MESSAGE                        
imagerepository/crasample-crasample	2022-06-07T13:57:16-10:00	False    	True 	successful scan, found 61 tags	

NAME                           	LATEST IMAGE                                                      	READY	MESSAGE                                                                                                
imagepolicy/crasample-crasample	gcr.io/xyz/crasample:develop-deadbeef-0:develop-deadbeef-3	True 	Latest image tag for 'gcr.io/xyz/crasample:develop-deadbeef-0' resolved to: develop-deadbeef-3	

NAME                                	LAST RUN                 	SUSPENDED	READY	MESSAGE                                                                                                                                                                                           
imageupdateautomation/team-manifests	2022-05-19T13:41:00-10:00	False    	False	encountered invalid image ref "gcr.io/xyz/crasample:develop-deadbeef-0:develop-deadbeef-3": could not parse reference: gcr.io/xyz/crasample:develop-deadbeef-0:develop-deadbeef-3	
@stefanprodan
Copy link
Member

Can you post here your ImageRepository YAML please.

@stefanprodan stefanprodan transferred this issue from fluxcd/image-automation-controller Jun 8, 2022
@stefanprodan stefanprodan added the bug Something isn't working label Jun 8, 2022
@stefanprodan
Copy link
Member

I've managed to reproduce this, the issue comes from setting a tag in the ImageRepository, starting with next version we'll error out when tags are used in .spec.image.

@stefanprodan stefanprodan self-assigned this Jun 8, 2022
@freefood89
Copy link
Author

thank you. you were right about the tag in the ImageRepository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants