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

Flux v2.2.0 Provider v1beta3 API is not backwards compatible with v1beta2 #4471

Closed
1 task done
Tracked by #4473
n-asenov opened this issue Dec 12, 2023 · 4 comments · Fixed by fluxcd/notification-controller#683
Closed
1 task done
Tracked by #4473
Labels
area/notification Notification API related issues and pull requests

Comments

@n-asenov
Copy link

Describe the bug

Upgrading a Provider from v1beta2 to v1beta3 API fails if the Provider has an interval field set in its spec.

Steps to reproduce

Upgrade the following Provider from v1beta2 to v1beta3

---
apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Provider
metadata:
  name: alertmanager
  namespace: flux-system
spec:
  interval: 10m
  type: alertmanager
  address: http://kube-prometheus-stack-alertmanager.monitoring.svc.cluster.local:9093/api/v2/alerts/

The upgrade fails with

Provider/flux-system/alertmanager dry-run failed: failed to create typed patch object (flux-system/alertmanager; notification.toolkit.fluxcd.io/v1beta3, Kind=Provider): .spec.interval: field not declared in schema...

Expected behavior

Provider v1beta3 API should be backward compatible with v1beta2 and the upgrade should pass without errors.

Screenshots and recordings

No response

OS / Distro

N/A

Flux version

v2.2.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
@darkowlzz
Copy link
Contributor

darkowlzz commented Dec 12, 2023

Thanks for reporting this issue. Sorry for the inconvenience.
.spec.interval was an optional field in v1beta2 Provider unlike other flux API objects. It was unusual to set, hence missed in our upgrade testing. I tried reproducing it and this happens only when interval is explicitly set.

I've created fluxcd/notification-controller#683 to add interval back in v1beta3 Provider. We'll do a patch release which should fix this.

@darkowlzz darkowlzz added the area/notification Notification API related issues and pull requests label Dec 12, 2023
@fenio
Copy link

fenio commented Dec 13, 2023

When do you plan patch release?
Or what's workaround for it?

@hiddeco
Copy link
Member

hiddeco commented Dec 13, 2023

The work around for it is quite literally to remove the field from your Provider resources, as it is deprecated and will (even when added back) be no longer used.

@stefanprodan
Copy link
Member

stefanprodan commented Dec 13, 2023

When do you plan patch release?

Yes somewhere this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/notification Notification API related issues and pull requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants