From 26445b835b8bfd41f3dd2cc28c0d9553cb0d6020 Mon Sep 17 00:00:00 2001 From: zirain Date: Thu, 1 Feb 2024 13:36:48 +0800 Subject: [PATCH] api: support release channel Signed-off-by: zirain --- api/v1alpha1/securitypolicy_types.go | 1 + .../gateway.envoyproxy.io_securitypolicies.yaml | 1 + site/content/en/latest/api/extension_types.md | 2 +- tools/crd-ref-docs/templates/type.tpl | 9 +++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/securitypolicy_types.go b/api/v1alpha1/securitypolicy_types.go index 6d90536ae91..553b3a58cd1 100644 --- a/api/v1alpha1/securitypolicy_types.go +++ b/api/v1alpha1/securitypolicy_types.go @@ -20,6 +20,7 @@ const ( // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].reason` // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:metadata:annotations="gateway.envoyproxy.io/release-channel=experimental" // SecurityPolicy allows the user to configure various security settings for a // Gateway. diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml index dbf4e5941ed..ba1cf4bcf93 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml @@ -4,6 +4,7 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.13.0 + gateway.envoyproxy.io/release-channel: experimental name: securitypolicies.gateway.envoyproxy.io spec: group: gateway.envoyproxy.io diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 3a22e60b185..725138ad10b 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -2041,7 +2041,7 @@ _Appears in:_ #### SecurityPolicy - +_Release Channel:_ experimental SecurityPolicy allows the user to configure various security settings for a Gateway. diff --git a/tools/crd-ref-docs/templates/type.tpl b/tools/crd-ref-docs/templates/type.tpl index 581cd8fcd9a..48b8c5db1bc 100644 --- a/tools/crd-ref-docs/templates/type.tpl +++ b/tools/crd-ref-docs/templates/type.tpl @@ -4,6 +4,15 @@ #### {{ $type.Name }} +{{ $metaList := index .Markers "kubebuilder:metadata" }} +{{- range $meta := $metaList -}} +{{- range $anno := $meta.Annotations -}} +{{- if hasPrefix "gateway.envoyproxy.io/release-channel" $anno -}} +_Release Channel:_ {{ trimPrefix "gateway.envoyproxy.io/release-channel=" $anno }} +{{- end -}} +{{- end -}} +{{- end -}} + {{ if $type.IsAlias }}_Underlying type:_ _{{ markdownRenderTypeLink $type.UnderlyingType }}_{{ end }} {{ $type.Doc }}