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

Fixing build for the api changes to Protocol #36

Merged
merged 1 commit into from
Feb 11, 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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/google/uuid v1.1.2 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190328170749-bb2674552d8f // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kubernetes-sigs/container-object-storage-interface-api v0.0.0-20201210173615-0c3244fa34b9
github.com/kubernetes-sigs/container-object-storage-interface-api v0.0.0-20210120011359-1e91ae41e243
github.com/mailru/easyjson v0.7.6 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubernetes-sigs/container-object-storage-interface-api v0.0.0-20201210173615-0c3244fa34b9 h1:1Zmlu1GKd1iIv9fdc1mkaTuUtoNqet4NLYLE/8p9ylw=
github.com/kubernetes-sigs/container-object-storage-interface-api v0.0.0-20201210173615-0c3244fa34b9/go.mod h1:C7tjzC+nLe7H7+3UM/Z6a7F24yxOO8FSK3ZaVZrKDPQ=
github.com/kubernetes-sigs/container-object-storage-interface-api v0.0.0-20210120011359-1e91ae41e243 h1:iOEsQYg/QXxzYP10JaLtoQWdlGG3OS/a3sOYsrDXwdE=
github.com/kubernetes-sigs/container-object-storage-interface-api v0.0.0-20210120011359-1e91ae41e243/go.mod h1:C7tjzC+nLe7H7+3UM/Z6a7F24yxOO8FSK3ZaVZrKDPQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
Expand Down
6 changes: 1 addition & 5 deletions pkg/bucketaccessrequest/bucketaccessrequest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ var bucketRequest1 = types.BucketRequest{
UID: "br-12345",
},
Spec: types.BucketRequestSpec{
BucketPrefix: "cosi",
Protocol: types.RequestedProtocol{
Name: "s3",
Version: "",
},
BucketPrefix: "cosi",
BucketClassName: "classgold",
BucketInstanceName: "cosi1234567890",
},
Expand Down
4 changes: 1 addition & 3 deletions pkg/bucketrequest/bucketrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,9 @@ func (b *bucketRequestListener) provisionBucketRequestOperation(ctx context.Cont
Namespace: bucketRequest.Namespace,
UID: bucketRequest.ObjectMeta.UID}
bucket.Spec.AllowedNamespaces = util.CopyStrings(bucketClass.AllowedNamespaces)
bucket.Spec.Protocol = *bucketClass.Protocol.DeepCopy()
bucket.Spec.Parameters = util.CopySS(bucketClass.Parameters)

// TODO have a switch statement to populate appropriate protocol based on BR.Protocol
bucket.Spec.Protocol.RequestedProtocol = bucketRequest.Spec.Protocol

bucket, err = b.bucketClient.ObjectstorageV1alpha1().Buckets().Create(context.Background(), bucket, metav1.CreateOptions{})
if err != nil {
if errors.IsAlreadyExists(err) {
Expand Down
14 changes: 3 additions & 11 deletions pkg/bucketrequest/bucketrequest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var goldClass = types.BucketClass{
},
AllowedNamespaces: []string{"default", "cosins"},
Parameters: classGoldParameters,
Protocol: "s3",
Protocol: types.Protocol{Name: "s3"},
IsDefaultBucketClass: false,
}

Expand All @@ -43,11 +43,7 @@ var bucketRequest1 = types.BucketRequest{
UID: "12345-67890",
},
Spec: types.BucketRequestSpec{
BucketPrefix: "cosi",
Protocol: types.RequestedProtocol{
Name: "s3",
Version: "",
},
BucketPrefix: "cosi",
BucketClassName: "classgold",
},
}
Expand All @@ -63,11 +59,7 @@ var bucketRequest2 = types.BucketRequest{
UID: "abcde-fghijk",
},
Spec: types.BucketRequestSpec{
BucketPrefix: "cosi",
Protocol: types.RequestedProtocol{
Name: "s3",
Version: "",
},
BucketPrefix: "cosi",
BucketClassName: "classgold",
},
}
Expand Down