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 policy doesn't support kustomization #1376

Closed
rverma-dev opened this issue May 4, 2021 · 1 comment
Closed

Image update policy doesn't support kustomization #1376

rverma-dev opened this issue May 4, 2021 · 1 comment

Comments

@rverma-dev
Copy link

rverma-dev commented May 4, 2021

Describe the bug

ImageUpdation doesn't work on flux's Kustomization. Image policy reflect the right image though.

To Reproduce

Steps to reproduce the behaviour:
If we have image ovveride in the Kustomization like

apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
  name: demo
  namespace: apps
spec:
  images:
    - name: ghcr.io/nslhb/rollouts-demo
      newTag: green # {"$imagepolicy": "apps:rollouts-demo:tag"}

and define Imageupdation as

apiVersion: image.toolkit.fluxcd.io/v1alpha2
kind: ImageUpdateAutomation
metadata:
  name: flux-system
  namespace: flux-system
spec:
  git:
    checkout:
      ref:
        branch: main
    commit:
      author:
        email: [email protected]
        name: fluxcdbot
      messageTemplate: '{{range .Updated.Images}}{{println .}}{{end}}'
    push:
      branch: main
  interval: 1m0s
  sourceRef:
    kind: GitRepository
    name: flux-system
  update:
    path: ./tenants/services/ap-south-1
    strategy: Setters

Expected behavior

Flux should commit the newly discoverd image as reflected by imagepolicy.

Additional context

  • Kubernetes version: 1.19
  • Git provider: github
  • Container registry provider: github

Below please provide the output of the following commands:

flux --version : 0.13.2
flux check : all checks passed 

Image automation controller log

{"level":"info","ts":"2021-05-02T16:50:03.095Z","logger":"controller-runtime.manager.controller.imageupdateautomation","msg":"Starting workers","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","worker count":1}
{"level":"error","ts":"2021-05-03T12:19:57.450Z","logger":"controller-runtime.manager.controller.imageupdateautomation","msg":"Reconciler error","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","name":"flux-system","namespace":"flux-system","error":"object not found"}
{"level":"error","ts":"2021-05-03T12:50:43.095Z","logger":"controller-runtime.manager.controller.imageupdateautomation","msg":"Reconciler error","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","name":"flux-system","namespace":"flux-system","error":"object not found"}

another thing is that the ImageUpdateAutomation have namespace as flux-system
while ImageRepository/ImagePolicy belong to namespace apps

---
apiVersion: image.toolkit.fluxcd.io/v1alpha2
kind: ImageRepository
metadata:
  name: rollouts-demo
  namespace: apps
spec:
  image: ghcr.io/nslhb/rollouts-demo
  interval: 1m0s

---
apiVersion: image.toolkit.fluxcd.io/v1alpha2
kind: ImagePolicy
metadata:
  name: rollouts-demo
  namespace: apps
spec:
  imageRepositoryRef:
    name: rollouts-demo
  filterTags:
    pattern: '^${color}-(?P<timestamp>.*)-(?P<sha>.*)$'
    extract: '$timestamp'
  policy:
    numerical:
      order: asc
@stefanprodan
Copy link
Member

another thing is that the ImageUpdateAutomation have namespace as flux-system while ImageRepository/ImagePolicy belong to namespace apps

This is not currently supported, please comment on this RFC fluxcd/image-automation-controller#157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants