Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

fix(deletionPolicy): wrong case #65

Merged
merged 2 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions apis/objectstorage/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func init() {
type DeletionPolicy string

const (
DeletionPolicyRetain DeletionPolicy = "Retain"
DeletionPolicyDelete DeletionPolicy = "Delete"
DeletionPolicyRetain DeletionPolicy = "Retain"
DeletionPolicyDelete DeletionPolicy = "Delete"
)

type Protocol string
Expand All @@ -60,8 +60,8 @@ const (
// +kubebuilder:subresource:status
type Bucket struct {
metav1.TypeMeta `json:",inline"`
// +optional

// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec BucketSpec `json:"spec,omitempty"`
Expand All @@ -77,7 +77,7 @@ type BucketSpec struct {
// Name of the BucketClass specified in the BucketRequest
BucketClassName string `json:"bucketClassName"`

// Name of the BucketClaim that resulted in the creation of this Bucket
// Name of the BucketClaim that resulted in the creation of this Bucket
// In case the Bucket object was created manually, then this should refer
// to the BucketClaim with which this Bucket should be bound
BucketClaim *corev1.ObjectReference `json:"bucketClaim"`
Expand All @@ -98,7 +98,7 @@ type BucketSpec struct {
// - Delete: Indicates that the bucket should be deleted from the OSP
// once all the workloads accessing this bucket are done
// +optional
// +kubebuilder:default:=retain
// +kubebuilder:default:=Retain
DeletionPolicy DeletionPolicy `json:"deletionPolicy"`

// ExistingBucketID is the unique id of the bucket in the OSP. This field should be
Expand All @@ -120,7 +120,6 @@ type BucketStatus struct {
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type BucketList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand All @@ -134,8 +133,8 @@ type BucketList struct {
// +kubebuilder:storageversion
type BucketClaim struct {
metav1.TypeMeta `json:",inline"`
// +optional

// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec BucketClaimSpec `json:"spec,omitempty"`
Expand Down Expand Up @@ -168,14 +167,13 @@ type BucketClaimStatus struct {
BucketReady bool `json:"bucketReady"`

// BucketName is the name of the provisioned Bucket in response
// to this BucketClaim. It is generated and set by the COSI controller
// to this BucketClaim. It is generated and set by the COSI controller
// before making the creation request to the OSP backend.
// +optional
BucketName string `json:"bucketName,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type BucketClaimList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand All @@ -202,7 +200,7 @@ type BucketClass struct {
// - Retain: Indicates that the bucket should not be deleted from the OSP
// - Delete: Indicates that the bucket should be deleted from the OSP
// once all the workloads accessing this bucket are done
// +kubebuilder:default:=retain
// +kubebuilder:default:=Retain
DeletionPolicy DeletionPolicy `json:"deletionPolicy"`

// Parameters is an opaque map for passing in configuration to a driver
Expand All @@ -212,7 +210,6 @@ type BucketClass struct {
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type BucketClassList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand All @@ -237,7 +234,7 @@ type BucketAccessClass struct {

// AuthenticationType denotes the style of authentication
// It can be one of
// KEY - access, secret tokens based authentication
// Key - access, secret tokens based authentication
// IAM - implicit authentication of pods to the OSP based on service account mappings
AuthenticationType AuthenticationType `json:"authenticationType"`

Expand Down Expand Up @@ -276,11 +273,11 @@ type BucketAccessSpec struct {
// BucketClaimName is the name of the BucketClaim.
BucketClaimName string `json:"bucketClaimName"`

// Protocol is the name of the Protocol
// Protocol is the name of the Protocol
// that this access credential is supposed to support
// If left empty, it will choose the protocol supported
// by the bucket. If the bucket supports multiple protocols,
// the end protocol is determined by the driver.
// the end protocol is determined by the driver.
// +optional
Protocol Protocol `json:"protocol,omitempty"`

Expand Down Expand Up @@ -317,4 +314,3 @@ type BucketAccessList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []BucketAccess `json:"items"`
}

2 changes: 1 addition & 1 deletion crds/objectstorage.k8s.io_bucketaccessclasses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
type: string
authenticationType:
description: AuthenticationType denotes the style of authentication It
can be one of KEY - access, secret tokens based authentication IAM -
can be one of Key - access, secret tokens based authentication IAM -
implicit authentication of pods to the OSP based on service account
mappings
type: string
Expand Down
2 changes: 1 addition & 1 deletion crds/objectstorage.k8s.io_bucketclasses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
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
default: Retain
description: 'DeletionPolicy is used to specify how COSI should handle
deletion of this bucket. There are 2 possible values: - Retain: Indicates
that the bucket should not be deleted from the OSP - Delete: Indicates
Expand Down
2 changes: 1 addition & 1 deletion crds/objectstorage.k8s.io_buckets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
description: Name of the BucketClass specified in the BucketRequest
type: string
deletionPolicy:
default: retain
default: Retain
description: 'DeletionPolicy is used to specify how COSI should handle
deletion of this bucket. There are 2 possible values: - Retain:
Indicates that the bucket should not be deleted from the OSP (default)
Expand Down