# Legacy cluster sources — Flux 2.2.x API versions
#
# In Flux 2.3.0, five CRDs were promoted to stable:
#   OCIRepository, Bucket, HelmRepository, HelmChart, HelmRelease (v1beta2→v1, v2beta2→v2)
# On this cluster those CRDs only serve the pre-graduation beta versions.
# GitRepository and Kustomization were already at v1 since Flux 2.0 and are unchanged.
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: flux-system
  namespace: flux-resources
  labels: {app.kubernetes.io/managed-by: flux9s-dev}
spec:
  interval: 5m
  url: https://github.com/fluxcd/flux2-kustomize-helm-example
  ref:
    branch: main
---
# v1beta2 — HelmRepository was also at this version in Flux 2.2.x.
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: podinfo
  namespace: flux-resources
  labels: {app.kubernetes.io/managed-by: flux9s-dev}
spec:
  interval: 1h
  url: https://stefanprodan.github.io/podinfo
---
# v1beta2 — OCIRepository was at this version in Flux 2.2.x.
# flux9s should try v1 first (404), then fall back to v1beta2 and find this.
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
  name: podinfo-oci
  namespace: flux-resources
  labels: {app.kubernetes.io/managed-by: flux9s-dev}
spec:
  interval: 5m
  url: oci://ghcr.io/stefanprodan/charts/podinfo
  ref:
    semver: ">=6.0.0"
---
# v1beta2 — Bucket was also at this version in Flux 2.2.x.
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: Bucket
metadata:
  name: terraform-state
  namespace: flux-resources
  labels: {app.kubernetes.io/managed-by: flux9s-dev}
spec:
  interval: 5m
  provider: generic
  bucketName: tf-state
  endpoint: minio.flux-system.svc.cluster.local
  secretRef:
    name: minio-credentials
