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

use bucketName instead of bucketName and bucketInstanceName #35

Merged
merged 3 commits into from
Mar 30, 2021
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
4 changes: 2 additions & 2 deletions apis/objectstorage.k8s.io/v1alpha1/azure_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ type AzureProtocol struct {

func (azure *AzureProtocol) ConvertToExternal() *osspec.Protocol_AzureBlob {
return &osspec.Protocol_AzureBlob{
AzureBlob: &osspec.AzureBlobParameters{
AzureBlob: &osspec.AzureBlob{
ContainerName: azure.ContainerName,
StorageAccount: azure.StorageAccount,
},
}
}

func ConvertFromAzureExternal(ext *osspec.AzureBlobParameters) *AzureProtocol {
func ConvertFromAzureExternal(ext *osspec.AzureBlob) *AzureProtocol {
return &AzureProtocol{
StorageAccount: ext.StorageAccount,
ContainerName: ext.ContainerName,
Expand Down
4 changes: 2 additions & 2 deletions apis/objectstorage.k8s.io/v1alpha1/gcs_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type GCSProtocol struct {

func (gcs *GCSProtocol) ConvertToExternal() *osspec.Protocol_Gcs {
return &osspec.Protocol_Gcs{
Gcs: &osspec.GCSParameters{
Gcs: &osspec.GCS{
BucketName: gcs.BucketName,
PrivateKeyName: gcs.PrivateKeyName,
ProjectId: gcs.ProjectID,
Expand All @@ -38,7 +38,7 @@ func (gcs *GCSProtocol) ConvertToExternal() *osspec.Protocol_Gcs {
}
}

func ConvertFromGCSExternal(ext *osspec.GCSParameters) *GCSProtocol {
func ConvertFromGCSExternal(ext *osspec.GCS) *GCSProtocol {
return &GCSProtocol{
BucketName: ext.BucketName,
PrivateKeyName: ext.PrivateKeyName,
Expand Down
41 changes: 23 additions & 18 deletions apis/objectstorage.k8s.io/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apis/objectstorage.k8s.io/v1alpha1/s3_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (s3 *S3Protocol) ConvertToExternal() *osspec.Protocol_S3 {
sigver = 0
}
return &osspec.Protocol_S3{
S3: &osspec.S3Parameters{
S3: &osspec.S3{
Endpoint: s3.Endpoint,
BucketName: s3.BucketName,
Region: s3.Region,
Expand All @@ -53,7 +53,7 @@ func (s3 *S3Protocol) ConvertToExternal() *osspec.Protocol_S3 {
}
}

func ConvertFromS3External(ext *osspec.S3Parameters) *S3Protocol {
func ConvertFromS3External(ext *osspec.S3) *S3Protocol {
vers, ok := osspec.S3SignatureVersion_name[int32(ext.SignatureVersion)]
if !ok {
vers = osspec.S3SignatureVersion_name[0]
Expand Down
22 changes: 12 additions & 10 deletions apis/objectstorage.k8s.io/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ type BucketRequest struct {
}

type BucketRequestSpec struct {
// +optional
BucketInstanceName string `json:"bucketInstanceName,omitempty"`

// +optional
BucketPrefix string `json:"bucketPrefix,omitempty"`

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

// +optional
BucketAvailable bool `json:"bucketAvailable"`

// +optional
BucketName string `json:"bucketName,omitempty"`
}

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

type BucketAccessSpec struct {
// +optional
BucketInstanceName string `json:"bucketInstanceName,omitempty"`
BucketName string `json:"bucketName,omitempty"`

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

// +optional
Principal string `json:"principal,omitempty"`
AccountID string `json:"accountID,omitempty"`

// +optional
Parameters map[string]string `json:"parameters,omitempty"`
Expand Down Expand Up @@ -288,13 +288,12 @@ type BucketAccessRequest struct {
type BucketAccessRequestSpec struct {
// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`

BucketRequestName string `json:"bucketRequestName"`
// +optional
BucketRequestName string `json:"bucketRequestName,omitempty"`
// +optional
BucketName string `json:"bucketName,omitempty"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for the brownfield usecase


BucketAccessClassName string `json:"bucketAccessClassName"`

// +optional
BucketAccessName string `json:"bucketAccessName,omitempty"`
}

type BucketAccessRequestStatus struct {
Expand All @@ -303,6 +302,9 @@ type BucketAccessRequestStatus struct {

// +optional
AccessGranted bool `json:"accessGranted"`

// +optional
BucketAccessName string `json:"bucketAccessName,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
4 changes: 2 additions & 2 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ func NewObjectStorageControllerWithClientset(identity string, leaderLockName str
ResyncPeriod: 30 * time.Second,
// leader election
LeaseDuration: 60 * time.Second,
RenewDeadline: 15 * time.Second,
RetryPeriod: 5 * time.Second,
RenewDeadline: 30 * time.Second,
RetryPeriod: 15 * time.Second,

opMap: &sync.Map{},
}, nil
Expand Down
6 changes: 3 additions & 3 deletions crds/objectstorage.k8s.io_bucketaccesses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ spec:
type: object
spec:
properties:
accountID:
type: string
bucketAccessRequest:
description: 'ObjectReference contains enough information to let you
inspect or modify the referred object. --- New uses of this type
Expand Down Expand Up @@ -93,7 +95,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
bucketInstanceName:
bucketName:
type: string
mintedSecretName:
type: string
Expand All @@ -103,8 +105,6 @@ spec:
type: object
policyActionsConfigMapData:
type: string
principal:
type: string
serviceAccount:
description: 'ObjectReference contains enough information to let you
inspect or modify the referred object. --- New uses of this type
Expand Down
5 changes: 3 additions & 2 deletions crds/objectstorage.k8s.io_bucketaccessrequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,21 @@ spec:
properties:
bucketAccessClassName:
type: string
bucketAccessName:
bucketName:
type: string
bucketRequestName:
type: string
serviceAccountName:
type: string
required:
- bucketAccessClassName
- bucketRequestName
Copy link

@jeffvance jeffvance Mar 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. BR-name is still needed in BAR.spec to handle sharing w/in the same namespace. (If I'm understanding this change correctly).
  2. bucketName needs to be in BAR.spec (per latest kep pr).
  3. 1 & 2 are mutually exclusive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this line, it is only being removed from the REQUIRED list. Since it is either or with bucketName

type: object
status:
properties:
accessGranted:
type: boolean
bucketAccessName:
type: string
message:
type: string
type: object
Expand Down
4 changes: 2 additions & 2 deletions crds/objectstorage.k8s.io_bucketrequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ spec:
properties:
bucketClassName:
type: string
bucketInstanceName:
type: string
bucketPrefix:
type: string
type: object
status:
properties:
bucketAvailable:
type: boolean
bucketName:
type: string
message:
type: string
type: object
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ require (
k8s.io/apimachinery v0.19.4
k8s.io/client-go v0.19.4
k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210224211525-dfa3af562c18
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210329232956-3bbacbbc9c19
sigs.k8s.io/controller-runtime v0.6.3
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0=
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210224211525-dfa3af562c18 h1:TIx7kV6/3ZSQ5BETBx1QG1Va28zv1LZAvqRjs28n8ss=
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210224211525-dfa3af562c18/go.mod h1:kafkL5l/lTUrZXhVi/9p1GzpEE/ts29BkWkL3Ao33WU=
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210329232956-3bbacbbc9c19 h1:LrLrBCBqO7O/VjJtTrDSj3/f7hLSQaCIouLZFnHGxFg=
sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20210329232956-3bbacbbc9c19/go.mod h1:kafkL5l/lTUrZXhVi/9p1GzpEE/ts29BkWkL3Ao33WU=
sigs.k8s.io/controller-runtime v0.6.3 h1:SBbr+inLPEKhvlJtrvDcwIpm+uhDvp63Bl72xYJtoOE=
sigs.k8s.io/controller-runtime v0.6.3/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY=
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
Expand Down