From 0fdb6f281a0fc713aff142d8664a248ac3baab88 Mon Sep 17 00:00:00 2001 From: Yang Le Date: Fri, 27 Oct 2023 10:44:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20add=20ca=20bundle=20to=20addon?= =?UTF-8?q?=20proxy=20settings=20(#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yang Le --- ...n-cluster-management.io_addondeploymentconfigs.crd.yaml | 6 ++++++ addon/v1alpha1/types_addondeploymentconfig.go | 5 +++++ addon/v1alpha1/zz_generated.deepcopy.go | 7 ++++++- addon/v1alpha1/zz_generated.swagger_doc_generated.go | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml b/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml index 69709fbd5..c60840150 100644 --- a/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml +++ b/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml @@ -129,6 +129,12 @@ spec: description: ProxyConfig holds proxy settings for add-on agent on the managed cluster. Empty means no proxy settings is available. properties: + caBundle: + description: CABundle is a CA certificate bundle to verify the + proxy server. And it's only useful when HTTPSProxy is set and + a HTTPS proxy server is specified. + format: byte + type: string httpProxy: description: HTTPProxy is the URL of the proxy for HTTP requests type: string diff --git a/addon/v1alpha1/types_addondeploymentconfig.go b/addon/v1alpha1/types_addondeploymentconfig.go index b72ac3a4c..472fbeb1e 100644 --- a/addon/v1alpha1/types_addondeploymentconfig.go +++ b/addon/v1alpha1/types_addondeploymentconfig.go @@ -111,6 +111,11 @@ type ProxyConfig struct { // +optional HTTPSProxy string `json:"httpsProxy,omitempty"` + // CABundle is a CA certificate bundle to verify the proxy server. + // And it's only useful when HTTPSProxy is set and a HTTPS proxy server is specified. + // +optional + CABundle []byte `json:"caBundle,omitempty"` + // NoProxy is a comma-separated list of hostnames and/or CIDRs and/or IPs for which the proxy // should not be used. // +optional diff --git a/addon/v1alpha1/zz_generated.deepcopy.go b/addon/v1alpha1/zz_generated.deepcopy.go index f4e7e2ede..c0f0917e5 100644 --- a/addon/v1alpha1/zz_generated.deepcopy.go +++ b/addon/v1alpha1/zz_generated.deepcopy.go @@ -107,7 +107,7 @@ func (in *AddOnDeploymentConfigSpec) DeepCopyInto(out *AddOnDeploymentConfigSpec *out = make([]ImageMirror, len(*in)) copy(*out, *in) } - out.ProxyConfig = in.ProxyConfig + in.ProxyConfig.DeepCopyInto(&out.ProxyConfig) return } @@ -916,6 +916,11 @@ func (in *PlacementStrategy) DeepCopy() *PlacementStrategy { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProxyConfig) DeepCopyInto(out *ProxyConfig) { *out = *in + if in.CABundle != nil { + in, out := &in.CABundle, &out.CABundle + *out = make([]byte, len(*in)) + copy(*out, *in) + } return } diff --git a/addon/v1alpha1/zz_generated.swagger_doc_generated.go b/addon/v1alpha1/zz_generated.swagger_doc_generated.go index 148e1b36c..95953b253 100644 --- a/addon/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/addon/v1alpha1/zz_generated.swagger_doc_generated.go @@ -76,6 +76,7 @@ var map_ProxyConfig = map[string]string{ "": "ProxyConfig describes the proxy settings for the add-on agent", "httpProxy": "HTTPProxy is the URL of the proxy for HTTP requests", "httpsProxy": "HTTPSProxy is the URL of the proxy for HTTPS requests", + "caBundle": "CABundle is a CA certificate bundle to verify the proxy server. And it's only useful when HTTPSProxy is set and a HTTPS proxy server is specified.", "noProxy": "NoProxy is a comma-separated list of hostnames and/or CIDRs and/or IPs for which the proxy should not be used.", }