From 994811c375225a06646e6e86103a191461dc57f7 Mon Sep 17 00:00:00 2001 From: Sarah Wang Date: Wed, 15 Jan 2025 15:43:03 -0500 Subject: [PATCH 1/2] testing edit to generate-openapi --- Makefile | 6 ++++-- api/datadoghq/v2alpha1/datadogagent_types.go | 1 - api/datadoghq/v2alpha1/zz_generated.openapi.go | 5 ----- config/crd/bases/v1/datadoghq.com_datadogagents.yaml | 2 -- .../crd/bases/v1/datadoghq.com_datadogagents_v2alpha1.json | 6 ++---- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 789a4d218..22d4c2b00 100644 --- a/Makefile +++ b/Makefile @@ -282,8 +282,10 @@ install-tools: bin/$(PLATFORM)/golangci-lint bin/$(PLATFORM)/operator-sdk bin/$( .PHONY: generate-openapi generate-openapi: bin/$(PLATFORM)/openapi-gen - bin/$(PLATFORM)/openapi-gen --logtostderr --output-dir api/datadoghq/v1alpha1 --output-file zz_generated.openapi.go --output-pkg api/datadoghq/v1alpha1 --go-header-file ./hack/boilerplate.go.txt ./api/datadoghq/v1alpha1 - bin/$(PLATFORM)/openapi-gen --logtostderr --output-dir api/datadoghq/v2alpha1 --output-file zz_generated.openapi.go --output-pkg api/datadoghq/v2alpha1 --go-header-file ./hack/boilerplate.go.txt ./api/datadoghq/v2alpha1 + @set -o pipefail; \ + bin/$(PLATFORM)/openapi-gen --logtostderr --output-dir api/datadoghq/v1alpha1 --output-file zz_generated.openapi.go --output-pkg api/datadoghq/v1alpha1 --go-header-file ./hack/boilerplate.go.txt ./api/datadoghq/v1alpha1 2>&1 | tee /dev/stderr | grep -q "warning" && { echo "Error: Warnings detected"; exit 1; } || true + @set -o pipefail; \ + bin/$(PLATFORM)/openapi-gen --logtostderr --output-dir api/datadoghq/v2alpha1 --output-file zz_generated.openapi.go --output-pkg api/datadoghq/v2alpha1 --go-header-file ./hack/boilerplate.go.txt ./api/datadoghq/v2alpha1 2>&1 | tee /dev/stderr | grep -q "warning" && { echo "Error: Warnings detected"; exit 1; } || true .PHONY: preflight-redhat-container preflight-redhat-container: bin/$(PLATFORM)/preflight diff --git a/api/datadoghq/v2alpha1/datadogagent_types.go b/api/datadoghq/v2alpha1/datadogagent_types.go index 857767b44..dc6dbdcd4 100644 --- a/api/datadoghq/v2alpha1/datadogagent_types.go +++ b/api/datadoghq/v2alpha1/datadogagent_types.go @@ -704,7 +704,6 @@ type OtelCollectorFeatureConfig struct { // If not, this will lead to a port conflict. // This limitation will be lifted once annotations support is removed. // +optional - // +listType=atomic Ports []*corev1.ContainerPort `json:"ports,omitempty"` // OTelCollector Config Relevant to the Core agent diff --git a/api/datadoghq/v2alpha1/zz_generated.openapi.go b/api/datadoghq/v2alpha1/zz_generated.openapi.go index 9dfdc495f..31c4159bf 100644 --- a/api/datadoghq/v2alpha1/zz_generated.openapi.go +++ b/api/datadoghq/v2alpha1/zz_generated.openapi.go @@ -1418,11 +1418,6 @@ func schema_datadog_operator_api_datadoghq_v2alpha1_OtelCollectorFeatureConfig(r }, }, "ports": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, SchemaProps: spec.SchemaProps{ Description: "Ports contains the ports for the otel-agent. Defaults: otel-grpc:4317 / otel-http:4318. Note: setting 4317 or 4318 manually is *only* supported if name match default names (otel-grpc, otel-http). If not, this will lead to a port conflict. This limitation will be lifted once annotations support is removed.", Type: []string{"array"}, diff --git a/config/crd/bases/v1/datadoghq.com_datadogagents.yaml b/config/crd/bases/v1/datadoghq.com_datadogagents.yaml index 679f7ce12..5610a55ab 100644 --- a/config/crd/bases/v1/datadoghq.com_datadogagents.yaml +++ b/config/crd/bases/v1/datadoghq.com_datadogagents.yaml @@ -1411,7 +1411,6 @@ spec: - containerPort type: object type: array - x-kubernetes-list-type: atomic type: object otlp: description: OTLP ingest configuration @@ -8275,7 +8274,6 @@ spec: - containerPort type: object type: array - x-kubernetes-list-type: atomic type: object otlp: description: OTLP ingest configuration diff --git a/config/crd/bases/v1/datadoghq.com_datadogagents_v2alpha1.json b/config/crd/bases/v1/datadoghq.com_datadogagents_v2alpha1.json index 02d401ef4..e99523e87 100644 --- a/config/crd/bases/v1/datadoghq.com_datadogagents_v2alpha1.json +++ b/config/crd/bases/v1/datadoghq.com_datadogagents_v2alpha1.json @@ -1457,8 +1457,7 @@ ], "type": "object" }, - "type": "array", - "x-kubernetes-list-type": "atomic" + "type": "array" } }, "type": "object" @@ -8263,8 +8262,7 @@ ], "type": "object" }, - "type": "array", - "x-kubernetes-list-type": "atomic" + "type": "array" } }, "type": "object" From 955b8f6d15a248aedc0c71e4d7c5fac15a912c4a Mon Sep 17 00:00:00 2001 From: Sarah Wang Date: Wed, 15 Jan 2025 16:18:21 -0500 Subject: [PATCH 2/2] oops --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 22d4c2b00..fb02645a1 100644 --- a/Makefile +++ b/Makefile @@ -283,9 +283,9 @@ install-tools: bin/$(PLATFORM)/golangci-lint bin/$(PLATFORM)/operator-sdk bin/$( .PHONY: generate-openapi generate-openapi: bin/$(PLATFORM)/openapi-gen @set -o pipefail; \ - bin/$(PLATFORM)/openapi-gen --logtostderr --output-dir api/datadoghq/v1alpha1 --output-file zz_generated.openapi.go --output-pkg api/datadoghq/v1alpha1 --go-header-file ./hack/boilerplate.go.txt ./api/datadoghq/v1alpha1 2>&1 | tee /dev/stderr | grep -q "warning" && { echo "Error: Warnings detected"; exit 1; } || true + bin/$(PLATFORM)/openapi-gen --logtostderr --output-dir api/datadoghq/v1alpha1 --output-file zz_generated.openapi.go --output-pkg api/datadoghq/v1alpha1 --go-header-file ./hack/boilerplate.go.txt ./api/datadoghq/v1alpha1 2>&1 | tee /dev/stderr | grep -q "violation" && { echo "Error: Warnings detected"; exit 1; } || true @set -o pipefail; \ - bin/$(PLATFORM)/openapi-gen --logtostderr --output-dir api/datadoghq/v2alpha1 --output-file zz_generated.openapi.go --output-pkg api/datadoghq/v2alpha1 --go-header-file ./hack/boilerplate.go.txt ./api/datadoghq/v2alpha1 2>&1 | tee /dev/stderr | grep -q "warning" && { echo "Error: Warnings detected"; exit 1; } || true + bin/$(PLATFORM)/openapi-gen --logtostderr --output-dir api/datadoghq/v2alpha1 --output-file zz_generated.openapi.go --output-pkg api/datadoghq/v2alpha1 --go-header-file ./hack/boilerplate.go.txt ./api/datadoghq/v2alpha1 2>&1 | tee /dev/stderr | grep -q "violation" && { echo "Error: Warnings detected"; exit 1; } || true .PHONY: preflight-redhat-container preflight-redhat-container: bin/$(PLATFORM)/preflight