From 72dbb1f67b51bcbabc1edc18b0f074e123b99a8c Mon Sep 17 00:00:00 2001 From: "xiaobing.meng" Date: Fri, 10 Sep 2021 10:33:25 +0800 Subject: [PATCH 1/5] imageresitry support Alibabacloud oss --- imageregistry/v1/00-crd.yaml | 44 +++++++++++++++++++ imageregistry/v1/types.go | 33 ++++++++++++++ imageregistry/v1/zz_generated.deepcopy.go | 21 +++++++++ .../v1/zz_generated.swagger_doc_generated.go | 15 +++++++ 4 files changed, 113 insertions(+) diff --git a/imageregistry/v1/00-crd.yaml b/imageregistry/v1/00-crd.yaml index 901cc09a37c..7c88bb3af9c 100644 --- a/imageregistry/v1/00-crd.yaml +++ b/imageregistry/v1/00-crd.yaml @@ -708,6 +708,28 @@ spec: description: managementState indicates if the operator manages the underlying storage unit. If Managed the operator will remove the storage when this operator gets Removed. type: string pattern: ^(Managed|Unmanaged)$ + oss: + description: OSS represents configuration that uses Alibaba Cloud Object Storage. + type: object + properties: + bucket: + description: bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. + type: string + encrypt: + description: encrypt specifies whether the registry stores the image in encrypted format or not. Optional, defaults to false. + type: boolean + internal: + description: internal specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored + type: boolean + keyID: + description: keyID is the KMS key ID to use for encryption. Optional, Encrypt must be true, or this parameter is ignored. + type: string + region: + description: region is the GCS location in which your bucket exists. Optional, will be set based on the installed GCS Region. + type: string + regionEndpoint: + description: regionEndpoint is the endpoint for S3 compatible storage services. Optional, defaults based on the Region that is provided. + type: string pvc: description: pvc represents configuration that uses a PersistentVolumeClaim. type: object @@ -949,6 +971,28 @@ spec: description: managementState indicates if the operator manages the underlying storage unit. If Managed the operator will remove the storage when this operator gets Removed. type: string pattern: ^(Managed|Unmanaged)$ + oss: + description: OSS represents configuration that uses Alibaba Cloud Object Storage. + type: object + properties: + bucket: + description: bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. + type: string + encrypt: + description: encrypt specifies whether the registry stores the image in encrypted format or not. Optional, defaults to false. + type: boolean + internal: + description: internal specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored + type: boolean + keyID: + description: keyID is the KMS key ID to use for encryption. Optional, Encrypt must be true, or this parameter is ignored. + type: string + region: + description: region is the GCS location in which your bucket exists. Optional, will be set based on the installed GCS Region. + type: string + regionEndpoint: + description: regionEndpoint is the endpoint for S3 compatible storage services. Optional, defaults based on the Region that is provided. + type: string pvc: description: pvc represents configuration that uses a PersistentVolumeClaim. type: object diff --git a/imageregistry/v1/types.go b/imageregistry/v1/types.go index 7723074c6ec..20d546f3423 100644 --- a/imageregistry/v1/types.go +++ b/imageregistry/v1/types.go @@ -306,6 +306,36 @@ type ImageRegistryConfigStorageIBMCOS struct { ServiceInstanceCRN string `json:"serviceInstanceCRN,omitempty"` } +// ImageRegistryConfigStorageOSS holds Alibaba Cloud OSS configuration. +type ImageRegistryConfigStorageOSS struct { + // bucket is the bucket name in which you want to store the registry's + // data. + // Optional, will be generated if not provided. + // +optional + Bucket string `json:"bucket,omitempty"` + // region is the GCS location in which your bucket exists. + // Optional, will be set based on the installed GCS Region. + // +optional + Region string `json:"region,omitempty"` + // regionEndpoint is the endpoint for S3 compatible storage services. + // Optional, defaults based on the Region that is provided. + // +optional + RegionEndpoint string `json:"regionEndpoint,omitempty"` + // internal specifies whether the registry use the OSS VPC internal endpoint + // Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored + // +optional + Internal bool `json:"internal,omitempty"` + // encrypt specifies whether the registry stores the image in encrypted + // format or not. + // Optional, defaults to false. + // +optional + Encrypt bool `json:"encrypt,omitempty"` + // keyID is the KMS key ID to use for encryption. + // Optional, Encrypt must be true, or this parameter is ignored. + // +optional + KeyID string `json:"keyID,omitempty"` +} + // ImageRegistryConfigStorage describes how the storage should be configured // for the image registry. type ImageRegistryConfigStorage struct { @@ -333,6 +363,9 @@ type ImageRegistryConfigStorage struct { // ibmcos represents configuration that uses IBM Cloud Object Storage. // +optional IBMCOS *ImageRegistryConfigStorageIBMCOS `json:"ibmcos,omitempty"` + // OSS represents configuration that uses Alibaba Cloud Object Storage. + // +optional + OSS *ImageRegistryConfigStorageOSS `json:"oss,omitempty"` // managementState indicates if the operator manages the underlying // storage unit. If Managed the operator will remove the storage when // this operator gets Removed. diff --git a/imageregistry/v1/zz_generated.deepcopy.go b/imageregistry/v1/zz_generated.deepcopy.go index 59b795ad9ec..f8b1b441ee8 100644 --- a/imageregistry/v1/zz_generated.deepcopy.go +++ b/imageregistry/v1/zz_generated.deepcopy.go @@ -333,6 +333,11 @@ func (in *ImageRegistryConfigStorage) DeepCopyInto(out *ImageRegistryConfigStora *out = new(ImageRegistryConfigStorageIBMCOS) **out = **in } + if in.OSS != nil { + in, out := &in.OSS, &out.OSS + *out = new(ImageRegistryConfigStorageOSS) + **out = **in + } return } @@ -410,6 +415,22 @@ func (in *ImageRegistryConfigStorageIBMCOS) DeepCopy() *ImageRegistryConfigStora return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageRegistryConfigStorageOSS) DeepCopyInto(out *ImageRegistryConfigStorageOSS) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageRegistryConfigStorageOSS. +func (in *ImageRegistryConfigStorageOSS) DeepCopy() *ImageRegistryConfigStorageOSS { + if in == nil { + return nil + } + out := new(ImageRegistryConfigStorageOSS) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ImageRegistryConfigStoragePVC) DeepCopyInto(out *ImageRegistryConfigStoragePVC) { *out = *in diff --git a/imageregistry/v1/zz_generated.swagger_doc_generated.go b/imageregistry/v1/zz_generated.swagger_doc_generated.go index 42a7ff81151..d4a6f7e1388 100644 --- a/imageregistry/v1/zz_generated.swagger_doc_generated.go +++ b/imageregistry/v1/zz_generated.swagger_doc_generated.go @@ -79,6 +79,7 @@ var map_ImageRegistryConfigStorage = map[string]string{ "pvc": "pvc represents configuration that uses a PersistentVolumeClaim.", "azure": "azure represents configuration that uses Azure Blob Storage.", "ibmcos": "ibmcos represents configuration that uses IBM Cloud Object Storage.", + "oss": "OSS represents configuration that uses Alibaba Cloud Object Storage.", "managementState": "managementState indicates if the operator manages the underlying storage unit. If Managed the operator will remove the storage when this operator gets Removed.", } @@ -130,6 +131,20 @@ func (ImageRegistryConfigStorageIBMCOS) SwaggerDoc() map[string]string { return map_ImageRegistryConfigStorageIBMCOS } +var map_ImageRegistryConfigStorageOSS = map[string]string{ + "": "ImageRegistryConfigStorageOSS holds Alibaba Cloud OSS configuration.", + "bucket": "bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided.", + "region": "region is the GCS location in which your bucket exists. Optional, will be set based on the installed GCS Region.", + "regionEndpoint": "regionEndpoint is the endpoint for S3 compatible storage services. Optional, defaults based on the Region that is provided.", + "internal": "internal specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored", + "encrypt": "encrypt specifies whether the registry stores the image in encrypted format or not. Optional, defaults to false.", + "keyID": "keyID is the KMS key ID to use for encryption. Optional, Encrypt must be true, or this parameter is ignored.", +} + +func (ImageRegistryConfigStorageOSS) SwaggerDoc() map[string]string { + return map_ImageRegistryConfigStorageOSS +} + var map_ImageRegistryConfigStoragePVC = map[string]string{ "": "ImageRegistryConfigStoragePVC holds Persistent Volume Claims data to be used by the registry.", "claim": "claim defines the Persisent Volume Claim's name to be used.", From 2ad6000b8a80e019b58a3bc1fbb48aaf6d70bab1 Mon Sep 17 00:00:00 2001 From: "xiaobing.meng" Date: Thu, 16 Sep 2021 10:44:13 +0800 Subject: [PATCH 2/5] fix comments and add offical documentations link --- imageregistry/v1/00-crd.yaml | 26 +++++++------------ imageregistry/v1/types.go | 22 +++++++++------- .../v1/zz_generated.swagger_doc_generated.go | 13 +++++----- 3 files changed, 28 insertions(+), 33 deletions(-) diff --git a/imageregistry/v1/00-crd.yaml b/imageregistry/v1/00-crd.yaml index 7c88bb3af9c..29cd581a136 100644 --- a/imageregistry/v1/00-crd.yaml +++ b/imageregistry/v1/00-crd.yaml @@ -709,26 +709,23 @@ spec: type: string pattern: ^(Managed|Unmanaged)$ oss: - description: OSS represents configuration that uses Alibaba Cloud Object Storage. + description: OSS represents configuration that uses Alibaba Cloud Object Storage Service. type: object properties: bucket: - description: bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. + description: bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. About Bucket naming, more details you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/257087.htm) type: string encrypt: - description: encrypt specifies whether the registry stores the image in encrypted format or not. Optional, defaults to false. + description: encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. Optional, defaults to false. More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm) type: boolean internal: description: internal specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored type: boolean - keyID: - description: keyID is the KMS key ID to use for encryption. Optional, Encrypt must be true, or this parameter is ignored. - type: string region: - description: region is the GCS location in which your bucket exists. Optional, will be set based on the installed GCS Region. + description: region is the Alibaba Cloud Region in which your bucket exists. Optional, will be set based on the installed Alibaba Cloud Region. For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html). type: string regionEndpoint: - description: regionEndpoint is the endpoint for S3 compatible storage services. Optional, defaults based on the Region that is provided. + description: regionEndpoint is the endpoint for OSS compatible storage services. Optional, defaults based on the Region that is provided. An endpoint which defaults to [bucket].[region].aliyuncs.com or [bucket].[region]-internal.aliyuncs.com (when internal=true). You can change the default endpoint by changing this value. type: string pvc: description: pvc represents configuration that uses a PersistentVolumeClaim. @@ -972,26 +969,23 @@ spec: type: string pattern: ^(Managed|Unmanaged)$ oss: - description: OSS represents configuration that uses Alibaba Cloud Object Storage. + description: OSS represents configuration that uses Alibaba Cloud Object Storage Service. type: object properties: bucket: - description: bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. + description: bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. About Bucket naming, more details you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/257087.htm) type: string encrypt: - description: encrypt specifies whether the registry stores the image in encrypted format or not. Optional, defaults to false. + description: encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. Optional, defaults to false. More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm) type: boolean internal: description: internal specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored type: boolean - keyID: - description: keyID is the KMS key ID to use for encryption. Optional, Encrypt must be true, or this parameter is ignored. - type: string region: - description: region is the GCS location in which your bucket exists. Optional, will be set based on the installed GCS Region. + description: region is the Alibaba Cloud Region in which your bucket exists. Optional, will be set based on the installed Alibaba Cloud Region. For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html). type: string regionEndpoint: - description: regionEndpoint is the endpoint for S3 compatible storage services. Optional, defaults based on the Region that is provided. + description: regionEndpoint is the endpoint for OSS compatible storage services. Optional, defaults based on the Region that is provided. An endpoint which defaults to [bucket].[region].aliyuncs.com or [bucket].[region]-internal.aliyuncs.com (when internal=true). You can change the default endpoint by changing this value. type: string pvc: description: pvc represents configuration that uses a PersistentVolumeClaim. diff --git a/imageregistry/v1/types.go b/imageregistry/v1/types.go index 20d546f3423..0e43f9d4e23 100644 --- a/imageregistry/v1/types.go +++ b/imageregistry/v1/types.go @@ -307,33 +307,35 @@ type ImageRegistryConfigStorageIBMCOS struct { } // ImageRegistryConfigStorageOSS holds Alibaba Cloud OSS configuration. +// the registry to use Alibaba Cloud Object Storage Service for backend storage. +// More about oss, you can look at the [official documentation](https://www.alibabacloud.com/help/product/31815.htm) type ImageRegistryConfigStorageOSS struct { // bucket is the bucket name in which you want to store the registry's // data. // Optional, will be generated if not provided. // +optional + // About Bucket naming, more details you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/257087.htm) Bucket string `json:"bucket,omitempty"` - // region is the GCS location in which your bucket exists. - // Optional, will be set based on the installed GCS Region. + // region is the Alibaba Cloud Region in which your bucket exists. + // Optional, will be set based on the installed Alibaba Cloud Region. // +optional + // For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html). Region string `json:"region,omitempty"` - // regionEndpoint is the endpoint for S3 compatible storage services. + // regionEndpoint is the endpoint for OSS compatible storage services. // Optional, defaults based on the Region that is provided. // +optional + // An endpoint which defaults to [bucket].[region].aliyuncs.com or [bucket].[region]-internal.aliyuncs.com (when internal=true). + // You can change the default endpoint by changing this value. RegionEndpoint string `json:"regionEndpoint,omitempty"` // internal specifies whether the registry use the OSS VPC internal endpoint // Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored // +optional Internal bool `json:"internal,omitempty"` - // encrypt specifies whether the registry stores the image in encrypted - // format or not. + // encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. // Optional, defaults to false. // +optional + // More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm) Encrypt bool `json:"encrypt,omitempty"` - // keyID is the KMS key ID to use for encryption. - // Optional, Encrypt must be true, or this parameter is ignored. - // +optional - KeyID string `json:"keyID,omitempty"` } // ImageRegistryConfigStorage describes how the storage should be configured @@ -363,7 +365,7 @@ type ImageRegistryConfigStorage struct { // ibmcos represents configuration that uses IBM Cloud Object Storage. // +optional IBMCOS *ImageRegistryConfigStorageIBMCOS `json:"ibmcos,omitempty"` - // OSS represents configuration that uses Alibaba Cloud Object Storage. + // OSS represents configuration that uses Alibaba Cloud Object Storage Service. // +optional OSS *ImageRegistryConfigStorageOSS `json:"oss,omitempty"` // managementState indicates if the operator manages the underlying diff --git a/imageregistry/v1/zz_generated.swagger_doc_generated.go b/imageregistry/v1/zz_generated.swagger_doc_generated.go index d4a6f7e1388..dd36f56882e 100644 --- a/imageregistry/v1/zz_generated.swagger_doc_generated.go +++ b/imageregistry/v1/zz_generated.swagger_doc_generated.go @@ -79,7 +79,7 @@ var map_ImageRegistryConfigStorage = map[string]string{ "pvc": "pvc represents configuration that uses a PersistentVolumeClaim.", "azure": "azure represents configuration that uses Azure Blob Storage.", "ibmcos": "ibmcos represents configuration that uses IBM Cloud Object Storage.", - "oss": "OSS represents configuration that uses Alibaba Cloud Object Storage.", + "oss": "OSS represents configuration that uses Alibaba Cloud Object Storage Service.", "managementState": "managementState indicates if the operator manages the underlying storage unit. If Managed the operator will remove the storage when this operator gets Removed.", } @@ -132,13 +132,12 @@ func (ImageRegistryConfigStorageIBMCOS) SwaggerDoc() map[string]string { } var map_ImageRegistryConfigStorageOSS = map[string]string{ - "": "ImageRegistryConfigStorageOSS holds Alibaba Cloud OSS configuration.", - "bucket": "bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided.", - "region": "region is the GCS location in which your bucket exists. Optional, will be set based on the installed GCS Region.", - "regionEndpoint": "regionEndpoint is the endpoint for S3 compatible storage services. Optional, defaults based on the Region that is provided.", + "": "ImageRegistryConfigStorageOSS holds Alibaba Cloud OSS configuration. the registry to use Alibaba Cloud Object Storage Service for backend storage. More about oss, you can look at the [official documentation](https://www.alibabacloud.com/help/product/31815.htm)", + "bucket": "bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. About Bucket naming, more details you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/257087.htm)", + "region": "region is the Alibaba Cloud Region in which your bucket exists. Optional, will be set based on the installed Alibaba Cloud Region. For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html).", + "regionEndpoint": "regionEndpoint is the endpoint for OSS compatible storage services. Optional, defaults based on the Region that is provided. An endpoint which defaults to [bucket].[region].aliyuncs.com or [bucket].[region]-internal.aliyuncs.com (when internal=true). You can change the default endpoint by changing this value.", "internal": "internal specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored", - "encrypt": "encrypt specifies whether the registry stores the image in encrypted format or not. Optional, defaults to false.", - "keyID": "keyID is the KMS key ID to use for encryption. Optional, Encrypt must be true, or this parameter is ignored.", + "encrypt": "encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. Optional, defaults to false. More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm)", } func (ImageRegistryConfigStorageOSS) SwaggerDoc() map[string]string { From e20bee90994caf6413e9483c6e047710a4a9b09f Mon Sep 17 00:00:00 2001 From: "xiaobing.meng" Date: Thu, 9 Dec 2021 09:11:41 +0800 Subject: [PATCH 3/5] To redefine the ImageRegistryConfigStorageAlibabaOSS --- imageregistry/v1/types.go | 49 ++++++++---- imageregistry/v1/zz_generated.deepcopy.go | 75 ++++++++++++++----- .../v1/zz_generated.swagger_doc_generated.go | 33 ++++---- 3 files changed, 111 insertions(+), 46 deletions(-) diff --git a/imageregistry/v1/types.go b/imageregistry/v1/types.go index 0e43f9d4e23..840c2954228 100644 --- a/imageregistry/v1/types.go +++ b/imageregistry/v1/types.go @@ -306,10 +306,37 @@ type ImageRegistryConfigStorageIBMCOS struct { ServiceInstanceCRN string `json:"serviceInstanceCRN,omitempty"` } -// ImageRegistryConfigStorageOSS holds Alibaba Cloud OSS configuration. +type EndpointAccessibility string + +var ( + InternalEndpoint = EndpointAccessibility("Internal") + PublicEndpoint = EndpointAccessibility("Public") +) + +type Encryption string + +var ( + ClearText = Encryption("ClearText") + AES256 = Encryption("AES256") + KMS = Encryption("KMS") +) + +// EncryptionAlibaba this a union type in kube parlance. Depending on the value for the encryptionType, +// different pointers may be used +type EncryptionAlibaba struct { + EncryptionType Encryption `json:"encryptionType"` + + KMSEncryptionAlibaba *KMSEncryptionAlibaba `json:"kms"` +} + +type KMSEncryptionAlibaba struct { + KeyID string +} + +// ImageRegistryConfigStorageAlibabaOSS holds Alibaba Cloud OSS configuration. // the registry to use Alibaba Cloud Object Storage Service for backend storage. // More about oss, you can look at the [official documentation](https://www.alibabacloud.com/help/product/31815.htm) -type ImageRegistryConfigStorageOSS struct { +type ImageRegistryConfigStorageAlibabaOSS struct { // bucket is the bucket name in which you want to store the registry's // data. // Optional, will be generated if not provided. @@ -321,21 +348,15 @@ type ImageRegistryConfigStorageOSS struct { // +optional // For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html). Region string `json:"region,omitempty"` - // regionEndpoint is the endpoint for OSS compatible storage services. - // Optional, defaults based on the Region that is provided. + // EndpointAccessibility specifies whether the registry use the OSS VPC internal endpoint + // Optional, defaults to Public. // +optional - // An endpoint which defaults to [bucket].[region].aliyuncs.com or [bucket].[region]-internal.aliyuncs.com (when internal=true). - // You can change the default endpoint by changing this value. - RegionEndpoint string `json:"regionEndpoint,omitempty"` - // internal specifies whether the registry use the OSS VPC internal endpoint - // Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored - // +optional - Internal bool `json:"internal,omitempty"` + EndpointAccessibility EndpointAccessibility `json:"endpointAccessibility,omitempty"` // encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. - // Optional, defaults to false. + // Optional, defaults to AES256. // +optional // More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm) - Encrypt bool `json:"encrypt,omitempty"` + Encrypt EncryptionAlibaba `json:"encrypt,omitempty"` } // ImageRegistryConfigStorage describes how the storage should be configured @@ -367,7 +388,7 @@ type ImageRegistryConfigStorage struct { IBMCOS *ImageRegistryConfigStorageIBMCOS `json:"ibmcos,omitempty"` // OSS represents configuration that uses Alibaba Cloud Object Storage Service. // +optional - OSS *ImageRegistryConfigStorageOSS `json:"oss,omitempty"` + OSS *ImageRegistryConfigStorageAlibabaOSS `json:"oss,omitempty"` // managementState indicates if the operator manages the underlying // storage unit. If Managed the operator will remove the storage when // this operator gets Removed. diff --git a/imageregistry/v1/zz_generated.deepcopy.go b/imageregistry/v1/zz_generated.deepcopy.go index bb470c108cf..00748800ba2 100644 --- a/imageregistry/v1/zz_generated.deepcopy.go +++ b/imageregistry/v1/zz_generated.deepcopy.go @@ -1,4 +1,3 @@ -//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by deepcopy-gen. DO NOT EDIT. @@ -75,6 +74,27 @@ func (in *ConfigList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EncryptionAlibaba) DeepCopyInto(out *EncryptionAlibaba) { + *out = *in + if in.KMSEncryptionAlibaba != nil { + in, out := &in.KMSEncryptionAlibaba, &out.KMSEncryptionAlibaba + *out = new(KMSEncryptionAlibaba) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionAlibaba. +func (in *EncryptionAlibaba) DeepCopy() *EncryptionAlibaba { + if in == nil { + return nil + } + out := new(EncryptionAlibaba) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ImagePruner) DeepCopyInto(out *ImagePruner) { *out = *in @@ -336,8 +356,8 @@ func (in *ImageRegistryConfigStorage) DeepCopyInto(out *ImageRegistryConfigStora } if in.OSS != nil { in, out := &in.OSS, &out.OSS - *out = new(ImageRegistryConfigStorageOSS) - **out = **in + *out = new(ImageRegistryConfigStorageAlibabaOSS) + (*in).DeepCopyInto(*out) } return } @@ -352,6 +372,23 @@ func (in *ImageRegistryConfigStorage) DeepCopy() *ImageRegistryConfigStorage { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageRegistryConfigStorageAlibabaOSS) DeepCopyInto(out *ImageRegistryConfigStorageAlibabaOSS) { + *out = *in + in.Encrypt.DeepCopyInto(&out.Encrypt) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageRegistryConfigStorageAlibabaOSS. +func (in *ImageRegistryConfigStorageAlibabaOSS) DeepCopy() *ImageRegistryConfigStorageAlibabaOSS { + if in == nil { + return nil + } + out := new(ImageRegistryConfigStorageAlibabaOSS) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ImageRegistryConfigStorageAzure) DeepCopyInto(out *ImageRegistryConfigStorageAzure) { *out = *in @@ -416,22 +453,6 @@ func (in *ImageRegistryConfigStorageIBMCOS) DeepCopy() *ImageRegistryConfigStora return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageRegistryConfigStorageOSS) DeepCopyInto(out *ImageRegistryConfigStorageOSS) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageRegistryConfigStorageOSS. -func (in *ImageRegistryConfigStorageOSS) DeepCopy() *ImageRegistryConfigStorageOSS { - if in == nil { - return nil - } - out := new(ImageRegistryConfigStorageOSS) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ImageRegistryConfigStoragePVC) DeepCopyInto(out *ImageRegistryConfigStoragePVC) { *out = *in @@ -569,3 +590,19 @@ func (in *ImageRegistryStatus) DeepCopy() *ImageRegistryStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KMSEncryptionAlibaba) DeepCopyInto(out *KMSEncryptionAlibaba) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSEncryptionAlibaba. +func (in *KMSEncryptionAlibaba) DeepCopy() *KMSEncryptionAlibaba { + if in == nil { + return nil + } + out := new(KMSEncryptionAlibaba) + in.DeepCopyInto(out) + return out +} diff --git a/imageregistry/v1/zz_generated.swagger_doc_generated.go b/imageregistry/v1/zz_generated.swagger_doc_generated.go index dd36f56882e..f5b2136d1bd 100644 --- a/imageregistry/v1/zz_generated.swagger_doc_generated.go +++ b/imageregistry/v1/zz_generated.swagger_doc_generated.go @@ -27,6 +27,14 @@ func (ConfigList) SwaggerDoc() map[string]string { return map_ConfigList } +var map_EncryptionAlibaba = map[string]string{ + "": "EncryptionAlibaba this a union type in kube parlance. Depending on the value for the encryptionType, different pointers may be used", +} + +func (EncryptionAlibaba) SwaggerDoc() map[string]string { + return map_EncryptionAlibaba +} + var map_ImageRegistryConfigProxy = map[string]string{ "": "ImageRegistryConfigProxy defines proxy configuration to be used by registry.", "http": "http defines the proxy to be used by the image registry when accessing HTTP endpoints.", @@ -87,6 +95,18 @@ func (ImageRegistryConfigStorage) SwaggerDoc() map[string]string { return map_ImageRegistryConfigStorage } +var map_ImageRegistryConfigStorageAlibabaOSS = map[string]string{ + "": "ImageRegistryConfigStorageAlibabaOSS holds Alibaba Cloud OSS configuration. the registry to use Alibaba Cloud Object Storage Service for backend storage. More about oss, you can look at the [official documentation](https://www.alibabacloud.com/help/product/31815.htm)", + "bucket": "bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. About Bucket naming, more details you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/257087.htm)", + "region": "region is the Alibaba Cloud Region in which your bucket exists. Optional, will be set based on the installed Alibaba Cloud Region. For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html).", + "endpointAccessibility": "EndpointAccessibility specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to Public.", + "encrypt": "encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. Optional, defaults to AES256. More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm)", +} + +func (ImageRegistryConfigStorageAlibabaOSS) SwaggerDoc() map[string]string { + return map_ImageRegistryConfigStorageAlibabaOSS +} + var map_ImageRegistryConfigStorageAzure = map[string]string{ "": "ImageRegistryConfigStorageAzure holds the information to configure the registry to use Azure Blob Storage for backend storage.", "accountName": "accountName defines the account to be used by the registry.", @@ -131,19 +151,6 @@ func (ImageRegistryConfigStorageIBMCOS) SwaggerDoc() map[string]string { return map_ImageRegistryConfigStorageIBMCOS } -var map_ImageRegistryConfigStorageOSS = map[string]string{ - "": "ImageRegistryConfigStorageOSS holds Alibaba Cloud OSS configuration. the registry to use Alibaba Cloud Object Storage Service for backend storage. More about oss, you can look at the [official documentation](https://www.alibabacloud.com/help/product/31815.htm)", - "bucket": "bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. About Bucket naming, more details you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/257087.htm)", - "region": "region is the Alibaba Cloud Region in which your bucket exists. Optional, will be set based on the installed Alibaba Cloud Region. For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html).", - "regionEndpoint": "regionEndpoint is the endpoint for OSS compatible storage services. Optional, defaults based on the Region that is provided. An endpoint which defaults to [bucket].[region].aliyuncs.com or [bucket].[region]-internal.aliyuncs.com (when internal=true). You can change the default endpoint by changing this value.", - "internal": "internal specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored", - "encrypt": "encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. Optional, defaults to false. More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm)", -} - -func (ImageRegistryConfigStorageOSS) SwaggerDoc() map[string]string { - return map_ImageRegistryConfigStorageOSS -} - var map_ImageRegistryConfigStoragePVC = map[string]string{ "": "ImageRegistryConfigStoragePVC holds Persistent Volume Claims data to be used by the registry.", "claim": "claim defines the Persisent Volume Claim's name to be used.", From 89df3107f7318b25c94edac805c6c2a5ad371303 Mon Sep 17 00:00:00 2001 From: "xiaobing.meng" Date: Thu, 9 Dec 2021 13:02:15 +0800 Subject: [PATCH 4/5] update crd --- imageregistry/v1/00-crd.yaml | 52 +++++++++++++------ imageregistry/v1/types.go | 4 +- .../v1/zz_generated.swagger_doc_generated.go | 2 +- 3 files changed, 39 insertions(+), 19 deletions(-) diff --git a/imageregistry/v1/00-crd.yaml b/imageregistry/v1/00-crd.yaml index 29cd581a136..f543cb72468 100644 --- a/imageregistry/v1/00-crd.yaml +++ b/imageregistry/v1/00-crd.yaml @@ -716,17 +716,27 @@ spec: description: bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. About Bucket naming, more details you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/257087.htm) type: string encrypt: - description: encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. Optional, defaults to false. More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm) - type: boolean - internal: - description: internal specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored - type: boolean + description: encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. Optional, defaults to AES256. More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm) + type: object + required: + - encryptionType + - kms + properties: + encryptionType: + type: string + kms: + type: object + required: + - keyID + properties: + keyID: + type: string + endpointAccessibility: + description: EndpointAccessibility specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to Internal. + type: string region: description: region is the Alibaba Cloud Region in which your bucket exists. Optional, will be set based on the installed Alibaba Cloud Region. For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html). type: string - regionEndpoint: - description: regionEndpoint is the endpoint for OSS compatible storage services. Optional, defaults based on the Region that is provided. An endpoint which defaults to [bucket].[region].aliyuncs.com or [bucket].[region]-internal.aliyuncs.com (when internal=true). You can change the default endpoint by changing this value. - type: string pvc: description: pvc represents configuration that uses a PersistentVolumeClaim. type: object @@ -976,17 +986,27 @@ spec: description: bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. About Bucket naming, more details you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/257087.htm) type: string encrypt: - description: encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. Optional, defaults to false. More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm) - type: boolean - internal: - description: internal specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to false. if RegionEndpoint is specified, this config will be ignored - type: boolean + description: encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. Optional, defaults to AES256. More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm) + type: object + required: + - encryptionType + - kms + properties: + encryptionType: + type: string + kms: + type: object + required: + - keyID + properties: + keyID: + type: string + endpointAccessibility: + description: EndpointAccessibility specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to Internal. + type: string region: description: region is the Alibaba Cloud Region in which your bucket exists. Optional, will be set based on the installed Alibaba Cloud Region. For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html). type: string - regionEndpoint: - description: regionEndpoint is the endpoint for OSS compatible storage services. Optional, defaults based on the Region that is provided. An endpoint which defaults to [bucket].[region].aliyuncs.com or [bucket].[region]-internal.aliyuncs.com (when internal=true). You can change the default endpoint by changing this value. - type: string pvc: description: pvc represents configuration that uses a PersistentVolumeClaim. type: object diff --git a/imageregistry/v1/types.go b/imageregistry/v1/types.go index 840c2954228..2d73bd8346d 100644 --- a/imageregistry/v1/types.go +++ b/imageregistry/v1/types.go @@ -330,7 +330,7 @@ type EncryptionAlibaba struct { } type KMSEncryptionAlibaba struct { - KeyID string + KeyID string `json:"keyID"` } // ImageRegistryConfigStorageAlibabaOSS holds Alibaba Cloud OSS configuration. @@ -349,7 +349,7 @@ type ImageRegistryConfigStorageAlibabaOSS struct { // For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html). Region string `json:"region,omitempty"` // EndpointAccessibility specifies whether the registry use the OSS VPC internal endpoint - // Optional, defaults to Public. + // Optional, defaults to Internal. // +optional EndpointAccessibility EndpointAccessibility `json:"endpointAccessibility,omitempty"` // encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. diff --git a/imageregistry/v1/zz_generated.swagger_doc_generated.go b/imageregistry/v1/zz_generated.swagger_doc_generated.go index f5b2136d1bd..3da4c18bb9b 100644 --- a/imageregistry/v1/zz_generated.swagger_doc_generated.go +++ b/imageregistry/v1/zz_generated.swagger_doc_generated.go @@ -99,7 +99,7 @@ var map_ImageRegistryConfigStorageAlibabaOSS = map[string]string{ "": "ImageRegistryConfigStorageAlibabaOSS holds Alibaba Cloud OSS configuration. the registry to use Alibaba Cloud Object Storage Service for backend storage. More about oss, you can look at the [official documentation](https://www.alibabacloud.com/help/product/31815.htm)", "bucket": "bucket is the bucket name in which you want to store the registry's data. Optional, will be generated if not provided. About Bucket naming, more details you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/257087.htm)", "region": "region is the Alibaba Cloud Region in which your bucket exists. Optional, will be set based on the installed Alibaba Cloud Region. For a list of regions, you can look at the [official documentation](https://www.alibabacloud.com/help/doc-detail/31837.html).", - "endpointAccessibility": "EndpointAccessibility specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to Public.", + "endpointAccessibility": "EndpointAccessibility specifies whether the registry use the OSS VPC internal endpoint Optional, defaults to Internal.", "encrypt": "encrypt specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. Optional, defaults to AES256. More details, you can look cat the [official documentation](https://www.alibabacloud.com/help/doc-detail/117914.htm)", } From 9158054edc27df50ea64894c1d22ebbaa25014bf Mon Sep 17 00:00:00 2001 From: "xiaobing.meng" Date: Fri, 10 Dec 2021 08:47:48 +0800 Subject: [PATCH 5/5] Adding updates from update-gofmt for go1.17 --- imageregistry/v1/zz_generated.deepcopy.go | 1 + 1 file changed, 1 insertion(+) diff --git a/imageregistry/v1/zz_generated.deepcopy.go b/imageregistry/v1/zz_generated.deepcopy.go index 00748800ba2..0cb96ed9359 100644 --- a/imageregistry/v1/zz_generated.deepcopy.go +++ b/imageregistry/v1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by deepcopy-gen. DO NOT EDIT.