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-reflector-controller segfault on bad semver range #171

Closed
1 task done
EricHorst opened this issue Sep 17, 2021 · 0 comments · Fixed by #172
Closed
1 task done

image-reflector-controller segfault on bad semver range #171

EricHorst opened this issue Sep 17, 2021 · 0 comments · Fixed by #172
Labels
bug Something isn't working

Comments

@EricHorst
Copy link

Describe the bug

When this ImagePolicy was deployed, the image-reflector-controller started crashlooping with the error that follows. Taking the second wildcard out of the range: value stopped the segfault crashloop.

apiVersion: image.toolkit.fluxcd.io/v1beta1
kind: ImagePolicy
metadata:
  name: our-policy
  namespace: default 
spec:
  imageRepositoryRef:
    name: favorite-repo
  policy:
    semver:
      range: "*-*"

Log output:

2021-09-17 13:54:43.239 PDTpanic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1657475] goroutine 334 [running]: github.com/fluxcd/image-reflector-controller/internal/policy.(*SemVer).Latest(0x0, 0xc000a5b8c0, 0x6, 0x6, 0x6, 0x6, 0x0, 0x0) /workspace/internal/policy/semver.go:55 +0x135 github.com/fluxcd/image-reflector-controller/controllers.(*ImagePolicyReconciler).Reconcile(0xc000458cd0, 0x1c00e18, 0xc001143c50, 0xc000a86c40, 0x7, 0xc0009aad80, 0x13, 0xc001143c00, 0x0, 0x0, ...) /workspace/controllers/imagepolicy_controller.go:146 +0x125a sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000a237c0, 0x1c00d70, 0xc00092e380, 0x182d140, 0xc000aaefc0) /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.5/pkg/internal/controller/controller.go:298 +0x30d sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000a237c0, 0x1c00d70, 0xc00092e380, 0x442700) /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.5/pkg/internal/controller/controller.go:253 +0x205 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2(0xc000c51420, 0xc000a237c0, 0x1c00d70, 0xc00092e380) /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.5/pkg/internal/controller/controller.go:214 +0x6b created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.5/pkg/internal/controller/controller.go:210 +0x425

Steps to reproduce

  1. deploy an ImagePolicy with semver range "-"
  2. image-reflector-controller crashes

Expected behavior

No crash.

Screenshots and recordings

No response

OS / Distro

GKE 1.20

Flux version

0.17.0

Flux check

N/A

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@stefanprodan stefanprodan transferred this issue from fluxcd/flux2 Sep 18, 2021
@stefanprodan stefanprodan added the bug Something isn't working label Sep 18, 2021
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