1
0
mirror of https://github.com/coreos/prometheus-operator.git synced 2026-02-05 06:45:27 +01:00

fix: include operator.prometheus.io/version in full CRDs

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
Simon Pasquier
2026-01-13 16:55:33 +01:00
parent 4cadbf7736
commit 4e54eab340
12 changed files with 13 additions and 3 deletions

View File

@@ -235,9 +235,9 @@ generate: k8s-gen generate-crds bundle.yaml example/mixin/alerts.yaml example/th
.PHONY: generate-crds
generate-crds: $(CONTROLLER_GEN_BINARY) $(GOJSONTOYAML_BINARY) $(TYPES_V1_TARGET) $(TYPES_V1ALPHA1_TARGET) $(TYPES_V1BETA1_TARGET)
cd pkg/apis/monitoring && $(CONTROLLER_GEN_BINARY) $(CRD_OPTIONS) paths=./v1/. paths=./v1alpha1/. output:crd:dir=$(PWD)/example/prometheus-operator-crd/
cd pkg/apis/monitoring && $(CONTROLLER_GEN_BINARY) $(CRD_OPTIONS) paths=./... output:crd:dir=$(PWD)/example/prometheus-operator-crd-full
VERSION=$(VERSION) ./scripts/generate/append-operator-version.sh
find example/prometheus-operator-crd/ -name '*.yaml' -print0 | xargs -0 -I{} sh -c '$(GOJSONTOYAML_BINARY) -yamltojson < "$$1" | jq > "$(PWD)/jsonnet/prometheus-operator/$$(basename $$1 | cut -d'_' -f2 | cut -d. -f1)-crd.json"' -- {}
cd pkg/apis/monitoring && $(CONTROLLER_GEN_BINARY) $(CRD_OPTIONS) paths=./... output:crd:dir=$(PWD)/example/prometheus-operator-crd-full
echo "// Code generated using 'make generate-crds'. DO NOT EDIT." > $(PWD)/jsonnet/prometheus-operator/alertmanagerconfigs-v1beta1-crd.libsonnet
echo "{spec+: {versions+: $$($(GOJSONTOYAML_BINARY) -yamltojson < example/prometheus-operator-crd-full/monitoring.coreos.com_alertmanagerconfigs.yaml | jq '.spec.versions | map(select(.name == "v1beta1"))')}}" | $(JSONNETFMT_BINARY) - >> $(PWD)/jsonnet/prometheus-operator/alertmanagerconfigs-v1beta1-crd.libsonnet

View File

@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
operator.prometheus.io/version: 0.88.1
name: alertmanagerconfigs.monitoring.coreos.com
spec:
group: monitoring.coreos.com

View File

@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
operator.prometheus.io/version: 0.88.1
name: alertmanagers.monitoring.coreos.com
spec:
group: monitoring.coreos.com

View File

@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
operator.prometheus.io/version: 0.88.1
name: podmonitors.monitoring.coreos.com
spec:
group: monitoring.coreos.com

View File

@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
operator.prometheus.io/version: 0.88.1
name: probes.monitoring.coreos.com
spec:
group: monitoring.coreos.com

View File

@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
operator.prometheus.io/version: 0.88.1
name: prometheusagents.monitoring.coreos.com
spec:
group: monitoring.coreos.com

View File

@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
operator.prometheus.io/version: 0.88.1
name: prometheuses.monitoring.coreos.com
spec:
group: monitoring.coreos.com

View File

@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
operator.prometheus.io/version: 0.88.1
name: prometheusrules.monitoring.coreos.com
spec:
group: monitoring.coreos.com

View File

@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
operator.prometheus.io/version: 0.88.1
name: scrapeconfigs.monitoring.coreos.com
spec:
group: monitoring.coreos.com

View File

@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
operator.prometheus.io/version: 0.88.1
name: servicemonitors.monitoring.coreos.com
spec:
group: monitoring.coreos.com

View File

@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
operator.prometheus.io/version: 0.88.1
name: thanosrulers.monitoring.coreos.com
spec:
group: monitoring.coreos.com

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env bash
if [[ "$OSTYPE" == "darwin"* ]]; then
find example/prometheus-operator-crd/ -name '*.yaml' -exec sed -i '' -e "/^ controller-gen.kubebuilder.io.version.*/a\\
find example/prometheus-operator-crd/ example/prometheus-operator-crd-full/ -name '*.yaml' -exec sed -i '' -e "/^ controller-gen.kubebuilder.io.version.*/a\\
operator.prometheus.io/version: $VERSION" {} +
else
find example/prometheus-operator-crd/ -name '*.yaml' -exec sed -i "/^ controller-gen.kubebuilder.io.version.*/a\\ operator.prometheus.io/version: $VERSION" {} +
find example/prometheus-operator-crd/ example/prometheus-operator-crd-full/ -name '*.yaml' -exec sed -i "/^ controller-gen.kubebuilder.io.version.*/a\\ operator.prometheus.io/version: $VERSION" {} +
fi