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

Commit 9fde365

Browse files
committed
Adding Protocol to BucketClass to allow admin to provide backend information
1 parent a74c106 commit 9fde365

9 files changed

+72
-109
lines changed

Diff for: apis/objectstorage.k8s.io/v1alpha1/openapi_generated.go

+13-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: apis/objectstorage.k8s.io/v1alpha1/protocol_types.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,11 @@ const (
2424
ProtocolNameGCS ProtocolName = "gcs"
2525
)
2626

27-
type RequestedProtocol struct {
27+
type Protocol struct {
2828
// +kubebuilder:validation:Enum:={s3,azureBlob,gcs}
2929
Name ProtocolName `json:"name"`
3030
// +optional
3131
Version string `json:"version,omitempty"`
32-
}
33-
34-
type Protocol struct {
35-
// +required
36-
RequestedProtocol `json:"requestedProtocol"`
3732
// +optional
3833
S3 *S3Protocol `json:"s3,omitempty"`
3934
// +optional

Diff for: apis/objectstorage.k8s.io/v1alpha1/s3_types.go

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const (
2626
)
2727

2828
type S3Protocol struct {
29-
Version string `json:"version,omitempty"`
3029
Endpoint string `json:"endpoint,omitempty"`
3130
BucketName string `json:"bucketName,omitempty"`
3231
Region string `json:"region,omitempty"`

Diff for: apis/objectstorage.k8s.io/v1alpha1/types.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ type BucketRequestSpec struct {
2727
// +optional
2828
BucketPrefix string `json:"bucketPrefix,omitempty"`
2929
// +optional
30-
BucketClassName string `json:"bucketClassName,omitempty"`
31-
Protocol RequestedProtocol `json:"protocol"`
30+
BucketClassName string `json:"bucketClassName,omitempty"`
3231
}
3332

3433
type BucketRequestStatus struct {
@@ -145,7 +144,7 @@ type BucketClass struct {
145144
// +listType=atomic
146145
// +optional
147146
AllowedNamespaces []string `json:"allowedNamespaces,omitempty"`
148-
Protocol string `json:"protocol"`
147+
Protocol Protocol `json:"protocol"`
149148
// +optional
150149
AnonymousAccessMode AnonymousAccessMode `json:"anonymousAccessMode,omitempty"`
151150
// +kubebuilder:default:=retain
@@ -196,7 +195,7 @@ type BucketAccessSpec struct {
196195
// +optional
197196
BucketAccessRequest *corev1.ObjectReference `json:"bucketAccessRequest,omitempty"`
198197
// +optional
199-
ServiceAccount *corev1.ObjectReference `json:"serviceAccount,omitempty"`
198+
ServiceAccount *corev1.ObjectReference `json:"serviceAccount,omitempty"`
200199
// +optional
201200
MintedSecretName string `json:"mintedSecretName,omitempty"`
202201
PolicyActionsConfigMapData string `json:"policyActionsConfigMapData,omitempty"`

Diff for: apis/objectstorage.k8s.io/v1alpha1/zz_generated.deepcopy.go

+1-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: controller/controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func NewObjectStorageControllerWithClientset(identity string, leaderLockName str
172172
// Run - runs the controller. Note that ctx must be cancellable i.e. ctx.Done() should not return nil
173173
func (c *ObjectStorageController) Run(ctx context.Context) error {
174174
if !c.initialized {
175-
fmt.Errorf("Uninitialized controller. Atleast 1 listener should be added")
175+
return fmt.Errorf("Uninitialized controller. Atleast 1 listener should be added")
176176
}
177177

178178
ns := func() string {

Diff for: crds/objectstorage.k8s.io_bucketclasses.yaml

+44-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,50 @@ spec:
5656
type: string
5757
type: object
5858
protocol:
59-
type: string
59+
properties:
60+
azureBlob:
61+
properties:
62+
containerName:
63+
type: string
64+
storageAccount:
65+
type: string
66+
type: object
67+
gcs:
68+
properties:
69+
bucketName:
70+
type: string
71+
privateKeyName:
72+
type: string
73+
projectID:
74+
type: string
75+
serviceAccount:
76+
type: string
77+
type: object
78+
name:
79+
enum:
80+
- s3
81+
- azureBlob
82+
- gcs
83+
type: string
84+
s3:
85+
properties:
86+
bucketName:
87+
type: string
88+
endpoint:
89+
type: string
90+
region:
91+
type: string
92+
signatureVersion:
93+
enum:
94+
- s3v2
95+
- s3v4
96+
type: string
97+
type: object
98+
version:
99+
type: string
100+
required:
101+
- name
102+
type: object
60103
provisioner:
61104
type: string
62105
retentionPolicy:

Diff for: crds/objectstorage.k8s.io_bucketrequests.yaml

-15
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,6 @@ spec:
4040
type: string
4141
bucketPrefix:
4242
type: string
43-
protocol:
44-
properties:
45-
name:
46-
enum:
47-
- s3
48-
- azureBlob
49-
- gcs
50-
type: string
51-
version:
52-
type: string
53-
required:
54-
- name
55-
type: object
56-
required:
57-
- protocol
5843
type: object
5944
status:
6045
properties:

Diff for: crds/objectstorage.k8s.io_buckets.yaml

+9-16
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,12 @@ spec:
135135
serviceAccount:
136136
type: string
137137
type: object
138-
requestedProtocol:
139-
properties:
140-
name:
141-
enum:
142-
- s3
143-
- azureBlob
144-
- gcs
145-
type: string
146-
version:
147-
type: string
148-
required:
149-
- name
150-
type: object
138+
name:
139+
enum:
140+
- s3
141+
- azureBlob
142+
- gcs
143+
type: string
151144
s3:
152145
properties:
153146
bucketName:
@@ -161,11 +154,11 @@ spec:
161154
- s3v2
162155
- s3v4
163156
type: string
164-
version:
165-
type: string
166157
type: object
158+
version:
159+
type: string
167160
required:
168-
- requestedProtocol
161+
- name
169162
type: object
170163
provisioner:
171164
type: string

0 commit comments

Comments
 (0)