From 4ee8f27740a716372ef9ca7a8e45fd60d18ddfb4 Mon Sep 17 00:00:00 2001 From: Ismail Alidzhikov <9372594+ialidzhikov@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:01:25 +0200 Subject: [PATCH] Add the `api-approved.kubernetes.io` annotation via kubebuilder tag --- vertical-pod-autoscaler/hack/generate-crd-yaml.sh | 11 ++--------- .../pkg/apis/autoscaling.k8s.io/v1/types.go | 2 ++ .../pkg/apis/autoscaling.k8s.io/v1beta2/types.go | 2 ++ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/vertical-pod-autoscaler/hack/generate-crd-yaml.sh b/vertical-pod-autoscaler/hack/generate-crd-yaml.sh index 8b28bb39342b..106542473116 100755 --- a/vertical-pod-autoscaler/hack/generate-crd-yaml.sh +++ b/vertical-pod-autoscaler/hack/generate-crd-yaml.sh @@ -45,12 +45,5 @@ grep -v -e 'map keys must be strings, not int' -e 'not all generators ran succes && { echo "Failed to generate CRD YAMLs."; exit 1; } cd ${WORKSPACE} -cat < kustomization.yaml -resources: -- autoscaling.k8s.io_verticalpodautoscalers.yaml -- autoscaling.k8s.io_verticalpodautoscalercheckpoints.yaml -commonAnnotations: - "api-approved.kubernetes.io": "https://github.com/kubernetes/kubernetes/pull/63797" -EOF -echo --- > ${OUTPUT} -kubectl kustomize . >> ${OUTPUT} +cat "${WORKSPACE}/autoscaling.k8s.io_verticalpodautoscalercheckpoints.yaml" > ${OUTPUT} +cat "${WORKSPACE}/autoscaling.k8s.io_verticalpodautoscalers.yaml" >> ${OUTPUT} diff --git a/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go b/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go index c1a686371e68..5ede0fe4810a 100644 --- a/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go +++ b/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go @@ -46,6 +46,7 @@ type VerticalPodAutoscalerList struct { // +kubebuilder:printcolumn:name="Mem",type="string",JSONPath=".status.recommendation.containerRecommendations[0].target.memory" // +kubebuilder:printcolumn:name="Provided",type="string",JSONPath=".status.conditions[?(@.type=='RecommendationProvided')].status" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes/kubernetes/pull/63797" // VerticalPodAutoscaler is the configuration for a vertical pod // autoscaler, which automatically manages pod resources based on historical and @@ -347,6 +348,7 @@ type VerticalPodAutoscalerCondition struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:storageversion // +kubebuilder:resource:shortName=vpacheckpoint +// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes/kubernetes/pull/63797" // VerticalPodAutoscalerCheckpoint is the checkpoint of the internal state of VPA that // is used for recovery after recommender's restart. diff --git a/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2/types.go b/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2/types.go index d2fca95a6dfc..fa21da2337cb 100644 --- a/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2/types.go +++ b/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2/types.go @@ -41,6 +41,7 @@ type VerticalPodAutoscalerList struct { // +kubebuilder:resource:shortName=vpa // +kubebuilder:subresource:status // +k8s:prerelease-lifecycle-gen=true +// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes/kubernetes/pull/63797" // VerticalPodAutoscaler is the configuration for a vertical pod // autoscaler, which automatically manages pod resources based on historical and @@ -273,6 +274,7 @@ type VerticalPodAutoscalerCondition struct { // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:shortName=vpacheckpoint +// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes/kubernetes/pull/63797" // VerticalPodAutoscalerCheckpoint is the checkpoint of the internal state of VPA that // is used for recovery after recommender's restart.