From 941183e4e68b8a50aaaf2b9eb04d076a4044a038 Mon Sep 17 00:00:00 2001 From: Krish Chowdhary Date: Thu, 27 May 2021 12:53:05 -0400 Subject: [PATCH] removes policy action, adds bucketaccessinfo --- .../v1alpha1/access_types.go | 46 ++++ .../v1alpha1/openapi_generated.go | 212 +++++++++++++++++- apis/objectstorage.k8s.io/v1alpha1/types.go | 4 - .../v1alpha1/zz_generated.deepcopy.go | 127 ++++++++++- .../v1alpha1/bucketaccessinfo.go | 178 +++++++++++++++ .../v1alpha1/fake/fake_bucketaccessinfo.go | 130 +++++++++++ .../fake/fake_objectstorage.k8s.io_client.go | 4 + .../v1alpha1/generated_expansion.go | 2 + .../v1alpha1/objectstorage.k8s.io_client.go | 5 + ...ectstorage.k8s.io_bucketaccessclasses.yaml | 25 --- crds/objectstorage.k8s.io_bucketaccesses.yaml | 2 - ...jectstorage.k8s.io_bucketaccessinfoes.yaml | 67 ++++++ informers/externalversions/generic.go | 2 + .../v1alpha1/bucketaccessinfo.go | 90 ++++++++ .../v1alpha1/interface.go | 7 + .../v1alpha1/bucketaccessinfo.go | 94 ++++++++ .../v1alpha1/expansion_generated.go | 8 + 17 files changed, 955 insertions(+), 48 deletions(-) create mode 100644 apis/objectstorage.k8s.io/v1alpha1/access_types.go create mode 100644 clientset/typed/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go create mode 100644 clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketaccessinfo.go create mode 100644 crds/objectstorage.k8s.io_bucketaccessinfoes.yaml create mode 100644 informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go create mode 100644 listers/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go diff --git a/apis/objectstorage.k8s.io/v1alpha1/access_types.go b/apis/objectstorage.k8s.io/v1alpha1/access_types.go new file mode 100644 index 00000000..3ca3a643 --- /dev/null +++ b/apis/objectstorage.k8s.io/v1alpha1/access_types.go @@ -0,0 +1,46 @@ +package v1alpha1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:resource:scope=Namespaced +// +kubebuilder:storageversion + +type BucketAccessInfo struct { + metav1.TypeMeta `json:",inline"` + + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + S3 *S3BucketAccessInfo `json:"s3,omitempty"` + Azure *AzureBucketAccessInfo `json:"azure,omitempty"` + Gcs *GCSBucketAccessInfo `json:"gcs,omitempty"` +} + +type S3BucketAccessInfo struct { + Endpoint string `json:"endpoint,omitempty"` + BucketName string `json:"bucketName,omitempty"` + Region string `json:"region,omitempty"` + Credentials string `json:"credentials,omitempty"` + Certificates string `json:"certificates,omitempty"` + SignatureVersion S3SignatureVersion `json:"signatureVersion,omitempty"` +} + +type AzureBucketAccessInfo struct { + Endpoint string `json:"endpoint,omitempty"` // scheme is mandatory in the URL + StorageAccountName string `json:"storageAccountName,omitempty"` // This is the equivalent of bucket name + access key + ContainerName string `json:"containerName,omitempty"` // Optional. This is a prefix at the root of the bucket + SecretKey string `json:"secretKey,omitempty"` // This is the equivalent of secret key +} + +type GCSBucketAccessInfo struct { +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type BucketAccessInfoList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []BucketAccessInfo `json:"items"` +} diff --git a/apis/objectstorage.k8s.io/v1alpha1/openapi_generated.go b/apis/objectstorage.k8s.io/v1alpha1/openapi_generated.go index a0af6b3d..8201fd4d 100644 --- a/apis/objectstorage.k8s.io/v1alpha1/openapi_generated.go +++ b/apis/objectstorage.k8s.io/v1alpha1/openapi_generated.go @@ -29,11 +29,14 @@ import ( func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ + "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.AzureBucketAccessInfo": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_AzureBucketAccessInfo(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.AzureProtocol": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_AzureProtocol(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.Bucket": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_Bucket(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccess": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccess(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessClass": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessClass(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessClassList": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessClassList(ref), + "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessInfo": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessInfo(ref), + "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessInfoList": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessInfoList(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessList": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessList(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessRequest": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessRequest(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessRequestList": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessRequestList(ref), @@ -50,12 +53,53 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketRequestStatus": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketRequestStatus(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketSpec": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketSpec(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketStatus": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketStatus(ref), + "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.GCSBucketAccessInfo": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_GCSBucketAccessInfo(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.GCSProtocol": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_GCSProtocol(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.Protocol": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_Protocol(ref), + "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.S3BucketAccessInfo": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_S3BucketAccessInfo(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.S3Protocol": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_S3Protocol(ref), } } +func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_AzureBucketAccessInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "endpoint": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "storageAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "scheme is mandatory in the URL", + Type: []string{"string"}, + Format: "", + }, + }, + "containerName": { + SchemaProps: spec.SchemaProps{ + Description: "This is the equivalent of bucket name + access key", + Type: []string{"string"}, + Format: "", + }, + }, + "secretKey": { + SchemaProps: spec.SchemaProps{ + Description: "Optional. This is a prefix at the root of the bucket", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_AzureProtocol(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -192,11 +236,6 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, - "policyActionsConfigMap": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, "parameters": { SchemaProps: spec.SchemaProps{ Type: []string{"object"}, @@ -216,7 +255,7 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -268,6 +307,103 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp } } +func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "s3": { + SchemaProps: spec.SchemaProps{ + Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.S3BucketAccessInfo"), + }, + }, + "azure": { + SchemaProps: spec.SchemaProps{ + Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.AzureBucketAccessInfo"), + }, + }, + "gcs": { + SchemaProps: spec.SchemaProps{ + Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.GCSBucketAccessInfo"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.AzureBucketAccessInfo", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.GCSBucketAccessInfo", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.S3BucketAccessInfo"}, + } +} + +func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessInfoList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessInfo"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessInfo"}, + } +} + func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -501,12 +637,6 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp Ref: ref("k8s.io/api/core/v1.ObjectReference"), }, }, - "policyActionsConfigMapData": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, "parameters": { SchemaProps: spec.SchemaProps{ Type: []string{"object"}, @@ -1022,6 +1152,16 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp } } +func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_GCSBucketAccessInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + }, + }, + } +} + func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_GCSProtocol(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -1081,6 +1221,54 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp } } +func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_S3BucketAccessInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "endpoint": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "bucketName": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "credentials": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "certificates": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "signatureVersion": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_S3Protocol(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/apis/objectstorage.k8s.io/v1alpha1/types.go b/apis/objectstorage.k8s.io/v1alpha1/types.go index 372e66fb..766c12ba 100644 --- a/apis/objectstorage.k8s.io/v1alpha1/types.go +++ b/apis/objectstorage.k8s.io/v1alpha1/types.go @@ -202,8 +202,6 @@ type BucketAccessClass struct { // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - PolicyActionsConfigMap *corev1.ObjectReference `json:"policyActionsConfigMap,omitempty"` - // +optional Parameters map[string]string `json:"parameters,omitempty"` } @@ -245,8 +243,6 @@ type BucketAccessSpec struct { // +optional ServiceAccount *corev1.ObjectReference `json:"serviceAccount,omitempty"` - PolicyActionsConfigMapData string `json:"policyActionsConfigMapData,omitempty"` - // +optional Parameters map[string]string `json:"parameters,omitempty"` } diff --git a/apis/objectstorage.k8s.io/v1alpha1/zz_generated.deepcopy.go b/apis/objectstorage.k8s.io/v1alpha1/zz_generated.deepcopy.go index 9ea478a4..8a2f2358 100644 --- a/apis/objectstorage.k8s.io/v1alpha1/zz_generated.deepcopy.go +++ b/apis/objectstorage.k8s.io/v1alpha1/zz_generated.deepcopy.go @@ -25,6 +25,22 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureBucketAccessInfo) DeepCopyInto(out *AzureBucketAccessInfo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureBucketAccessInfo. +func (in *AzureBucketAccessInfo) DeepCopy() *AzureBucketAccessInfo { + if in == nil { + return nil + } + out := new(AzureBucketAccessInfo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureProtocol) DeepCopyInto(out *AzureProtocol) { *out = *in @@ -102,11 +118,6 @@ func (in *BucketAccessClass) DeepCopyInto(out *BucketAccessClass) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.PolicyActionsConfigMap != nil { - in, out := &in.PolicyActionsConfigMap, &out.PolicyActionsConfigMap - *out = new(v1.ObjectReference) - **out = **in - } if in.Parameters != nil { in, out := &in.Parameters, &out.Parameters *out = make(map[string]string, len(*in)) @@ -168,6 +179,80 @@ func (in *BucketAccessClassList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BucketAccessInfo) DeepCopyInto(out *BucketAccessInfo) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.S3 != nil { + in, out := &in.S3, &out.S3 + *out = new(S3BucketAccessInfo) + **out = **in + } + if in.Azure != nil { + in, out := &in.Azure, &out.Azure + *out = new(AzureBucketAccessInfo) + **out = **in + } + if in.Gcs != nil { + in, out := &in.Gcs, &out.Gcs + *out = new(GCSBucketAccessInfo) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketAccessInfo. +func (in *BucketAccessInfo) DeepCopy() *BucketAccessInfo { + if in == nil { + return nil + } + out := new(BucketAccessInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BucketAccessInfo) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BucketAccessInfoList) DeepCopyInto(out *BucketAccessInfoList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]BucketAccessInfo, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketAccessInfoList. +func (in *BucketAccessInfoList) DeepCopy() *BucketAccessInfoList { + if in == nil { + return nil + } + out := new(BucketAccessInfoList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BucketAccessInfoList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BucketAccessList) DeepCopyInto(out *BucketAccessList) { *out = *in @@ -596,6 +681,22 @@ func (in *BucketStatus) DeepCopy() *BucketStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCSBucketAccessInfo) DeepCopyInto(out *GCSBucketAccessInfo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCSBucketAccessInfo. +func (in *GCSBucketAccessInfo) DeepCopy() *GCSBucketAccessInfo { + if in == nil { + return nil + } + out := new(GCSBucketAccessInfo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GCSProtocol) DeepCopyInto(out *GCSProtocol) { *out = *in @@ -643,6 +744,22 @@ func (in *Protocol) DeepCopy() *Protocol { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *S3BucketAccessInfo) DeepCopyInto(out *S3BucketAccessInfo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3BucketAccessInfo. +func (in *S3BucketAccessInfo) DeepCopy() *S3BucketAccessInfo { + if in == nil { + return nil + } + out := new(S3BucketAccessInfo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *S3Protocol) DeepCopyInto(out *S3Protocol) { *out = *in diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go new file mode 100644 index 00000000..6990924e --- /dev/null +++ b/clientset/typed/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go @@ -0,0 +1,178 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1" + scheme "sigs.k8s.io/container-object-storage-interface-api/clientset/scheme" +) + +// BucketAccessInfosGetter has a method to return a BucketAccessInfoInterface. +// A group's client should implement this interface. +type BucketAccessInfosGetter interface { + BucketAccessInfos(namespace string) BucketAccessInfoInterface +} + +// BucketAccessInfoInterface has methods to work with BucketAccessInfo resources. +type BucketAccessInfoInterface interface { + Create(ctx context.Context, bucketAccessInfo *v1alpha1.BucketAccessInfo, opts v1.CreateOptions) (*v1alpha1.BucketAccessInfo, error) + Update(ctx context.Context, bucketAccessInfo *v1alpha1.BucketAccessInfo, opts v1.UpdateOptions) (*v1alpha1.BucketAccessInfo, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.BucketAccessInfo, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BucketAccessInfoList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketAccessInfo, err error) + BucketAccessInfoExpansion +} + +// bucketAccessInfos implements BucketAccessInfoInterface +type bucketAccessInfos struct { + client rest.Interface + ns string +} + +// newBucketAccessInfos returns a BucketAccessInfos +func newBucketAccessInfos(c *ObjectstorageV1alpha1Client, namespace string) *bucketAccessInfos { + return &bucketAccessInfos{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the bucketAccessInfo, and returns the corresponding bucketAccessInfo object, and an error if there is any. +func (c *bucketAccessInfos) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketAccessInfo, err error) { + result = &v1alpha1.BucketAccessInfo{} + err = c.client.Get(). + Namespace(c.ns). + Resource("bucketaccessinfos"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of BucketAccessInfos that match those selectors. +func (c *bucketAccessInfos) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketAccessInfoList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.BucketAccessInfoList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("bucketaccessinfos"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested bucketAccessInfos. +func (c *bucketAccessInfos) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("bucketaccessinfos"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a bucketAccessInfo and creates it. Returns the server's representation of the bucketAccessInfo, and an error, if there is any. +func (c *bucketAccessInfos) Create(ctx context.Context, bucketAccessInfo *v1alpha1.BucketAccessInfo, opts v1.CreateOptions) (result *v1alpha1.BucketAccessInfo, err error) { + result = &v1alpha1.BucketAccessInfo{} + err = c.client.Post(). + Namespace(c.ns). + Resource("bucketaccessinfos"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(bucketAccessInfo). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a bucketAccessInfo and updates it. Returns the server's representation of the bucketAccessInfo, and an error, if there is any. +func (c *bucketAccessInfos) Update(ctx context.Context, bucketAccessInfo *v1alpha1.BucketAccessInfo, opts v1.UpdateOptions) (result *v1alpha1.BucketAccessInfo, err error) { + result = &v1alpha1.BucketAccessInfo{} + err = c.client.Put(). + Namespace(c.ns). + Resource("bucketaccessinfos"). + Name(bucketAccessInfo.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(bucketAccessInfo). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the bucketAccessInfo and deletes it. Returns an error if one occurs. +func (c *bucketAccessInfos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("bucketaccessinfos"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *bucketAccessInfos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("bucketaccessinfos"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched bucketAccessInfo. +func (c *bucketAccessInfos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketAccessInfo, err error) { + result = &v1alpha1.BucketAccessInfo{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("bucketaccessinfos"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketaccessinfo.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketaccessinfo.go new file mode 100644 index 00000000..acbcde3f --- /dev/null +++ b/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketaccessinfo.go @@ -0,0 +1,130 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1" +) + +// FakeBucketAccessInfos implements BucketAccessInfoInterface +type FakeBucketAccessInfos struct { + Fake *FakeObjectstorageV1alpha1 + ns string +} + +var bucketaccessinfosResource = schema.GroupVersionResource{Group: "objectstorage.k8s.io", Version: "v1alpha1", Resource: "bucketaccessinfos"} + +var bucketaccessinfosKind = schema.GroupVersionKind{Group: "objectstorage.k8s.io", Version: "v1alpha1", Kind: "BucketAccessInfo"} + +// Get takes name of the bucketAccessInfo, and returns the corresponding bucketAccessInfo object, and an error if there is any. +func (c *FakeBucketAccessInfos) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketAccessInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(bucketaccessinfosResource, c.ns, name), &v1alpha1.BucketAccessInfo{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BucketAccessInfo), err +} + +// List takes label and field selectors, and returns the list of BucketAccessInfos that match those selectors. +func (c *FakeBucketAccessInfos) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketAccessInfoList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(bucketaccessinfosResource, bucketaccessinfosKind, c.ns, opts), &v1alpha1.BucketAccessInfoList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.BucketAccessInfoList{ListMeta: obj.(*v1alpha1.BucketAccessInfoList).ListMeta} + for _, item := range obj.(*v1alpha1.BucketAccessInfoList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested bucketAccessInfos. +func (c *FakeBucketAccessInfos) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(bucketaccessinfosResource, c.ns, opts)) + +} + +// Create takes the representation of a bucketAccessInfo and creates it. Returns the server's representation of the bucketAccessInfo, and an error, if there is any. +func (c *FakeBucketAccessInfos) Create(ctx context.Context, bucketAccessInfo *v1alpha1.BucketAccessInfo, opts v1.CreateOptions) (result *v1alpha1.BucketAccessInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(bucketaccessinfosResource, c.ns, bucketAccessInfo), &v1alpha1.BucketAccessInfo{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BucketAccessInfo), err +} + +// Update takes the representation of a bucketAccessInfo and updates it. Returns the server's representation of the bucketAccessInfo, and an error, if there is any. +func (c *FakeBucketAccessInfos) Update(ctx context.Context, bucketAccessInfo *v1alpha1.BucketAccessInfo, opts v1.UpdateOptions) (result *v1alpha1.BucketAccessInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(bucketaccessinfosResource, c.ns, bucketAccessInfo), &v1alpha1.BucketAccessInfo{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BucketAccessInfo), err +} + +// Delete takes name of the bucketAccessInfo and deletes it. Returns an error if one occurs. +func (c *FakeBucketAccessInfos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(bucketaccessinfosResource, c.ns, name), &v1alpha1.BucketAccessInfo{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBucketAccessInfos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(bucketaccessinfosResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.BucketAccessInfoList{}) + return err +} + +// Patch applies the patch and returns the patched bucketAccessInfo. +func (c *FakeBucketAccessInfos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketAccessInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(bucketaccessinfosResource, c.ns, name, pt, data, subresources...), &v1alpha1.BucketAccessInfo{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BucketAccessInfo), err +} diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_objectstorage.k8s.io_client.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_objectstorage.k8s.io_client.go index 3cea1a59..d264940c 100644 --- a/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_objectstorage.k8s.io_client.go +++ b/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_objectstorage.k8s.io_client.go @@ -40,6 +40,10 @@ func (c *FakeObjectstorageV1alpha1) BucketAccessClasses() v1alpha1.BucketAccessC return &FakeBucketAccessClasses{c} } +func (c *FakeObjectstorageV1alpha1) BucketAccessInfos(namespace string) v1alpha1.BucketAccessInfoInterface { + return &FakeBucketAccessInfos{c, namespace} +} + func (c *FakeObjectstorageV1alpha1) BucketAccessRequests(namespace string) v1alpha1.BucketAccessRequestInterface { return &FakeBucketAccessRequests{c, namespace} } diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/generated_expansion.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/generated_expansion.go index 7b9057e3..c1a8a1fb 100644 --- a/clientset/typed/objectstorage.k8s.io/v1alpha1/generated_expansion.go +++ b/clientset/typed/objectstorage.k8s.io/v1alpha1/generated_expansion.go @@ -24,6 +24,8 @@ type BucketAccessExpansion interface{} type BucketAccessClassExpansion interface{} +type BucketAccessInfoExpansion interface{} + type BucketAccessRequestExpansion interface{} type BucketClassExpansion interface{} diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/objectstorage.k8s.io_client.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/objectstorage.k8s.io_client.go index 11ef1e31..9a7d44ea 100644 --- a/clientset/typed/objectstorage.k8s.io/v1alpha1/objectstorage.k8s.io_client.go +++ b/clientset/typed/objectstorage.k8s.io/v1alpha1/objectstorage.k8s.io_client.go @@ -29,6 +29,7 @@ type ObjectstorageV1alpha1Interface interface { BucketsGetter BucketAccessesGetter BucketAccessClassesGetter + BucketAccessInfosGetter BucketAccessRequestsGetter BucketClassesGetter BucketRequestsGetter @@ -51,6 +52,10 @@ func (c *ObjectstorageV1alpha1Client) BucketAccessClasses() BucketAccessClassInt return newBucketAccessClasses(c) } +func (c *ObjectstorageV1alpha1Client) BucketAccessInfos(namespace string) BucketAccessInfoInterface { + return newBucketAccessInfos(c, namespace) +} + func (c *ObjectstorageV1alpha1Client) BucketAccessRequests(namespace string) BucketAccessRequestInterface { return newBucketAccessRequests(c, namespace) } diff --git a/crds/objectstorage.k8s.io_bucketaccessclasses.yaml b/crds/objectstorage.k8s.io_bucketaccessclasses.yaml index 4fd63c15..29949523 100644 --- a/crds/objectstorage.k8s.io_bucketaccessclasses.yaml +++ b/crds/objectstorage.k8s.io_bucketaccessclasses.yaml @@ -32,31 +32,6 @@ spec: additionalProperties: type: string type: object - policyActionsConfigMap: - description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - type: object type: object served: true storage: true diff --git a/crds/objectstorage.k8s.io_bucketaccesses.yaml b/crds/objectstorage.k8s.io_bucketaccesses.yaml index ee6d9c75..7bbcb521 100644 --- a/crds/objectstorage.k8s.io_bucketaccesses.yaml +++ b/crds/objectstorage.k8s.io_bucketaccesses.yaml @@ -61,8 +61,6 @@ spec: additionalProperties: type: string type: object - policyActionsConfigMapData: - type: string serviceAccount: description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: diff --git a/crds/objectstorage.k8s.io_bucketaccessinfoes.yaml b/crds/objectstorage.k8s.io_bucketaccessinfoes.yaml new file mode 100644 index 00000000..821d52f7 --- /dev/null +++ b/crds/objectstorage.k8s.io_bucketaccessinfoes.yaml @@ -0,0 +1,67 @@ + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.5.0 + creationTimestamp: null + name: bucketaccessinfoes.objectstorage.k8s.io +spec: + group: objectstorage.k8s.io + names: + kind: BucketAccessInfo + listKind: BucketAccessInfoList + plural: bucketaccessinfoes + singular: bucketaccessinfo + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + azure: + properties: + containerName: + type: string + endpoint: + type: string + secretKey: + type: string + storageAccountName: + type: string + type: object + gcs: + type: object + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + s3: + properties: + bucketName: + type: string + certificates: + type: string + credentials: + type: string + endpoint: + type: string + region: + type: string + signatureVersion: + type: string + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/informers/externalversions/generic.go b/informers/externalversions/generic.go index be22d3f0..604c5e31 100644 --- a/informers/externalversions/generic.go +++ b/informers/externalversions/generic.go @@ -59,6 +59,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Objectstorage().V1alpha1().BucketAccesses().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("bucketaccessclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Objectstorage().V1alpha1().BucketAccessClasses().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("bucketaccessinfos"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Objectstorage().V1alpha1().BucketAccessInfos().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("bucketaccessrequests"): return &genericInformer{resource: resource.GroupResource(), informer: f.Objectstorage().V1alpha1().BucketAccessRequests().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("bucketclasses"): diff --git a/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go b/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go new file mode 100644 index 00000000..eafb854b --- /dev/null +++ b/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go @@ -0,0 +1,90 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + objectstoragek8siov1alpha1 "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1" + clientset "sigs.k8s.io/container-object-storage-interface-api/clientset" + internalinterfaces "sigs.k8s.io/container-object-storage-interface-api/informers/externalversions/internalinterfaces" + v1alpha1 "sigs.k8s.io/container-object-storage-interface-api/listers/objectstorage.k8s.io/v1alpha1" +) + +// BucketAccessInfoInformer provides access to a shared informer and lister for +// BucketAccessInfos. +type BucketAccessInfoInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.BucketAccessInfoLister +} + +type bucketAccessInfoInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewBucketAccessInfoInformer constructs a new informer for BucketAccessInfo type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBucketAccessInfoInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBucketAccessInfoInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredBucketAccessInfoInformer constructs a new informer for BucketAccessInfo type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBucketAccessInfoInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ObjectstorageV1alpha1().BucketAccessInfos(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ObjectstorageV1alpha1().BucketAccessInfos(namespace).Watch(context.TODO(), options) + }, + }, + &objectstoragek8siov1alpha1.BucketAccessInfo{}, + resyncPeriod, + indexers, + ) +} + +func (f *bucketAccessInfoInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBucketAccessInfoInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *bucketAccessInfoInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&objectstoragek8siov1alpha1.BucketAccessInfo{}, f.defaultInformer) +} + +func (f *bucketAccessInfoInformer) Lister() v1alpha1.BucketAccessInfoLister { + return v1alpha1.NewBucketAccessInfoLister(f.Informer().GetIndexer()) +} diff --git a/informers/externalversions/objectstorage.k8s.io/v1alpha1/interface.go b/informers/externalversions/objectstorage.k8s.io/v1alpha1/interface.go index a211553a..004ec5e1 100644 --- a/informers/externalversions/objectstorage.k8s.io/v1alpha1/interface.go +++ b/informers/externalversions/objectstorage.k8s.io/v1alpha1/interface.go @@ -30,6 +30,8 @@ type Interface interface { BucketAccesses() BucketAccessInformer // BucketAccessClasses returns a BucketAccessClassInformer. BucketAccessClasses() BucketAccessClassInformer + // BucketAccessInfos returns a BucketAccessInfoInformer. + BucketAccessInfos() BucketAccessInfoInformer // BucketAccessRequests returns a BucketAccessRequestInformer. BucketAccessRequests() BucketAccessRequestInformer // BucketClasses returns a BucketClassInformer. @@ -64,6 +66,11 @@ func (v *version) BucketAccessClasses() BucketAccessClassInformer { return &bucketAccessClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } +// BucketAccessInfos returns a BucketAccessInfoInformer. +func (v *version) BucketAccessInfos() BucketAccessInfoInformer { + return &bucketAccessInfoInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // BucketAccessRequests returns a BucketAccessRequestInformer. func (v *version) BucketAccessRequests() BucketAccessRequestInformer { return &bucketAccessRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/listers/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go b/listers/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go new file mode 100644 index 00000000..bf538da1 --- /dev/null +++ b/listers/objectstorage.k8s.io/v1alpha1/bucketaccessinfo.go @@ -0,0 +1,94 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1" +) + +// BucketAccessInfoLister helps list BucketAccessInfos. +type BucketAccessInfoLister interface { + // List lists all BucketAccessInfos in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.BucketAccessInfo, err error) + // BucketAccessInfos returns an object that can list and get BucketAccessInfos. + BucketAccessInfos(namespace string) BucketAccessInfoNamespaceLister + BucketAccessInfoListerExpansion +} + +// bucketAccessInfoLister implements the BucketAccessInfoLister interface. +type bucketAccessInfoLister struct { + indexer cache.Indexer +} + +// NewBucketAccessInfoLister returns a new BucketAccessInfoLister. +func NewBucketAccessInfoLister(indexer cache.Indexer) BucketAccessInfoLister { + return &bucketAccessInfoLister{indexer: indexer} +} + +// List lists all BucketAccessInfos in the indexer. +func (s *bucketAccessInfoLister) List(selector labels.Selector) (ret []*v1alpha1.BucketAccessInfo, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.BucketAccessInfo)) + }) + return ret, err +} + +// BucketAccessInfos returns an object that can list and get BucketAccessInfos. +func (s *bucketAccessInfoLister) BucketAccessInfos(namespace string) BucketAccessInfoNamespaceLister { + return bucketAccessInfoNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// BucketAccessInfoNamespaceLister helps list and get BucketAccessInfos. +type BucketAccessInfoNamespaceLister interface { + // List lists all BucketAccessInfos in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.BucketAccessInfo, err error) + // Get retrieves the BucketAccessInfo from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.BucketAccessInfo, error) + BucketAccessInfoNamespaceListerExpansion +} + +// bucketAccessInfoNamespaceLister implements the BucketAccessInfoNamespaceLister +// interface. +type bucketAccessInfoNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all BucketAccessInfos in the indexer for a given namespace. +func (s bucketAccessInfoNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.BucketAccessInfo, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.BucketAccessInfo)) + }) + return ret, err +} + +// Get retrieves the BucketAccessInfo from the indexer for a given namespace and name. +func (s bucketAccessInfoNamespaceLister) Get(name string) (*v1alpha1.BucketAccessInfo, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("bucketaccessinfo"), name) + } + return obj.(*v1alpha1.BucketAccessInfo), nil +} diff --git a/listers/objectstorage.k8s.io/v1alpha1/expansion_generated.go b/listers/objectstorage.k8s.io/v1alpha1/expansion_generated.go index b90e4eee..06d7756b 100644 --- a/listers/objectstorage.k8s.io/v1alpha1/expansion_generated.go +++ b/listers/objectstorage.k8s.io/v1alpha1/expansion_generated.go @@ -30,6 +30,14 @@ type BucketAccessListerExpansion interface{} // BucketAccessClassLister. type BucketAccessClassListerExpansion interface{} +// BucketAccessInfoListerExpansion allows custom methods to be added to +// BucketAccessInfoLister. +type BucketAccessInfoListerExpansion interface{} + +// BucketAccessInfoNamespaceListerExpansion allows custom methods to be added to +// BucketAccessInfoNamespaceLister. +type BucketAccessInfoNamespaceListerExpansion interface{} + // BucketAccessRequestListerExpansion allows custom methods to be added to // BucketAccessRequestLister. type BucketAccessRequestListerExpansion interface{}