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

Commit 2cdabb1

Browse files
authored
Merge pull request #35 from wlan0/master
use bucketName instead of bucketName and bucketInstanceName
2 parents ae7b851 + ca0accb commit 2cdabb1

11 files changed

+54
-44
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ type AzureProtocol struct {
2727

2828
func (azure *AzureProtocol) ConvertToExternal() *osspec.Protocol_AzureBlob {
2929
return &osspec.Protocol_AzureBlob{
30-
AzureBlob: &osspec.AzureBlobParameters{
30+
AzureBlob: &osspec.AzureBlob{
3131
ContainerName: azure.ContainerName,
3232
StorageAccount: azure.StorageAccount,
3333
},
3434
}
3535
}
3636

37-
func ConvertFromAzureExternal(ext *osspec.AzureBlobParameters) *AzureProtocol {
37+
func ConvertFromAzureExternal(ext *osspec.AzureBlob) *AzureProtocol {
3838
return &AzureProtocol{
3939
StorageAccount: ext.StorageAccount,
4040
ContainerName: ext.ContainerName,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type GCSProtocol struct {
2929

3030
func (gcs *GCSProtocol) ConvertToExternal() *osspec.Protocol_Gcs {
3131
return &osspec.Protocol_Gcs{
32-
Gcs: &osspec.GCSParameters{
32+
Gcs: &osspec.GCS{
3333
BucketName: gcs.BucketName,
3434
PrivateKeyName: gcs.PrivateKeyName,
3535
ProjectId: gcs.ProjectID,
@@ -38,7 +38,7 @@ func (gcs *GCSProtocol) ConvertToExternal() *osspec.Protocol_Gcs {
3838
}
3939
}
4040

41-
func ConvertFromGCSExternal(ext *osspec.GCSParameters) *GCSProtocol {
41+
func ConvertFromGCSExternal(ext *osspec.GCS) *GCSProtocol {
4242
return &GCSProtocol{
4343
BucketName: ext.BucketName,
4444
PrivateKeyName: ext.PrivateKeyName,

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

+23-18
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/s3_types.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (s3 *S3Protocol) ConvertToExternal() *osspec.Protocol_S3 {
4444
sigver = 0
4545
}
4646
return &osspec.Protocol_S3{
47-
S3: &osspec.S3Parameters{
47+
S3: &osspec.S3{
4848
Endpoint: s3.Endpoint,
4949
BucketName: s3.BucketName,
5050
Region: s3.Region,
@@ -53,7 +53,7 @@ func (s3 *S3Protocol) ConvertToExternal() *osspec.Protocol_S3 {
5353
}
5454
}
5555

56-
func ConvertFromS3External(ext *osspec.S3Parameters) *S3Protocol {
56+
func ConvertFromS3External(ext *osspec.S3) *S3Protocol {
5757
vers, ok := osspec.S3SignatureVersion_name[int32(ext.SignatureVersion)]
5858
if !ok {
5959
vers = osspec.S3SignatureVersion_name[0]

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

+12-10
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ type BucketRequest struct {
117117
}
118118

119119
type BucketRequestSpec struct {
120-
// +optional
121-
BucketInstanceName string `json:"bucketInstanceName,omitempty"`
122-
123120
// +optional
124121
BucketPrefix string `json:"bucketPrefix,omitempty"`
125122

@@ -133,6 +130,9 @@ type BucketRequestStatus struct {
133130

134131
// +optional
135132
BucketAvailable bool `json:"bucketAvailable"`
133+
134+
// +optional
135+
BucketName string `json:"bucketName,omitempty"`
136136
}
137137

138138
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -231,7 +231,7 @@ type BucketAccess struct {
231231

232232
type BucketAccessSpec struct {
233233
// +optional
234-
BucketInstanceName string `json:"bucketInstanceName,omitempty"`
234+
BucketName string `json:"bucketName,omitempty"`
235235

236236
// +optional
237237
BucketAccessRequest *corev1.ObjectReference `json:"bucketAccessRequest,omitempty"`
@@ -245,7 +245,7 @@ type BucketAccessSpec struct {
245245
PolicyActionsConfigMapData string `json:"policyActionsConfigMapData,omitempty"`
246246

247247
// +optional
248-
Principal string `json:"principal,omitempty"`
248+
AccountID string `json:"accountID,omitempty"`
249249

250250
// +optional
251251
Parameters map[string]string `json:"parameters,omitempty"`
@@ -288,13 +288,12 @@ type BucketAccessRequest struct {
288288
type BucketAccessRequestSpec struct {
289289
// +optional
290290
ServiceAccountName string `json:"serviceAccountName,omitempty"`
291-
292-
BucketRequestName string `json:"bucketRequestName"`
291+
// +optional
292+
BucketRequestName string `json:"bucketRequestName,omitempty"`
293+
// +optional
294+
BucketName string `json:"bucketName,omitempty"`
293295

294296
BucketAccessClassName string `json:"bucketAccessClassName"`
295-
296-
// +optional
297-
BucketAccessName string `json:"bucketAccessName,omitempty"`
298297
}
299298

300299
type BucketAccessRequestStatus struct {
@@ -303,6 +302,9 @@ type BucketAccessRequestStatus struct {
303302

304303
// +optional
305304
AccessGranted bool `json:"accessGranted"`
305+
306+
// +optional
307+
BucketAccessName string `json:"bucketAccessName,omitempty"`
306308
}
307309

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

Diff for: controller/controller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ func NewObjectStorageControllerWithClientset(identity string, leaderLockName str
159159
ResyncPeriod: 30 * time.Second,
160160
// leader election
161161
LeaseDuration: 60 * time.Second,
162-
RenewDeadline: 15 * time.Second,
163-
RetryPeriod: 5 * time.Second,
162+
RenewDeadline: 30 * time.Second,
163+
RetryPeriod: 15 * time.Second,
164164

165165
opMap: &sync.Map{},
166166
}, nil

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ spec:
3434
type: object
3535
spec:
3636
properties:
37+
accountID:
38+
type: string
3739
bucketAccessRequest:
3840
description: 'ObjectReference contains enough information to let you
3941
inspect or modify the referred object. --- New uses of this type
@@ -93,7 +95,7 @@ spec:
9395
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
9496
type: string
9597
type: object
96-
bucketInstanceName:
98+
bucketName:
9799
type: string
98100
mintedSecretName:
99101
type: string
@@ -103,8 +105,6 @@ spec:
103105
type: object
104106
policyActionsConfigMapData:
105107
type: string
106-
principal:
107-
type: string
108108
serviceAccount:
109109
description: 'ObjectReference contains enough information to let you
110110
inspect or modify the referred object. --- New uses of this type

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,21 @@ spec:
3636
properties:
3737
bucketAccessClassName:
3838
type: string
39-
bucketAccessName:
39+
bucketName:
4040
type: string
4141
bucketRequestName:
4242
type: string
4343
serviceAccountName:
4444
type: string
4545
required:
4646
- bucketAccessClassName
47-
- bucketRequestName
4847
type: object
4948
status:
5049
properties:
5150
accessGranted:
5251
type: boolean
52+
bucketAccessName:
53+
type: string
5354
message:
5455
type: string
5556
type: object

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ spec:
3636
properties:
3737
bucketClassName:
3838
type: string
39-
bucketInstanceName:
40-
type: string
4139
bucketPrefix:
4240
type: string
4341
type: object
4442
status:
4543
properties:
4644
bucketAvailable:
4745
type: boolean
46+
bucketName:
47+
type: string
4848
message:
4949
type: string
5050
type: object

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ require (
1313
k8s.io/apimachinery v0.19.4
1414
k8s.io/client-go v0.19.4
1515
k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488
16-
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210224211525-dfa3af562c18
16+
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210329232956-3bbacbbc9c19
1717
sigs.k8s.io/controller-runtime v0.6.3
1818
)

Diff for: go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8
617617
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0=
618618
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210224211525-dfa3af562c18 h1:TIx7kV6/3ZSQ5BETBx1QG1Va28zv1LZAvqRjs28n8ss=
619619
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210224211525-dfa3af562c18/go.mod h1:kafkL5l/lTUrZXhVi/9p1GzpEE/ts29BkWkL3Ao33WU=
620+
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210329232956-3bbacbbc9c19 h1:LrLrBCBqO7O/VjJtTrDSj3/f7hLSQaCIouLZFnHGxFg=
621+
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210329232956-3bbacbbc9c19/go.mod h1:kafkL5l/lTUrZXhVi/9p1GzpEE/ts29BkWkL3Ao33WU=
620622
sigs.k8s.io/controller-runtime v0.6.3 h1:SBbr+inLPEKhvlJtrvDcwIpm+uhDvp63Bl72xYJtoOE=
621623
sigs.k8s.io/controller-runtime v0.6.3/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY=
622624
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=

0 commit comments

Comments
 (0)