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

Commit 5547754

Browse files
authored
Merge pull request #2 from brahmaroutu/add_apidefinitions
Add api definitions
2 parents 5c52928 + 1182692 commit 5547754

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+7463
-0
lines changed

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

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// +k8s:deepcopy-gen=false
18+
19+
package v1alpha1
20+
21+
type AzureProtocol struct {
22+
ContainerName string `json:"containerName,omitempty"`
23+
StorageAccount string `json:"storageAccount,omitempty"`
24+
}

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

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// +k8s:deepcopy-gen=package,register
18+
// +groupName=objectstorage.k8s.io
19+
// +k8s:protobuf-gen=package
20+
// +k8s:openapi-gen=true
21+
// +kubebuilder:validation:Required
22+
23+
package v1alpha1

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

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// +k8s:deepcopy-gen=false
18+
19+
package v1alpha1
20+
21+
type GCSProtocol struct {
22+
BucketName string `json:"bucketName,omitempty"`
23+
PrivateKeyName string `json:"privateKeyName,omitempty"`
24+
ProjectID string `json:"projectID,omitempty"`
25+
ServiceAccount string `json:"serviceAccount,omitempty"`
26+
}

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

+1,210
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

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
type ProtocolName string
20+
21+
const (
22+
ProtocolNameS3 ProtocolName = "s3"
23+
ProtocolNameAzure ProtocolName = "azureBlob"
24+
ProtocolNameGCS ProtocolName = "gcs"
25+
)
26+
27+
type RequestedProtocol struct {
28+
// +kubebuilder:validation:Enum:={s3,azureBlob,gcs}
29+
Name ProtocolName `json:"name"`
30+
// +optional
31+
Version string `json:"version,omitempty"`
32+
}
33+
34+
type Protocol struct {
35+
// +required
36+
RequestedProtocol `json:"requestedProtocol"`
37+
// +optional
38+
S3 *S3Protocol `json:"s3,omitempty"`
39+
// +optional
40+
AzureBlob *AzureProtocol `json:"azureBlob,omitempty"`
41+
// +optional
42+
GCS *GCSProtocol `json:"gcs,omitempty"`
43+
}

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

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
"k8s.io/apimachinery/pkg/runtime/schema"
21+
"sigs.k8s.io/controller-runtime/pkg/scheme"
22+
)
23+
24+
var (
25+
// GroupVersion is group version used to register these objects
26+
SchemeGroupVersion = schema.GroupVersion{Group: "objectstorage.k8s.io", Version: "v1alpha1"}
27+
28+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
29+
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
30+
31+
// AddToScheme adds the types in this group-version to the given scheme.
32+
AddToScheme = SchemeBuilder.AddToScheme
33+
)
34+
35+
// Resource takes an unqualified resource and returns a Group qualified GroupResource
36+
func Resource(resource string) schema.GroupResource {
37+
return SchemeGroupVersion.WithResource(resource).GroupResource()
38+
}

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

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// +k8s:deepcopy-gen=false
18+
19+
package v1alpha1
20+
21+
type S3SignatureVersion string
22+
23+
const (
24+
S3SignatureVersionV2 S3SignatureVersion = "S3v2"
25+
S3SignatureVersionV4 S3SignatureVersion = "S3v4"
26+
)
27+
28+
type S3Protocol struct {
29+
Version string `json:"version,omitempty"`
30+
Endpoint string `json:"endpoint,omitempty"`
31+
BucketName string `json:"bucketName,omitempty"`
32+
Region string `json:"region,omitempty"`
33+
// +kubebuilder:validation:Enum:={s3v2,s3v4}
34+
SignatureVersion S3SignatureVersion `json:"signatureVersion,omitempty"`
35+
}

0 commit comments

Comments
 (0)