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

fix(docs): update CRD patch for latest Flux CRD versions #1392

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/use-tf-controller/flux-receiver-and-alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,34 @@ resources:
- gotk-sync.yaml
patches:
- patch: |
# v1beta1
- op: add
path: /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/eventSources/items/properties/kind/enum/-
value: Terraform
# v1beta2
- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/eventSources/items/properties/kind/enum/-
value: Terraform
# v1beta3
- op: add
path: /spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/eventSources/items/properties/kind/enum/-
value: Terraform
target:
kind: CustomResourceDefinition
name: alerts.notification.toolkit.fluxcd.io
- patch: |
# v1
- op: add
path: /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/resources/items/properties/kind/enum/-
value: Terraform
# v1beta1
- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/resources/items/properties/kind/enum/-
value: Terraform
# v1beta2
- op: add
path: /spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/resources/items/properties/kind/enum/-
value: Terraform
target:
kind: CustomResourceDefinition
name: receivers.notification.toolkit.fluxcd.io
Expand All @@ -50,3 +62,11 @@ patches:
kind: ClusterRole
name: crd-controller-flux-system
```

Each version of the Flux `Alert` and `Receiver` CRDs must be patched, so the JSON6902 patch statement should be repeated with a different `versions` index.

The list of CRD versions on the cluster can be queried with Kubectl.
For example, to use `jq` to get the count of versions for the `Alert` CRD:
```sh
kubectl get -ojson crd alerts.notification.toolkit.fluxcd.io | jq '.spec.versions | length'
```
Loading