Skip to content

Commit

Permalink
operator: patch back in the checksum field into the flux crds
Browse files Browse the repository at this point in the history
  • Loading branch information
joejulian committed Oct 18, 2023
1 parent 0860203 commit 836c4ff
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 5 deletions.
28 changes: 23 additions & 5 deletions src/go/k8s/config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,47 @@
# This kustomization.yaml is not intended to be run by itself,
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

#+kubebuilder:scaffold:crdkustomizeresource
resources:
- bases/redpanda.vectorized.io_clusters.yaml
- bases/redpanda.vectorized.io_consoles.yaml
- bases/cluster.redpanda.com_redpandas.yaml
- bases/cluster.redpanda.com_topics.yaml
#+kubebuilder:scaffold:crdkustomizeresource
- bases/toolkit.fluxcd.io/helm-controller.yaml
- bases/toolkit.fluxcd.io/source-controller.yaml

patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
- path: patches/webhook_in_clusters.yaml
- path: patches/webhook_in_redpanda_consoles.yaml
- path: patches/webhook_in_cluster.redpanda.com_topics.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch

# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
patches:
- path: patches/webhook_in_clusters.yaml
- path: patches/webhook_in_redpanda_consoles.yaml
- path: patches/webhook_in_cluster.redpanda.com_topics.yaml
- path: patches/cainjection_in_clusters.yaml
- path: patches/cainjection_in_redpanda_consoles.yaml
- path: patches/cainjection_in_cluster.redpanda.com_topics.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
- path: patches/re-add-checksum-field_in_source.toolkit.fluxcd.io.yaml
target:
kind: CustomResourceDefinition
name: "^(buckets|helmcharts|helmrepositories).source.toolkit.fluxcd.io$"
- path: patches/re-add-checksum-field_in_gitrepositories.source.toolkit.fluxcd.io.yaml
target:
kind: CustomResourceDefinition
name: gitrepositories.source.toolkit.fluxcd.io
- path: patches/re-add-checksum-field_in_ocirepositories.source.toolkit.fluxcd.io.yaml
target:
kind: CustomResourceDefinition
name: ocirepositories.source.toolkit.fluxcd.io


# patches CRD to re-add removed fields from beta CRDs

# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
# The following patch adds the spec.versions.v1beta2.schema.openAPIV3Schema.properties.status.properties.artifact.properties.checksum property
# and the spec.versions.v1beta2.schema.openAPIV3Schema.properties.status.properties.includedArtifacts.items.properties.checksum property
# that was removed
- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/status/properties/artifact/properties/checksum
value:
type: string
description: Checksum is the SHA256 checksum of the Artifact file (obsolete)
- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/status/properties/includedArtifacts/items/properties/checksum
value:
type: string
description: Checksum is the SHA256 checksum of the Artifact file (obsolete)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# The following patch adds the spec.versions.v1beta2.schema.openAPIV3Schema.properties.status.properties.artifact.properties.checksum property that was removed
# apiVersion: apiextensions.k8s.io/v1
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/status/properties/artifact/properties/checksum
value:
type: string
description: Checksum is the SHA256 checksum of the Artifact file (obsolete)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# The following patch adds the spec.versions.v1beta2.schema.openAPIV3Schema.properties.status.properties.artifact.properties.checksum property that was removed
# apiVersion: apiextensions.k8s.io/v1
- op: replace
path: /spec/versions/1/schema/openAPIV3Schema/properties/status/properties/artifact/properties/checksum
value:
type: string
description: Checksum is the SHA256 checksum of the Artifact file (obsolete)
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/status/properties/artifact/properties/checksum
value:
type: string
description: Checksum is the SHA256 checksum of the Artifact file (obsolete)

0 comments on commit 836c4ff

Please sign in to comment.