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

HelmRelease valuesFrom broken for dotted annotations #542

Closed
1 task done
as42sl opened this issue Oct 12, 2022 · 8 comments
Closed
1 task done

HelmRelease valuesFrom broken for dotted annotations #542

as42sl opened this issue Oct 12, 2022 · 8 comments

Comments

@as42sl
Copy link

as42sl commented Oct 12, 2022

Describe the bug

I just upgraded to the latest release and found out that it is not possible anymore to set dotted annotations with valuesFrom.

Example:

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
....
  valuesFrom:
    - kind: Secret
      name: my-secret
      valuesKey: my-value
      targetPath: ingress.annotations.alb\.ingress\.kubernetes\.io/some-key

This used to work perfectly. With the latest version it says:

spec.valuesFrom.targetPath: Invalid value: "ingress.annotations.alb\\.ingress\\.kubernetes\\.io/some-key": spec.valuesFrom.targetPath in body should match '^([a-zA-Z0-9_\-.\/]|\[[0-9]{1,5}\])+$'

Steps to reproduce

Try valuesFrom with a annotation containing dots.

apiVersion: helm.toolkit.fluxcd.io/v2beta1 kind: HelmRelease .... valuesFrom: - kind: Secret name: my-secret valuesKey: my-value targetPath: ingress.annotations.alb\.ingress\.kubernetes\.io/some-key

Expected behavior

it should set the value for the annotation

Screenshots and recordings

No response

OS / Distro

N/A

Flux version

flux: v0.35.0

Flux check

✔ Kubernetes 1.23.10-eks-15b7512 >=1.20.6-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.25.0
✔ image-automation-controller: deployment ready
► ghcr.io/fluxcd/image-automation-controller:v0.26.0
✔ image-reflector-controller: deployment ready
► ghcr.io/fluxcd/image-reflector-controller:v0.22.0
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v0.29.0
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v0.27.0
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v0.30.0
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta1
✔ buckets.source.toolkit.fluxcd.io/v1beta2
✔ gitrepositories.source.toolkit.fluxcd.io/v1beta2
✔ helmcharts.source.toolkit.fluxcd.io/v1beta2
✔ helmreleases.helm.toolkit.fluxcd.io/v2beta1
✔ helmrepositories.source.toolkit.fluxcd.io/v1beta2
✔ imagepolicies.image.toolkit.fluxcd.io/v1beta1
✔ imagerepositories.image.toolkit.fluxcd.io/v1beta1
✔ imageupdateautomations.image.toolkit.fluxcd.io/v1beta1
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1beta2
✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
✔ providers.notification.toolkit.fluxcd.io/v1beta1
✔ receivers.notification.toolkit.fluxcd.io/v1beta1
✔ all checks passed

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
@hiddeco hiddeco transferred this issue from fluxcd/flux2 Oct 12, 2022
@hiddeco
Copy link
Member

hiddeco commented Oct 12, 2022

This seems to be related to #520, although the regex introduced there allows both . and \.

My gut feeling tells me it has something to do with the captured group (https://regex101.com/r/alhLe9/1) which makes the validator trip.

@as42sl as42sl closed this as completed Oct 12, 2022
@hiddeco
Copy link
Member

hiddeco commented Oct 12, 2022

Given the issue was just closed I guess this was a user input error, as the example works fine for me:

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: podinfo-helmrepository
spec:
  interval: 5m
  valuesFrom:
    - kind: Secret
      name: my-secret
      valuesKey: my-value
      targetPath: ingress.annotations.alb\.ingress\.kubernetes\.io/some-key
...
$ kubectl apply -f test.yaml
helmrelease.helm.toolkit.fluxcd.io/podinfo-helmrepository created

@as42sl
Copy link
Author

as42sl commented Oct 12, 2022

Hi, the problem still occurs. I only closed this one because i thought it is the flux1 repo.

@hiddeco
Copy link
Member

hiddeco commented Oct 12, 2022

Can you please post an exact copy of your .spec.valuesFrom?

@hiddeco hiddeco reopened this Oct 12, 2022
@as42sl
Copy link
Author

as42sl commented Oct 12, 2022

it is happening with any dotted annotation...

    - kind: Secret
      name: my-secret
      valuesKey: some-key
      targetPath: test.aaa\.bbb

@hiddeco
Copy link
Member

hiddeco commented Oct 12, 2022

The validation rule in the chart is indeed incorrect and missing escapes, please open an issue there.

@hiddeco hiddeco closed this as completed Oct 12, 2022
@as42sl
Copy link
Author

as42sl commented Oct 12, 2022

ok thank you!

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