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

Commit ff75c90

Browse files
committed
add api definitions
1 parent 5c52928 commit ff75c90

11 files changed

+2413
-0
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// +k8s:deepcopy-gen=false
2+
3+
package v1alpha1
4+
5+
type AzureProtocol struct {
6+
ContainerName string `json:"containerName,omitempty"`
7+
StorageAccount string `json:"storageAccount,omitempty"`
8+
}

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

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// +k8s:deepcopy-gen=package,register
2+
// +groupName=objectstorage.k8s.io
3+
// +k8s:protobuf-gen=package
4+
// +k8s:openapi-gen=true
5+
// +kubebuilder:validation:Required
6+
7+
package v1alpha1

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

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// +k8s:deepcopy-gen=false
2+
3+
package v1alpha1
4+
5+
type GCSProtocol struct {
6+
BucketName string `json:"bucketName,omitempty"`
7+
PrivateKeyName string `json:"privateKeyName,omitempty"`
8+
ProjectID string `json:"projectID,omitempty"`
9+
ServiceAccount string `json:"serviceAccount,omitempty"`
10+
}

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

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

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package v1alpha1
2+
3+
type ProtocolName string
4+
5+
const (
6+
ProtocolNameS3 ProtocolName = "s3"
7+
ProtocolNameAzure ProtocolName = "azureBlob"
8+
ProtocolNameGCS ProtocolName = "gcs"
9+
)
10+
11+
type RequestedProtocol struct {
12+
// +kubebuilder:validation:Enum:={s3,azureBlob,gcs}
13+
Name ProtocolName `json:"name"`
14+
// +optional
15+
Version string `json:"version"`
16+
}
17+
18+
type Protocol struct {
19+
// +required
20+
RequestedProtocol `json:"requestedProtocol"`
21+
// +optional
22+
S3 *S3Protocol `json:"s3,omitempty"`
23+
// +optional
24+
AzureBlob *AzureProtocol `json:"azureBlob,omitempty"`
25+
// +optional
26+
GCS *GCSProtocol `json:"gcs,omitempty"`
27+
}

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

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package v1alpha1
2+
3+
import (
4+
"k8s.io/apimachinery/pkg/runtime/schema"
5+
"sigs.k8s.io/controller-runtime/pkg/scheme"
6+
)
7+
8+
var (
9+
// GroupVersion is group version used to register these objects
10+
SchemeGroupVersion = schema.GroupVersion{Group: "objectstorage.k8s.io", Version: "v1alpha1"}
11+
12+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
13+
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
14+
15+
// AddToScheme adds the types in this group-version to the given scheme.
16+
AddToScheme = SchemeBuilder.AddToScheme
17+
)
18+
19+
// Resource takes an unqualified resource and returns a Group qualified GroupResource
20+
func Resource(resource string) schema.GroupResource {
21+
return SchemeGroupVersion.WithResource(resource).GroupResource()
22+
}

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

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// +k8s:deepcopy-gen=false
2+
3+
package v1alpha1
4+
5+
type S3SignatureVersion string
6+
7+
const (
8+
S3SignatureVersionV2 = "s3v2"
9+
S3SignatureVersionV4 = "s3v4"
10+
)
11+
12+
type S3Protocol struct {
13+
Version string `json:"version,omitempty"`
14+
Endpoint string `json:"endpoint,omitempty"`
15+
BucketName string `json:"bucketName,omitempty"`
16+
Region string `json:"region,omitempty"`
17+
// +kubebuilder:validation:Enum:={s3v2,s3v4}
18+
SignatureVersion S3SignatureVersion `json:"signatureVersion,omitempty"`
19+
}

0 commit comments

Comments
 (0)