diff --git a/README.md b/README.md index eeccf10e..08082dc5 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,12 @@ This repository hosts the API defintion of the Custom Resource Definitions (CRD) used for the Container Object Storage Interface (COSI) project. The provisioned unit of storage is a `Bucket`. The following CRDs are defined for managing the lifecycle of Buckets: - - BucketRequest - Represents a request to provision a Bucket + - BucketClaim - Represents a request to provision a Bucket - BucketClass - Represents a class of Buckets with similar characteristics - Bucket - Represents a Bucket or its equivalent in the storage backend The following CRDs are defined for managing the lifecycle of workloads accessing the Bucket: - - BucketAccessRequest - Represents a request to access a Bucket - BucketAccessClass - Represents a class of accessors with similar access requirements - BucketAccess - Represents a access token or service account in the storage backend diff --git a/apis/objectstorage.k8s.io/v1alpha1/openapi_generated.go b/apis/objectstorage.k8s.io/v1alpha1/openapi_generated.go index a0af6b3d..0ebe72d2 100644 --- a/apis/objectstorage.k8s.io/v1alpha1/openapi_generated.go +++ b/apis/objectstorage.k8s.io/v1alpha1/openapi_generated.go @@ -35,19 +35,15 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "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.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), - "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessRequestSpec": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessRequestSpec(ref), - "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessRequestStatus": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessRequestStatus(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessSpec": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessSpec(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessStatus": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessStatus(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClass": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketClass(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClassList": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketClassList(ref), "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketList": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketList(ref), - "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketRequest": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketRequest(ref), - "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketRequestList": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketRequestList(ref), - "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketRequestSpec": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketRequestSpec(ref), - "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.BucketClaim": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketClaim(ref), + "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClaimList": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketClaimList(ref), + "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClaimSpec": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketClaimSpec(ref), + "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClaimStatus": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketClaimStatus(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.GCSProtocol": schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_GCSProtocol(ref), @@ -316,169 +312,6 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp } } -func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessRequest(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"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessRequestSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessRequestStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessRequestSpec", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketAccessRequestStatus"}, - } -} - -func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessRequestList(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.BucketAccessRequest"), - }, - }, - }, - }, - }, - }, - 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.BucketAccessRequest"}, - } -} - -func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessRequestSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "serviceAccountName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "bucketRequestName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "bucketName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "bucketAccessClassName": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"bucketAccessClassName"}, - }, - }, - } -} - -func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessRequestStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "message": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "accessGranted": { - SchemaProps: spec.SchemaProps{ - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "bucketAccessName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketAccessSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -491,11 +324,6 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp Format: "", }, }, - "bucketAccessRequest": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, "serviceAccount": { SchemaProps: spec.SchemaProps{ Ref: ref("k8s.io/api/core/v1.ObjectReference"), @@ -756,7 +584,7 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp } } -func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketClaim(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -785,24 +613,24 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp "spec": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketRequestSpec"), + Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClaimSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketRequestStatus"), + Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClaimStatus"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketRequestSpec", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketRequestStatus"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClaimSpec", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClaimStatus"}, } } -func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketRequestList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketClaimList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -835,7 +663,7 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp 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.BucketRequest"), + Ref: ref("sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClaim"), }, }, }, @@ -846,11 +674,11 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketRequest"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/container-object-storage-interface-api/apis/objectstorage.k8s.io/v1alpha1.BucketClaim"}, } } -func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketRequestSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketClaimSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -874,7 +702,7 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp } } -func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketRequestStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alpha1_BucketClaimStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -923,7 +751,7 @@ func schema_container_object_storage_interface_api_apis_objectstoragek8sio_v1alp Format: "", }, }, - "bucketRequest": { + "bucketClaim": { SchemaProps: spec.SchemaProps{ Ref: ref("k8s.io/api/core/v1.ObjectReference"), }, diff --git a/apis/objectstorage.k8s.io/v1alpha1/types.go b/apis/objectstorage.k8s.io/v1alpha1/types.go index 372e66fb..5f87949b 100644 --- a/apis/objectstorage.k8s.io/v1alpha1/types.go +++ b/apis/objectstorage.k8s.io/v1alpha1/types.go @@ -23,11 +23,10 @@ import ( func init() { SchemeBuilder.Register(&Bucket{}, &BucketList{}) - SchemeBuilder.Register(&BucketRequest{}, &BucketRequestList{}) + SchemeBuilder.Register(&BucketClaim{}, &BucketClaimList{}) SchemeBuilder.Register(&BucketClass{}, &BucketClassList{}) SchemeBuilder.Register(&BucketAccess{}, &BucketAccessList{}) - SchemeBuilder.Register(&BucketAccessRequest{}, &BucketAccessRequestList{}) SchemeBuilder.Register(&BucketAccessClass{}, &BucketAccessClassList{}) } @@ -65,7 +64,7 @@ type BucketSpec struct { // +optional BucketClassName string `json:"bucketClassName,omitempty"` - BucketRequest *corev1.ObjectReference `json:"bucketRequest,omitempty"` + BucketClaim *corev1.ObjectReference `json:"bucketClaim,omitempty"` // +listType=atomic AllowedNamespaces []string `json:"allowedNamespaces,omitempty"` @@ -110,19 +109,19 @@ type BucketList struct { // +kubebuilder:subresource:status // +kubebuilder:storageversion -type BucketRequest struct { +type BucketClaim struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - Spec BucketRequestSpec `json:"spec,omitempty"` + Spec BucketClaimSpec `json:"spec,omitempty"` // +optional - Status BucketRequestStatus `json:"status,omitempty"` + Status BucketClaimStatus `json:"status,omitempty"` } -type BucketRequestSpec struct { +type BucketClaimSpec struct { // +optional BucketPrefix string `json:"bucketPrefix,omitempty"` @@ -130,7 +129,7 @@ type BucketRequestSpec struct { BucketClassName string `json:"bucketClassName,omitempty"` } -type BucketRequestStatus struct { +type BucketClaimStatus struct { // +optional Message string `json:"message,omitempty"` @@ -143,10 +142,10 @@ type BucketRequestStatus struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type BucketRequestList struct { +type BucketClaimList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []BucketRequest `json:"items"` + Items []BucketClaim `json:"items"` } // +genclient @@ -239,9 +238,6 @@ type BucketAccessSpec struct { // +optional BucketName string `json:"bucketName,omitempty"` - // +optional - BucketAccessRequest *corev1.ObjectReference `json:"bucketAccessRequest,omitempty"` - // +optional ServiceAccount *corev1.ObjectReference `json:"serviceAccount,omitempty"` @@ -272,51 +268,3 @@ type BucketAccessList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []BucketAccess `json:"items"` } - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:scope=Namespaced -// +kubebuilder:storageversion -// +kubebuilder:subresource:status - -type BucketAccessRequest struct { - metav1.TypeMeta `json:",inline"` - - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec BucketAccessRequestSpec `json:"spec,omitempty"` - - // +optional - Status BucketAccessRequestStatus `json:"status"` -} - -type BucketAccessRequestSpec struct { - // +optional - ServiceAccountName string `json:"serviceAccountName,omitempty"` - // +optional - BucketRequestName string `json:"bucketRequestName,omitempty"` - // +optional - BucketName string `json:"bucketName,omitempty"` - - BucketAccessClassName string `json:"bucketAccessClassName"` -} - -type BucketAccessRequestStatus struct { - // +optional - Message string `json:"message,omitempty"` - - // +optional - AccessGranted bool `json:"accessGranted"` - - // +optional - BucketAccessName string `json:"bucketAccessName,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type BucketAccessRequestList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []BucketAccessRequest `json:"items"` -} diff --git a/apis/objectstorage.k8s.io/v1alpha1/zz_generated.deepcopy.go b/apis/objectstorage.k8s.io/v1alpha1/zz_generated.deepcopy.go index 9ea478a4..52aba5b6 100644 --- a/apis/objectstorage.k8s.io/v1alpha1/zz_generated.deepcopy.go +++ b/apis/objectstorage.k8s.io/v1alpha1/zz_generated.deepcopy.go @@ -200,108 +200,10 @@ func (in *BucketAccessList) DeepCopyObject() runtime.Object { } return nil } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BucketAccessRequest) DeepCopyInto(out *BucketAccessRequest) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketAccessRequest. -func (in *BucketAccessRequest) DeepCopy() *BucketAccessRequest { - if in == nil { - return nil - } - out := new(BucketAccessRequest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BucketAccessRequest) 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 *BucketAccessRequestList) DeepCopyInto(out *BucketAccessRequestList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]BucketAccessRequest, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketAccessRequestList. -func (in *BucketAccessRequestList) DeepCopy() *BucketAccessRequestList { - if in == nil { - return nil - } - out := new(BucketAccessRequestList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BucketAccessRequestList) 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 *BucketAccessRequestSpec) DeepCopyInto(out *BucketAccessRequestSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketAccessRequestSpec. -func (in *BucketAccessRequestSpec) DeepCopy() *BucketAccessRequestSpec { - if in == nil { - return nil - } - out := new(BucketAccessRequestSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BucketAccessRequestStatus) DeepCopyInto(out *BucketAccessRequestStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketAccessRequestStatus. -func (in *BucketAccessRequestStatus) DeepCopy() *BucketAccessRequestStatus { - if in == nil { - return nil - } - out := new(BucketAccessRequestStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BucketAccessSpec) DeepCopyInto(out *BucketAccessSpec) { *out = *in - if in.BucketAccessRequest != nil { - in, out := &in.BucketAccessRequest, &out.BucketAccessRequest - *out = new(v1.ObjectReference) - **out = **in - } + if in.ServiceAccount != nil { in, out := &in.ServiceAccount, &out.ServiceAccount *out = new(v1.ObjectReference) @@ -454,7 +356,7 @@ func (in *BucketList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BucketRequest) DeepCopyInto(out *BucketRequest) { +func (in *BucketClaim) DeepCopyInto(out *BucketClaim) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -463,18 +365,18 @@ func (in *BucketRequest) DeepCopyInto(out *BucketRequest) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketRequest. -func (in *BucketRequest) DeepCopy() *BucketRequest { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketClaim. +func (in *BucketClaim) DeepCopy() *BucketClaim { if in == nil { return nil } - out := new(BucketRequest) + out := new(BucketClaim) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BucketRequest) DeepCopyObject() runtime.Object { +func (in *BucketClaim) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -482,13 +384,13 @@ func (in *BucketRequest) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BucketRequestList) DeepCopyInto(out *BucketRequestList) { +func (in *BucketClaimList) DeepCopyInto(out *BucketClaimList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]BucketRequest, len(*in)) + *out = make([]BucketClaim, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -496,18 +398,18 @@ func (in *BucketRequestList) DeepCopyInto(out *BucketRequestList) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketRequestList. -func (in *BucketRequestList) DeepCopy() *BucketRequestList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketClaimList. +func (in *BucketClaimList) DeepCopy() *BucketClaimList { if in == nil { return nil } - out := new(BucketRequestList) + out := new(BucketClaimList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BucketRequestList) DeepCopyObject() runtime.Object { +func (in *BucketClaimList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -515,33 +417,33 @@ func (in *BucketRequestList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BucketRequestSpec) DeepCopyInto(out *BucketRequestSpec) { +func (in *BucketClaimSpec) DeepCopyInto(out *BucketClaimSpec) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketRequestSpec. -func (in *BucketRequestSpec) DeepCopy() *BucketRequestSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketClaimSpec. +func (in *BucketClaimSpec) DeepCopy() *BucketClaimSpec { if in == nil { return nil } - out := new(BucketRequestSpec) + out := new(BucketClaimSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BucketRequestStatus) DeepCopyInto(out *BucketRequestStatus) { +func (in *BucketClaimStatus) DeepCopyInto(out *BucketClaimStatus) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketRequestStatus. -func (in *BucketRequestStatus) DeepCopy() *BucketRequestStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketClaimStatus. +func (in *BucketClaimStatus) DeepCopy() *BucketClaimStatus { if in == nil { return nil } - out := new(BucketRequestStatus) + out := new(BucketClaimStatus) in.DeepCopyInto(out) return out } @@ -549,8 +451,8 @@ func (in *BucketRequestStatus) DeepCopy() *BucketRequestStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BucketSpec) DeepCopyInto(out *BucketSpec) { *out = *in - if in.BucketRequest != nil { - in, out := &in.BucketRequest, &out.BucketRequest + if in.BucketClaim != nil { + in, out := &in.BucketClaim, &out.BucketClaim *out = new(v1.ObjectReference) **out = **in } diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/bucketaccessrequest.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/bucketaccessrequest.go deleted file mode 100644 index 06b9801f..00000000 --- a/clientset/typed/objectstorage.k8s.io/v1alpha1/bucketaccessrequest.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -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" -) - -// BucketAccessRequestsGetter has a method to return a BucketAccessRequestInterface. -// A group's client should implement this interface. -type BucketAccessRequestsGetter interface { - BucketAccessRequests(namespace string) BucketAccessRequestInterface -} - -// BucketAccessRequestInterface has methods to work with BucketAccessRequest resources. -type BucketAccessRequestInterface interface { - Create(ctx context.Context, bucketAccessRequest *v1alpha1.BucketAccessRequest, opts v1.CreateOptions) (*v1alpha1.BucketAccessRequest, error) - Update(ctx context.Context, bucketAccessRequest *v1alpha1.BucketAccessRequest, opts v1.UpdateOptions) (*v1alpha1.BucketAccessRequest, error) - UpdateStatus(ctx context.Context, bucketAccessRequest *v1alpha1.BucketAccessRequest, opts v1.UpdateOptions) (*v1alpha1.BucketAccessRequest, 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.BucketAccessRequest, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BucketAccessRequestList, 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.BucketAccessRequest, err error) - BucketAccessRequestExpansion -} - -// bucketAccessRequests implements BucketAccessRequestInterface -type bucketAccessRequests struct { - client rest.Interface - ns string -} - -// newBucketAccessRequests returns a BucketAccessRequests -func newBucketAccessRequests(c *ObjectstorageV1alpha1Client, namespace string) *bucketAccessRequests { - return &bucketAccessRequests{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the bucketAccessRequest, and returns the corresponding bucketAccessRequest object, and an error if there is any. -func (c *bucketAccessRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketAccessRequest, err error) { - result = &v1alpha1.BucketAccessRequest{} - err = c.client.Get(). - Namespace(c.ns). - Resource("bucketaccessrequests"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BucketAccessRequests that match those selectors. -func (c *bucketAccessRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketAccessRequestList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.BucketAccessRequestList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("bucketaccessrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested bucketAccessRequests. -func (c *bucketAccessRequests) 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("bucketaccessrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a bucketAccessRequest and creates it. Returns the server's representation of the bucketAccessRequest, and an error, if there is any. -func (c *bucketAccessRequests) Create(ctx context.Context, bucketAccessRequest *v1alpha1.BucketAccessRequest, opts v1.CreateOptions) (result *v1alpha1.BucketAccessRequest, err error) { - result = &v1alpha1.BucketAccessRequest{} - err = c.client.Post(). - Namespace(c.ns). - Resource("bucketaccessrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketAccessRequest). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a bucketAccessRequest and updates it. Returns the server's representation of the bucketAccessRequest, and an error, if there is any. -func (c *bucketAccessRequests) Update(ctx context.Context, bucketAccessRequest *v1alpha1.BucketAccessRequest, opts v1.UpdateOptions) (result *v1alpha1.BucketAccessRequest, err error) { - result = &v1alpha1.BucketAccessRequest{} - err = c.client.Put(). - Namespace(c.ns). - Resource("bucketaccessrequests"). - Name(bucketAccessRequest.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketAccessRequest). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *bucketAccessRequests) UpdateStatus(ctx context.Context, bucketAccessRequest *v1alpha1.BucketAccessRequest, opts v1.UpdateOptions) (result *v1alpha1.BucketAccessRequest, err error) { - result = &v1alpha1.BucketAccessRequest{} - err = c.client.Put(). - Namespace(c.ns). - Resource("bucketaccessrequests"). - Name(bucketAccessRequest.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketAccessRequest). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the bucketAccessRequest and deletes it. Returns an error if one occurs. -func (c *bucketAccessRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("bucketaccessrequests"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *bucketAccessRequests) 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("bucketaccessrequests"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched bucketAccessRequest. -func (c *bucketAccessRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketAccessRequest, err error) { - result = &v1alpha1.BucketAccessRequest{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("bucketaccessrequests"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/bucketrequest.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/bucketclaim.go similarity index 50% rename from clientset/typed/objectstorage.k8s.io/v1alpha1/bucketrequest.go rename to clientset/typed/objectstorage.k8s.io/v1alpha1/bucketclaim.go index c8f0d19b..e5e4c000 100644 --- a/clientset/typed/objectstorage.k8s.io/v1alpha1/bucketrequest.go +++ b/clientset/typed/objectstorage.k8s.io/v1alpha1/bucketclaim.go @@ -30,46 +30,46 @@ import ( scheme "sigs.k8s.io/container-object-storage-interface-api/clientset/scheme" ) -// BucketRequestsGetter has a method to return a BucketRequestInterface. +// BucketClaimsGetter has a method to return a BucketClaimInterface. // A group's client should implement this interface. -type BucketRequestsGetter interface { - BucketRequests(namespace string) BucketRequestInterface +type BucketClaimsGetter interface { + BucketClaims(namespace string) BucketClaimInterface } -// BucketRequestInterface has methods to work with BucketRequest resources. -type BucketRequestInterface interface { - Create(ctx context.Context, bucketRequest *v1alpha1.BucketRequest, opts v1.CreateOptions) (*v1alpha1.BucketRequest, error) - Update(ctx context.Context, bucketRequest *v1alpha1.BucketRequest, opts v1.UpdateOptions) (*v1alpha1.BucketRequest, error) - UpdateStatus(ctx context.Context, bucketRequest *v1alpha1.BucketRequest, opts v1.UpdateOptions) (*v1alpha1.BucketRequest, error) +// BucketClaimInterface has methods to work with BucketClaim resources. +type BucketClaimInterface interface { + Create(ctx context.Context, bucketClaim *v1alpha1.BucketClaim, opts v1.CreateOptions) (*v1alpha1.BucketClaim, error) + Update(ctx context.Context, bucketClaim *v1alpha1.BucketClaim, opts v1.UpdateOptions) (*v1alpha1.BucketClaim, error) + UpdateStatus(ctx context.Context, bucketClaim *v1alpha1.BucketClaim, opts v1.UpdateOptions) (*v1alpha1.BucketClaim, 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.BucketRequest, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BucketRequestList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.BucketClaim, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BucketClaimList, 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.BucketRequest, err error) - BucketRequestExpansion + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketClaim, err error) + BucketClaimExpansion } -// bucketRequests implements BucketRequestInterface -type bucketRequests struct { +// bucketClaims implements BucketClaimInterface +type bucketClaims struct { client rest.Interface ns string } -// newBucketRequests returns a BucketRequests -func newBucketRequests(c *ObjectstorageV1alpha1Client, namespace string) *bucketRequests { - return &bucketRequests{ +// newBucketClaims returns a BucketClaims +func newBucketClaims(c *ObjectstorageV1alpha1Client, namespace string) *bucketClaims { + return &bucketClaims{ client: c.RESTClient(), ns: namespace, } } -// Get takes name of the bucketRequest, and returns the corresponding bucketRequest object, and an error if there is any. -func (c *bucketRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketRequest, err error) { - result = &v1alpha1.BucketRequest{} +// Get takes name of the bucketClaim, and returns the corresponding bucketClaim object, and an error if there is any. +func (c *bucketClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketClaim, err error) { + result = &v1alpha1.BucketClaim{} err = c.client.Get(). Namespace(c.ns). - Resource("bucketrequests"). + Resource("bucketclaims"). Name(name). VersionedParams(&options, scheme.ParameterCodec). Do(ctx). @@ -77,16 +77,16 @@ func (c *bucketRequests) Get(ctx context.Context, name string, options v1.GetOpt return } -// List takes label and field selectors, and returns the list of BucketRequests that match those selectors. -func (c *bucketRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketRequestList, err error) { +// List takes label and field selectors, and returns the list of BucketClaims that match those selectors. +func (c *bucketClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketClaimList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.BucketRequestList{} + result = &v1alpha1.BucketClaimList{} err = c.client.Get(). Namespace(c.ns). - Resource("bucketrequests"). + Resource("bucketclaims"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). Do(ctx). @@ -94,8 +94,8 @@ func (c *bucketRequests) List(ctx context.Context, opts v1.ListOptions) (result return } -// Watch returns a watch.Interface that watches the requested bucketRequests. -func (c *bucketRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +// Watch returns a watch.Interface that watches the claimed bucketClaims. +func (c *bucketClaims) 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 @@ -103,34 +103,34 @@ func (c *bucketRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch. opts.Watch = true return c.client.Get(). Namespace(c.ns). - Resource("bucketrequests"). + Resource("bucketclaims"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). Watch(ctx) } -// Create takes the representation of a bucketRequest and creates it. Returns the server's representation of the bucketRequest, and an error, if there is any. -func (c *bucketRequests) Create(ctx context.Context, bucketRequest *v1alpha1.BucketRequest, opts v1.CreateOptions) (result *v1alpha1.BucketRequest, err error) { - result = &v1alpha1.BucketRequest{} +// Create takes the representation of a bucketClaim and creates it. Returns the server's representation of the bucketClaim, and an error, if there is any. +func (c *bucketClaims) Create(ctx context.Context, bucketClaim *v1alpha1.BucketClaim, opts v1.CreateOptions) (result *v1alpha1.BucketClaim, err error) { + result = &v1alpha1.BucketClaim{} err = c.client.Post(). Namespace(c.ns). - Resource("bucketrequests"). + Resource("bucketclaims"). VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketRequest). + Body(bucketClaim). Do(ctx). Into(result) return } -// Update takes the representation of a bucketRequest and updates it. Returns the server's representation of the bucketRequest, and an error, if there is any. -func (c *bucketRequests) Update(ctx context.Context, bucketRequest *v1alpha1.BucketRequest, opts v1.UpdateOptions) (result *v1alpha1.BucketRequest, err error) { - result = &v1alpha1.BucketRequest{} +// Update takes the representation of a bucketClaim and updates it. Returns the server's representation of the bucketClaim, and an error, if there is any. +func (c *bucketClaims) Update(ctx context.Context, bucketClaim *v1alpha1.BucketClaim, opts v1.UpdateOptions) (result *v1alpha1.BucketClaim, err error) { + result = &v1alpha1.BucketClaim{} err = c.client.Put(). Namespace(c.ns). - Resource("bucketrequests"). - Name(bucketRequest.Name). + Resource("bucketclaims"). + Name(bucketClaim.Name). VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketRequest). + Body(bucketClaim). Do(ctx). Into(result) return @@ -138,25 +138,25 @@ func (c *bucketRequests) Update(ctx context.Context, bucketRequest *v1alpha1.Buc // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *bucketRequests) UpdateStatus(ctx context.Context, bucketRequest *v1alpha1.BucketRequest, opts v1.UpdateOptions) (result *v1alpha1.BucketRequest, err error) { - result = &v1alpha1.BucketRequest{} +func (c *bucketClaims) UpdateStatus(ctx context.Context, bucketClaim *v1alpha1.BucketClaim, opts v1.UpdateOptions) (result *v1alpha1.BucketClaim, err error) { + result = &v1alpha1.BucketClaim{} err = c.client.Put(). Namespace(c.ns). - Resource("bucketrequests"). - Name(bucketRequest.Name). + Resource("bucketclaims"). + Name(bucketClaim.Name). SubResource("status"). VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketRequest). + Body(bucketClaim). Do(ctx). Into(result) return } -// Delete takes name of the bucketRequest and deletes it. Returns an error if one occurs. -func (c *bucketRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +// Delete takes name of the bucketClaim and deletes it. Returns an error if one occurs. +func (c *bucketClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). - Resource("bucketrequests"). + Resource("bucketclaims"). Name(name). Body(&opts). Do(ctx). @@ -164,14 +164,14 @@ func (c *bucketRequests) Delete(ctx context.Context, name string, opts v1.Delete } // DeleteCollection deletes a collection of objects. -func (c *bucketRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *bucketClaims) 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("bucketrequests"). + Resource("bucketclaims"). VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). Body(&opts). @@ -179,12 +179,12 @@ func (c *bucketRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOpt Error() } -// Patch applies the patch and returns the patched bucketRequest. -func (c *bucketRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketRequest, err error) { - result = &v1alpha1.BucketRequest{} +// Patch applies the patch and returns the patched bucketClaim. +func (c *bucketClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketClaim, err error) { + result = &v1alpha1.BucketClaim{} err = c.client.Patch(pt). Namespace(c.ns). - Resource("bucketrequests"). + Resource("bucketclaims"). Name(name). SubResource(subresources...). VersionedParams(&opts, scheme.ParameterCodec). diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketaccessrequest.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketaccessrequest.go deleted file mode 100644 index 9497c6a7..00000000 --- a/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketaccessrequest.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -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" -) - -// FakeBucketAccessRequests implements BucketAccessRequestInterface -type FakeBucketAccessRequests struct { - Fake *FakeObjectstorageV1alpha1 - ns string -} - -var bucketaccessrequestsResource = schema.GroupVersionResource{Group: "objectstorage.k8s.io", Version: "v1alpha1", Resource: "bucketaccessrequests"} - -var bucketaccessrequestsKind = schema.GroupVersionKind{Group: "objectstorage.k8s.io", Version: "v1alpha1", Kind: "BucketAccessRequest"} - -// Get takes name of the bucketAccessRequest, and returns the corresponding bucketAccessRequest object, and an error if there is any. -func (c *FakeBucketAccessRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketAccessRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(bucketaccessrequestsResource, c.ns, name), &v1alpha1.BucketAccessRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.BucketAccessRequest), err -} - -// List takes label and field selectors, and returns the list of BucketAccessRequests that match those selectors. -func (c *FakeBucketAccessRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketAccessRequestList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(bucketaccessrequestsResource, bucketaccessrequestsKind, c.ns, opts), &v1alpha1.BucketAccessRequestList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.BucketAccessRequestList{ListMeta: obj.(*v1alpha1.BucketAccessRequestList).ListMeta} - for _, item := range obj.(*v1alpha1.BucketAccessRequestList).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 bucketAccessRequests. -func (c *FakeBucketAccessRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(bucketaccessrequestsResource, c.ns, opts)) - -} - -// Create takes the representation of a bucketAccessRequest and creates it. Returns the server's representation of the bucketAccessRequest, and an error, if there is any. -func (c *FakeBucketAccessRequests) Create(ctx context.Context, bucketAccessRequest *v1alpha1.BucketAccessRequest, opts v1.CreateOptions) (result *v1alpha1.BucketAccessRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(bucketaccessrequestsResource, c.ns, bucketAccessRequest), &v1alpha1.BucketAccessRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.BucketAccessRequest), err -} - -// Update takes the representation of a bucketAccessRequest and updates it. Returns the server's representation of the bucketAccessRequest, and an error, if there is any. -func (c *FakeBucketAccessRequests) Update(ctx context.Context, bucketAccessRequest *v1alpha1.BucketAccessRequest, opts v1.UpdateOptions) (result *v1alpha1.BucketAccessRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(bucketaccessrequestsResource, c.ns, bucketAccessRequest), &v1alpha1.BucketAccessRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.BucketAccessRequest), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBucketAccessRequests) UpdateStatus(ctx context.Context, bucketAccessRequest *v1alpha1.BucketAccessRequest, opts v1.UpdateOptions) (*v1alpha1.BucketAccessRequest, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(bucketaccessrequestsResource, "status", c.ns, bucketAccessRequest), &v1alpha1.BucketAccessRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.BucketAccessRequest), err -} - -// Delete takes name of the bucketAccessRequest and deletes it. Returns an error if one occurs. -func (c *FakeBucketAccessRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(bucketaccessrequestsResource, c.ns, name), &v1alpha1.BucketAccessRequest{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeBucketAccessRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(bucketaccessrequestsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.BucketAccessRequestList{}) - return err -} - -// Patch applies the patch and returns the patched bucketAccessRequest. -func (c *FakeBucketAccessRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketAccessRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(bucketaccessrequestsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BucketAccessRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.BucketAccessRequest), err -} diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketclaim.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketclaim.go new file mode 100644 index 00000000..10fd6bfb --- /dev/null +++ b/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketclaim.go @@ -0,0 +1,142 @@ +/* +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" +) + +// FakeBucketClaims implements BucketClaimInterface +type FakeBucketClaims struct { + Fake *FakeObjectstorageV1alpha1 + ns string +} + +var bucketclaimsResource = schema.GroupVersionResource{Group: "objectstorage.k8s.io", Version: "v1alpha1", Resource: "bucketclaims"} + +var bucketclaimsKind = schema.GroupVersionKind{Group: "objectstorage.k8s.io", Version: "v1alpha1", Kind: "BucketClaim"} + +// Get takes name of the bucketClaim, and returns the corresponding bucketClaim object, and an error if there is any. +func (c *FakeBucketClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketClaim, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(bucketclaimsResource, c.ns, name), &v1alpha1.BucketClaim{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BucketClaim), err +} + +// List takes label and field selectors, and returns the list of BucketClaims that match those selectors. +func (c *FakeBucketClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketClaimList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(bucketclaimsResource, bucketclaimsKind, c.ns, opts), &v1alpha1.BucketClaimList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.BucketClaimList{ListMeta: obj.(*v1alpha1.BucketClaimList).ListMeta} + for _, item := range obj.(*v1alpha1.BucketClaimList).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 claimed bucketClaims. +func (c *FakeBucketClaims) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(bucketclaimsResource, c.ns, opts)) + +} + +// Create takes the representation of a bucketClaim and creates it. Returns the server's representation of the bucketClaim, and an error, if there is any. +func (c *FakeBucketClaims) Create(ctx context.Context, bucketClaim *v1alpha1.BucketClaim, opts v1.CreateOptions) (result *v1alpha1.BucketClaim, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(bucketclaimsResource, c.ns, bucketClaim), &v1alpha1.BucketClaim{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BucketClaim), err +} + +// Update takes the representation of a bucketClaim and updates it. Returns the server's representation of the bucketClaim, and an error, if there is any. +func (c *FakeBucketClaims) Update(ctx context.Context, bucketClaim *v1alpha1.BucketClaim, opts v1.UpdateOptions) (result *v1alpha1.BucketClaim, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(bucketclaimsResource, c.ns, bucketClaim), &v1alpha1.BucketClaim{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BucketClaim), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBucketClaims) UpdateStatus(ctx context.Context, bucketClaim *v1alpha1.BucketClaim, opts v1.UpdateOptions) (*v1alpha1.BucketClaim, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(bucketclaimsResource, "status", c.ns, bucketClaim), &v1alpha1.BucketClaim{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BucketClaim), err +} + +// Delete takes name of the bucketClaim and deletes it. Returns an error if one occurs. +func (c *FakeBucketClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(bucketclaimsResource, c.ns, name), &v1alpha1.BucketClaim{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBucketClaims) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(bucketclaimsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.BucketClaimList{}) + return err +} + +// Patch applies the patch and returns the patched bucketClaim. +func (c *FakeBucketClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketClaim, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(bucketclaimsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BucketClaim{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BucketClaim), err +} diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketrequest.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketrequest.go deleted file mode 100644 index 7571cfdd..00000000 --- a/clientset/typed/objectstorage.k8s.io/v1alpha1/fake/fake_bucketrequest.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -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" -) - -// FakeBucketRequests implements BucketRequestInterface -type FakeBucketRequests struct { - Fake *FakeObjectstorageV1alpha1 - ns string -} - -var bucketrequestsResource = schema.GroupVersionResource{Group: "objectstorage.k8s.io", Version: "v1alpha1", Resource: "bucketrequests"} - -var bucketrequestsKind = schema.GroupVersionKind{Group: "objectstorage.k8s.io", Version: "v1alpha1", Kind: "BucketRequest"} - -// Get takes name of the bucketRequest, and returns the corresponding bucketRequest object, and an error if there is any. -func (c *FakeBucketRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(bucketrequestsResource, c.ns, name), &v1alpha1.BucketRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.BucketRequest), err -} - -// List takes label and field selectors, and returns the list of BucketRequests that match those selectors. -func (c *FakeBucketRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketRequestList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(bucketrequestsResource, bucketrequestsKind, c.ns, opts), &v1alpha1.BucketRequestList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.BucketRequestList{ListMeta: obj.(*v1alpha1.BucketRequestList).ListMeta} - for _, item := range obj.(*v1alpha1.BucketRequestList).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 bucketRequests. -func (c *FakeBucketRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(bucketrequestsResource, c.ns, opts)) - -} - -// Create takes the representation of a bucketRequest and creates it. Returns the server's representation of the bucketRequest, and an error, if there is any. -func (c *FakeBucketRequests) Create(ctx context.Context, bucketRequest *v1alpha1.BucketRequest, opts v1.CreateOptions) (result *v1alpha1.BucketRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(bucketrequestsResource, c.ns, bucketRequest), &v1alpha1.BucketRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.BucketRequest), err -} - -// Update takes the representation of a bucketRequest and updates it. Returns the server's representation of the bucketRequest, and an error, if there is any. -func (c *FakeBucketRequests) Update(ctx context.Context, bucketRequest *v1alpha1.BucketRequest, opts v1.UpdateOptions) (result *v1alpha1.BucketRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(bucketrequestsResource, c.ns, bucketRequest), &v1alpha1.BucketRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.BucketRequest), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBucketRequests) UpdateStatus(ctx context.Context, bucketRequest *v1alpha1.BucketRequest, opts v1.UpdateOptions) (*v1alpha1.BucketRequest, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(bucketrequestsResource, "status", c.ns, bucketRequest), &v1alpha1.BucketRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.BucketRequest), err -} - -// Delete takes name of the bucketRequest and deletes it. Returns an error if one occurs. -func (c *FakeBucketRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(bucketrequestsResource, c.ns, name), &v1alpha1.BucketRequest{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeBucketRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(bucketrequestsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.BucketRequestList{}) - return err -} - -// Patch applies the patch and returns the patched bucketRequest. -func (c *FakeBucketRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(bucketrequestsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BucketRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.BucketRequest), 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..eb0c658b 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,16 +40,12 @@ func (c *FakeObjectstorageV1alpha1) BucketAccessClasses() v1alpha1.BucketAccessC return &FakeBucketAccessClasses{c} } -func (c *FakeObjectstorageV1alpha1) BucketAccessRequests(namespace string) v1alpha1.BucketAccessRequestInterface { - return &FakeBucketAccessRequests{c, namespace} -} - func (c *FakeObjectstorageV1alpha1) BucketClasses() v1alpha1.BucketClassInterface { return &FakeBucketClasses{c} } -func (c *FakeObjectstorageV1alpha1) BucketRequests(namespace string) v1alpha1.BucketRequestInterface { - return &FakeBucketRequests{c, namespace} +func (c *FakeObjectstorageV1alpha1) BucketClaims(namespace string) v1alpha1.BucketClaimInterface { + return &FakeBucketClaims{c, namespace} } // RESTClient returns a RESTClient that is used to communicate diff --git a/clientset/typed/objectstorage.k8s.io/v1alpha1/generated_expansion.go b/clientset/typed/objectstorage.k8s.io/v1alpha1/generated_expansion.go index 7b9057e3..b72b5cff 100644 --- a/clientset/typed/objectstorage.k8s.io/v1alpha1/generated_expansion.go +++ b/clientset/typed/objectstorage.k8s.io/v1alpha1/generated_expansion.go @@ -24,8 +24,6 @@ type BucketAccessExpansion interface{} type BucketAccessClassExpansion interface{} -type BucketAccessRequestExpansion interface{} - type BucketClassExpansion interface{} -type BucketRequestExpansion interface{} +type BucketClaimExpansion 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..2a7471e3 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,9 +29,8 @@ type ObjectstorageV1alpha1Interface interface { BucketsGetter BucketAccessesGetter BucketAccessClassesGetter - BucketAccessRequestsGetter BucketClassesGetter - BucketRequestsGetter + BucketClaimsGetter } // ObjectstorageV1alpha1Client is used to interact with features provided by the objectstorage.k8s.io group. @@ -51,16 +50,12 @@ func (c *ObjectstorageV1alpha1Client) BucketAccessClasses() BucketAccessClassInt return newBucketAccessClasses(c) } -func (c *ObjectstorageV1alpha1Client) BucketAccessRequests(namespace string) BucketAccessRequestInterface { - return newBucketAccessRequests(c, namespace) -} - func (c *ObjectstorageV1alpha1Client) BucketClasses() BucketClassInterface { return newBucketClasses(c) } -func (c *ObjectstorageV1alpha1Client) BucketRequests(namespace string) BucketRequestInterface { - return newBucketRequests(c, namespace) +func (c *ObjectstorageV1alpha1Client) BucketClaims(namespace string) BucketClaimInterface { + return newBucketClaims(c, namespace) } // NewForConfig creates a new ObjectstorageV1alpha1Client for the given config. diff --git a/controller/controller.go b/controller/controller.go index 85220e66..f98b52d1 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -88,9 +88,8 @@ type ObjectStorageController struct { // Listeners BucketListener BucketListener - BucketRequestListener BucketRequestListener + BucketClaimListener BucketClaimListener BucketAccessListener BucketAccessListener - BucketAccessRequestListener BucketAccessRequestListener // leader election leaderLock string @@ -433,19 +432,19 @@ func (c *ObjectStorageController) runController(ctx context.Context) { } go controllerFor("Buckets", &v1alpha1.Bucket{}, addFunc, updateFunc, deleteFunc) } - if c.BucketRequestListener != nil { - c.BucketRequestListener.InitializeKubeClient(c.kubeClient) - c.BucketRequestListener.InitializeBucketClient(c.bucketClient) + if c.BucketClaimListener != nil { + c.BucketClaimListener.InitializeKubeClient(c.kubeClient) + c.BucketClaimListener.InitializeBucketClient(c.bucketClient) addFunc := func(ctx context.Context, obj interface{}) error { - return c.BucketRequestListener.Add(ctx, obj.(*v1alpha1.BucketRequest)) + return c.BucketClaimListener.Add(ctx, obj.(*v1alpha1.BucketClaim)) } updateFunc := func(ctx context.Context, old interface{}, new interface{}) error { - return c.BucketRequestListener.Update(ctx, old.(*v1alpha1.BucketRequest), new.(*v1alpha1.BucketRequest)) + return c.BucketClaimListener.Update(ctx, old.(*v1alpha1.BucketClaim), new.(*v1alpha1.BucketClaim)) } deleteFunc := func(ctx context.Context, obj interface{}) error { - return c.BucketRequestListener.Delete(ctx, obj.(*v1alpha1.BucketRequest)) + return c.BucketClaimListener.Delete(ctx, obj.(*v1alpha1.BucketClaim)) } - go controllerFor("BucketRequests", &v1alpha1.BucketRequest{}, addFunc, updateFunc, deleteFunc) + go controllerFor("BucketClaims", &v1alpha1.BucketClaim{}, addFunc, updateFunc, deleteFunc) } if c.BucketAccessListener != nil { c.BucketAccessListener.InitializeKubeClient(c.kubeClient) @@ -461,20 +460,6 @@ func (c *ObjectStorageController) runController(ctx context.Context) { } go controllerFor("BucketAccesses", &v1alpha1.BucketAccess{}, addFunc, updateFunc, deleteFunc) } - if c.BucketAccessRequestListener != nil { - c.BucketAccessRequestListener.InitializeKubeClient(c.kubeClient) - c.BucketAccessRequestListener.InitializeBucketClient(c.bucketClient) - addFunc := func(ctx context.Context, obj interface{}) error { - return c.BucketAccessRequestListener.Add(ctx, obj.(*v1alpha1.BucketAccessRequest)) - } - updateFunc := func(ctx context.Context, old interface{}, new interface{}) error { - return c.BucketAccessRequestListener.Update(ctx, old.(*v1alpha1.BucketAccessRequest), new.(*v1alpha1.BucketAccessRequest)) - } - deleteFunc := func(ctx context.Context, obj interface{}) error { - return c.BucketAccessRequestListener.Delete(ctx, obj.(*v1alpha1.BucketAccessRequest)) - } - go controllerFor("BucketAccessRequests", &v1alpha1.BucketAccessRequest{}, addFunc, updateFunc, deleteFunc) - } <-ctx.Done() } diff --git a/controller/interfaces.go b/controller/interfaces.go index a2e56773..9bb6108c 100644 --- a/controller/interfaces.go +++ b/controller/interfaces.go @@ -30,17 +30,17 @@ func (c *ObjectStorageController) AddBucketListener(b BucketListener) { c.BucketListener = b } -type BucketRequestListener interface { +type BucketClaimListener interface { GenericListener - Add(ctx context.Context, b *v1alpha1.BucketRequest) error - Update(ctx context.Context, old *v1alpha1.BucketRequest, new *v1alpha1.BucketRequest) error - Delete(ctx context.Context, b *v1alpha1.BucketRequest) error + Add(ctx context.Context, b *v1alpha1.BucketClaim) error + Update(ctx context.Context, old *v1alpha1.BucketClaim, new *v1alpha1.BucketClaim) error + Delete(ctx context.Context, b *v1alpha1.BucketClaim) error } -func (c *ObjectStorageController) AddBucketRequestListener(b BucketRequestListener) { +func (c *ObjectStorageController) AddBucketClaimListener(b BucketClaimListener) { c.initialized = true - c.BucketRequestListener = b + c.BucketClaimListener = b } type BucketAccessListener interface { @@ -55,16 +55,3 @@ func (c *ObjectStorageController) AddBucketAccessListener(b BucketAccessListener c.initialized = true c.BucketAccessListener = b } - -type BucketAccessRequestListener interface { - GenericListener - - Add(ctx context.Context, b *v1alpha1.BucketAccessRequest) error - Update(ctx context.Context, old *v1alpha1.BucketAccessRequest, new *v1alpha1.BucketAccessRequest) error - Delete(ctx context.Context, b *v1alpha1.BucketAccessRequest) error -} - -func (c *ObjectStorageController) AddBucketAccessRequestListener(b BucketAccessRequestListener) { - c.initialized = true - c.BucketAccessRequestListener = b -} diff --git a/crds/objectstorage.k8s.io_bucketaccessclasses.yaml b/crds/objectstorage.k8s.io_bucketaccessclasses.yaml index 4fd63c15..18de5b5d 100644 --- a/crds/objectstorage.k8s.io_bucketaccessclasses.yaml +++ b/crds/objectstorage.k8s.io_bucketaccessclasses.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.5.0 + controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null name: bucketaccessclasses.objectstorage.k8s.io spec: @@ -21,10 +21,14 @@ spec: 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' + 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 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' + 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 @@ -33,13 +37,43 @@ spec: 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 .' + 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.' + 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' @@ -51,7 +85,8 @@ spec: 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' + 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' diff --git a/crds/objectstorage.k8s.io_bucketaccesses.yaml b/crds/objectstorage.k8s.io_bucketaccesses.yaml index ee6d9c75..3b402de5 100644 --- a/crds/objectstorage.k8s.io_bucketaccesses.yaml +++ b/crds/objectstorage.k8s.io_bucketaccesses.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.5.0 + controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null name: bucketaccesses.objectstorage.k8s.io spec: @@ -21,40 +21,19 @@ spec: 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' + 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 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' + 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 spec: properties: - bucketAccessRequest: - 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 bucketName: type: string parameters: @@ -64,13 +43,46 @@ spec: 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 .' + 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.' + 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' @@ -82,7 +94,8 @@ spec: 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' + 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' @@ -98,13 +111,16 @@ spec: message: type: string mintedSecret: - description: SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace + description: SecretReference represents a Secret Reference. It has + enough information to retrieve secret in any namespace properties: name: - description: Name is unique within a namespace to reference a secret resource. + description: Name is unique within a namespace to reference a + secret resource. type: string namespace: - description: Namespace defines the space within which the secret name must be unique. + description: Namespace defines the space within which the secret + name must be unique. type: string type: object type: object diff --git a/crds/objectstorage.k8s.io_bucketaccessrequests.yaml b/crds/objectstorage.k8s.io_bucketaccessrequests.yaml deleted file mode 100644 index 4528c482..00000000 --- a/crds/objectstorage.k8s.io_bucketaccessrequests.yaml +++ /dev/null @@ -1,63 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.5.0 - creationTimestamp: null - name: bucketaccessrequests.objectstorage.k8s.io -spec: - group: objectstorage.k8s.io - names: - kind: BucketAccessRequest - listKind: BucketAccessRequestList - plural: bucketaccessrequests - singular: bucketaccessrequest - 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 - 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 - spec: - properties: - bucketAccessClassName: - type: string - bucketName: - type: string - bucketRequestName: - type: string - serviceAccountName: - type: string - required: - - bucketAccessClassName - type: object - status: - properties: - accessGranted: - type: boolean - bucketAccessName: - type: string - message: - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/crds/objectstorage.k8s.io_bucketrequests.yaml b/crds/objectstorage.k8s.io_bucketclaims.yaml similarity index 59% rename from crds/objectstorage.k8s.io_bucketrequests.yaml rename to crds/objectstorage.k8s.io_bucketclaims.yaml index d0d0b915..98158fee 100644 --- a/crds/objectstorage.k8s.io_bucketrequests.yaml +++ b/crds/objectstorage.k8s.io_bucketclaims.yaml @@ -4,16 +4,16 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.5.0 + controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null - name: bucketrequests.objectstorage.k8s.io + name: bucketclaims.objectstorage.k8s.io spec: group: objectstorage.k8s.io names: - kind: BucketRequest - listKind: BucketRequestList - plural: bucketrequests - singular: bucketrequest + kind: BucketClaim + listKind: BucketClaimList + plural: bucketclaims + singular: bucketclaim scope: Namespaced versions: - name: v1alpha1 @@ -21,10 +21,14 @@ spec: 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' + 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 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' + 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 diff --git a/crds/objectstorage.k8s.io_bucketclasses.yaml b/crds/objectstorage.k8s.io_bucketclasses.yaml index f62a34de..5687d085 100644 --- a/crds/objectstorage.k8s.io_bucketclasses.yaml +++ b/crds/objectstorage.k8s.io_bucketclasses.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.5.0 + controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null name: bucketclasses.objectstorage.k8s.io spec: @@ -26,7 +26,9 @@ spec: type: array x-kubernetes-list-type: atomic 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' + 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 deletionPolicy: default: retain @@ -35,7 +37,9 @@ spec: default: false type: boolean 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' + 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 diff --git a/crds/objectstorage.k8s.io_buckets.yaml b/crds/objectstorage.k8s.io_buckets.yaml index d953e9c2..a93380a2 100644 --- a/crds/objectstorage.k8s.io_buckets.yaml +++ b/crds/objectstorage.k8s.io_buckets.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.5.0 + controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null name: buckets.objectstorage.k8s.io spec: @@ -21,10 +21,14 @@ spec: 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' + 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 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' + 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 @@ -35,19 +39,47 @@ spec: type: string type: array x-kubernetes-list-type: atomic - bucketClassName: - type: string - bucketID: - description: BucketID is used for brownfield creation of buckets - type: string - bucketRequest: - 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 .' + bucketClaim: + 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.' + 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' @@ -59,12 +91,18 @@ spec: 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' + 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 + bucketClassName: + type: string + bucketID: + description: BucketID is used for brownfield creation of buckets + type: string deletionPolicy: default: retain type: string @@ -110,7 +148,9 @@ spec: bucketAvailable: type: boolean bucketID: - description: BucketID is either filled in based on the brown name of the bucket, or it is dynamic filled based on the newly provisioned bucket + description: BucketID is either filled in based on the brown name + of the bucket, or it is dynamic filled based on the newly provisioned + bucket type: string message: type: string diff --git a/informers/externalversions/generic.go b/informers/externalversions/generic.go index be22d3f0..7aa08cde 100644 --- a/informers/externalversions/generic.go +++ b/informers/externalversions/generic.go @@ -59,12 +59,10 @@ 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("bucketaccessrequests"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Objectstorage().V1alpha1().BucketAccessRequests().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("bucketclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Objectstorage().V1alpha1().BucketClasses().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("bucketrequests"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Objectstorage().V1alpha1().BucketRequests().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("bucketclaims"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Objectstorage().V1alpha1().BucketClaims().Informer()}, nil } diff --git a/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketaccessrequest.go b/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketclaim.go similarity index 57% rename from informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketaccessrequest.go rename to informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketclaim.go index 2c74196b..9ba5e0a6 100644 --- a/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketaccessrequest.go +++ b/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketclaim.go @@ -32,59 +32,59 @@ import ( v1alpha1 "sigs.k8s.io/container-object-storage-interface-api/listers/objectstorage.k8s.io/v1alpha1" ) -// BucketAccessRequestInformer provides access to a shared informer and lister for -// BucketAccessRequests. -type BucketAccessRequestInformer interface { +// BucketClaimInformer provides access to a shared informer and lister for +// BucketClaims. +type BucketClaimInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.BucketAccessRequestLister + Lister() v1alpha1.BucketClaimLister } -type bucketAccessRequestInformer struct { +type bucketClaimInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewBucketAccessRequestInformer constructs a new informer for BucketAccessRequest type. +// NewBucketClaimInformer constructs a new informer for BucketClaim 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 NewBucketAccessRequestInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredBucketAccessRequestInformer(client, namespace, resyncPeriod, indexers, nil) +func NewBucketClaimInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBucketClaimInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredBucketAccessRequestInformer constructs a new informer for BucketAccessRequest type. +// NewFilteredBucketClaimInformer constructs a new informer for BucketClaim 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 NewFilteredBucketAccessRequestInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredBucketClaimInformer(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().BucketAccessRequests(namespace).List(context.TODO(), options) + return client.ObjectstorageV1alpha1().BucketClaims(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ObjectstorageV1alpha1().BucketAccessRequests(namespace).Watch(context.TODO(), options) + return client.ObjectstorageV1alpha1().BucketClaims(namespace).Watch(context.TODO(), options) }, }, - &objectstoragek8siov1alpha1.BucketAccessRequest{}, + &objectstoragek8siov1alpha1.BucketClaim{}, resyncPeriod, indexers, ) } -func (f *bucketAccessRequestInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredBucketAccessRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *bucketClaimInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBucketClaimInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *bucketAccessRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&objectstoragek8siov1alpha1.BucketAccessRequest{}, f.defaultInformer) +func (f *bucketClaimInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&objectstoragek8siov1alpha1.BucketClaim{}, f.defaultInformer) } -func (f *bucketAccessRequestInformer) Lister() v1alpha1.BucketAccessRequestLister { - return v1alpha1.NewBucketAccessRequestLister(f.Informer().GetIndexer()) +func (f *bucketClaimInformer) Lister() v1alpha1.BucketClaimLister { + return v1alpha1.NewBucketClaimLister(f.Informer().GetIndexer()) } diff --git a/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketrequest.go b/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketrequest.go index 7d8b07d7..9ba5e0a6 100644 --- a/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketrequest.go +++ b/informers/externalversions/objectstorage.k8s.io/v1alpha1/bucketrequest.go @@ -32,59 +32,59 @@ import ( v1alpha1 "sigs.k8s.io/container-object-storage-interface-api/listers/objectstorage.k8s.io/v1alpha1" ) -// BucketRequestInformer provides access to a shared informer and lister for -// BucketRequests. -type BucketRequestInformer interface { +// BucketClaimInformer provides access to a shared informer and lister for +// BucketClaims. +type BucketClaimInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.BucketRequestLister + Lister() v1alpha1.BucketClaimLister } -type bucketRequestInformer struct { +type bucketClaimInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewBucketRequestInformer constructs a new informer for BucketRequest type. +// NewBucketClaimInformer constructs a new informer for BucketClaim 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 NewBucketRequestInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredBucketRequestInformer(client, namespace, resyncPeriod, indexers, nil) +func NewBucketClaimInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBucketClaimInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredBucketRequestInformer constructs a new informer for BucketRequest type. +// NewFilteredBucketClaimInformer constructs a new informer for BucketClaim 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 NewFilteredBucketRequestInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredBucketClaimInformer(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().BucketRequests(namespace).List(context.TODO(), options) + return client.ObjectstorageV1alpha1().BucketClaims(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ObjectstorageV1alpha1().BucketRequests(namespace).Watch(context.TODO(), options) + return client.ObjectstorageV1alpha1().BucketClaims(namespace).Watch(context.TODO(), options) }, }, - &objectstoragek8siov1alpha1.BucketRequest{}, + &objectstoragek8siov1alpha1.BucketClaim{}, resyncPeriod, indexers, ) } -func (f *bucketRequestInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredBucketRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *bucketClaimInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBucketClaimInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *bucketRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&objectstoragek8siov1alpha1.BucketRequest{}, f.defaultInformer) +func (f *bucketClaimInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&objectstoragek8siov1alpha1.BucketClaim{}, f.defaultInformer) } -func (f *bucketRequestInformer) Lister() v1alpha1.BucketRequestLister { - return v1alpha1.NewBucketRequestLister(f.Informer().GetIndexer()) +func (f *bucketClaimInformer) Lister() v1alpha1.BucketClaimLister { + return v1alpha1.NewBucketClaimLister(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..12635f3c 100644 --- a/informers/externalversions/objectstorage.k8s.io/v1alpha1/interface.go +++ b/informers/externalversions/objectstorage.k8s.io/v1alpha1/interface.go @@ -30,12 +30,10 @@ type Interface interface { BucketAccesses() BucketAccessInformer // BucketAccessClasses returns a BucketAccessClassInformer. BucketAccessClasses() BucketAccessClassInformer - // BucketAccessRequests returns a BucketAccessRequestInformer. - BucketAccessRequests() BucketAccessRequestInformer // BucketClasses returns a BucketClassInformer. BucketClasses() BucketClassInformer - // BucketRequests returns a BucketRequestInformer. - BucketRequests() BucketRequestInformer + // BucketClaims returns a BucketClaimInformer. + BucketClaims() BucketClaimInformer } type version struct { @@ -64,17 +62,12 @@ func (v *version) BucketAccessClasses() BucketAccessClassInformer { return &bucketAccessClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// BucketAccessRequests returns a BucketAccessRequestInformer. -func (v *version) BucketAccessRequests() BucketAccessRequestInformer { - return &bucketAccessRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // BucketClasses returns a BucketClassInformer. func (v *version) BucketClasses() BucketClassInformer { return &bucketClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// BucketRequests returns a BucketRequestInformer. -func (v *version) BucketRequests() BucketRequestInformer { - return &bucketRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +// BucketClaims returns a BucketClaimInformer. +func (v *version) BucketClaims() BucketClaimInformer { + return &bucketClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/kustomization.yaml b/kustomization.yaml index 230a69ee..d9ef0391 100644 --- a/kustomization.yaml +++ b/kustomization.yaml @@ -13,7 +13,6 @@ commonAnnotations: resources: - crds/objectstorage.k8s.io_bucketaccesses.yaml - crds/objectstorage.k8s.io_bucketaccessclasses.yaml -- crds/objectstorage.k8s.io_bucketaccessrequests.yaml - crds/objectstorage.k8s.io_bucketclasses.yaml -- crds/objectstorage.k8s.io_bucketrequests.yaml +- crds/objectstorage.k8s.io_bucketclaims.yaml - crds/objectstorage.k8s.io_buckets.yaml diff --git a/listers/objectstorage.k8s.io/v1alpha1/bucketaccessrequest.go b/listers/objectstorage.k8s.io/v1alpha1/bucketaccessrequest.go deleted file mode 100644 index a1b11add..00000000 --- a/listers/objectstorage.k8s.io/v1alpha1/bucketaccessrequest.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -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" -) - -// BucketAccessRequestLister helps list BucketAccessRequests. -type BucketAccessRequestLister interface { - // List lists all BucketAccessRequests in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.BucketAccessRequest, err error) - // BucketAccessRequests returns an object that can list and get BucketAccessRequests. - BucketAccessRequests(namespace string) BucketAccessRequestNamespaceLister - BucketAccessRequestListerExpansion -} - -// bucketAccessRequestLister implements the BucketAccessRequestLister interface. -type bucketAccessRequestLister struct { - indexer cache.Indexer -} - -// NewBucketAccessRequestLister returns a new BucketAccessRequestLister. -func NewBucketAccessRequestLister(indexer cache.Indexer) BucketAccessRequestLister { - return &bucketAccessRequestLister{indexer: indexer} -} - -// List lists all BucketAccessRequests in the indexer. -func (s *bucketAccessRequestLister) List(selector labels.Selector) (ret []*v1alpha1.BucketAccessRequest, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.BucketAccessRequest)) - }) - return ret, err -} - -// BucketAccessRequests returns an object that can list and get BucketAccessRequests. -func (s *bucketAccessRequestLister) BucketAccessRequests(namespace string) BucketAccessRequestNamespaceLister { - return bucketAccessRequestNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// BucketAccessRequestNamespaceLister helps list and get BucketAccessRequests. -type BucketAccessRequestNamespaceLister interface { - // List lists all BucketAccessRequests in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.BucketAccessRequest, err error) - // Get retrieves the BucketAccessRequest from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.BucketAccessRequest, error) - BucketAccessRequestNamespaceListerExpansion -} - -// bucketAccessRequestNamespaceLister implements the BucketAccessRequestNamespaceLister -// interface. -type bucketAccessRequestNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all BucketAccessRequests in the indexer for a given namespace. -func (s bucketAccessRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.BucketAccessRequest, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.BucketAccessRequest)) - }) - return ret, err -} - -// Get retrieves the BucketAccessRequest from the indexer for a given namespace and name. -func (s bucketAccessRequestNamespaceLister) Get(name string) (*v1alpha1.BucketAccessRequest, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("bucketaccessrequest"), name) - } - return obj.(*v1alpha1.BucketAccessRequest), nil -} diff --git a/listers/objectstorage.k8s.io/v1alpha1/bucketclaim.go b/listers/objectstorage.k8s.io/v1alpha1/bucketclaim.go new file mode 100644 index 00000000..bf772da3 --- /dev/null +++ b/listers/objectstorage.k8s.io/v1alpha1/bucketclaim.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" +) + +// BucketClaimLister helps list BucketClaims. +type BucketClaimLister interface { + // List lists all BucketClaims in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.BucketClaim, err error) + // BucketClaims returns an object that can list and get BucketClaims. + BucketClaims(namespace string) BucketClaimNamespaceLister + BucketClaimListerExpansion +} + +// bucketClaimLister implements the BucketClaimLister interface. +type bucketClaimLister struct { + indexer cache.Indexer +} + +// NewBucketClaimLister returns a new BucketClaimLister. +func NewBucketClaimLister(indexer cache.Indexer) BucketClaimLister { + return &bucketClaimLister{indexer: indexer} +} + +// List lists all BucketClaims in the indexer. +func (s *bucketClaimLister) List(selector labels.Selector) (ret []*v1alpha1.BucketClaim, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.BucketClaim)) + }) + return ret, err +} + +// BucketClaims returns an object that can list and get BucketClaims. +func (s *bucketClaimLister) BucketClaims(namespace string) BucketClaimNamespaceLister { + return bucketClaimNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// BucketClaimNamespaceLister helps list and get BucketClaims. +type BucketClaimNamespaceLister interface { + // List lists all BucketClaims in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.BucketClaim, err error) + // Get retrieves the BucketClaim from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.BucketClaim, error) + BucketClaimNamespaceListerExpansion +} + +// bucketClaimNamespaceLister implements the BucketClaimNamespaceLister +// interface. +type bucketClaimNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all BucketClaims in the indexer for a given namespace. +func (s bucketClaimNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.BucketClaim, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.BucketClaim)) + }) + return ret, err +} + +// Get retrieves the BucketClaim from the indexer for a given namespace and name. +func (s bucketClaimNamespaceLister) Get(name string) (*v1alpha1.BucketClaim, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("bucketclaim"), name) + } + return obj.(*v1alpha1.BucketClaim), nil +} diff --git a/listers/objectstorage.k8s.io/v1alpha1/bucketrequest.go b/listers/objectstorage.k8s.io/v1alpha1/bucketrequest.go deleted file mode 100644 index b14298db..00000000 --- a/listers/objectstorage.k8s.io/v1alpha1/bucketrequest.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -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" -) - -// BucketRequestLister helps list BucketRequests. -type BucketRequestLister interface { - // List lists all BucketRequests in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.BucketRequest, err error) - // BucketRequests returns an object that can list and get BucketRequests. - BucketRequests(namespace string) BucketRequestNamespaceLister - BucketRequestListerExpansion -} - -// bucketRequestLister implements the BucketRequestLister interface. -type bucketRequestLister struct { - indexer cache.Indexer -} - -// NewBucketRequestLister returns a new BucketRequestLister. -func NewBucketRequestLister(indexer cache.Indexer) BucketRequestLister { - return &bucketRequestLister{indexer: indexer} -} - -// List lists all BucketRequests in the indexer. -func (s *bucketRequestLister) List(selector labels.Selector) (ret []*v1alpha1.BucketRequest, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.BucketRequest)) - }) - return ret, err -} - -// BucketRequests returns an object that can list and get BucketRequests. -func (s *bucketRequestLister) BucketRequests(namespace string) BucketRequestNamespaceLister { - return bucketRequestNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// BucketRequestNamespaceLister helps list and get BucketRequests. -type BucketRequestNamespaceLister interface { - // List lists all BucketRequests in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.BucketRequest, err error) - // Get retrieves the BucketRequest from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.BucketRequest, error) - BucketRequestNamespaceListerExpansion -} - -// bucketRequestNamespaceLister implements the BucketRequestNamespaceLister -// interface. -type bucketRequestNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all BucketRequests in the indexer for a given namespace. -func (s bucketRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.BucketRequest, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.BucketRequest)) - }) - return ret, err -} - -// Get retrieves the BucketRequest from the indexer for a given namespace and name. -func (s bucketRequestNamespaceLister) Get(name string) (*v1alpha1.BucketRequest, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("bucketrequest"), name) - } - return obj.(*v1alpha1.BucketRequest), nil -} diff --git a/listers/objectstorage.k8s.io/v1alpha1/expansion_generated.go b/listers/objectstorage.k8s.io/v1alpha1/expansion_generated.go index b90e4eee..6748af44 100644 --- a/listers/objectstorage.k8s.io/v1alpha1/expansion_generated.go +++ b/listers/objectstorage.k8s.io/v1alpha1/expansion_generated.go @@ -30,22 +30,14 @@ type BucketAccessListerExpansion interface{} // BucketAccessClassLister. type BucketAccessClassListerExpansion interface{} -// BucketAccessRequestListerExpansion allows custom methods to be added to -// BucketAccessRequestLister. -type BucketAccessRequestListerExpansion interface{} - -// BucketAccessRequestNamespaceListerExpansion allows custom methods to be added to -// BucketAccessRequestNamespaceLister. -type BucketAccessRequestNamespaceListerExpansion interface{} - // BucketClassListerExpansion allows custom methods to be added to // BucketClassLister. type BucketClassListerExpansion interface{} -// BucketRequestListerExpansion allows custom methods to be added to -// BucketRequestLister. -type BucketRequestListerExpansion interface{} +// BucketClaimListerExpansion allows custom methods to be added to +// BucketClaimLister. +type BucketClaimListerExpansion interface{} -// BucketRequestNamespaceListerExpansion allows custom methods to be added to -// BucketRequestNamespaceLister. -type BucketRequestNamespaceListerExpansion interface{} +// BucketClaimNamespaceListerExpansion allows custom methods to be added to +// BucketClaimNamespaceLister. +type BucketClaimNamespaceListerExpansion interface{}