1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Feature] [Platform] Storage V1Alpha1 (#1756)

This commit is contained in:
Adam Janikowski 2024-11-04 09:48:21 +01:00 committed by GitHub
parent d69678b8fb
commit 77fc964af5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
70 changed files with 2589 additions and 188 deletions

View file

@ -12,6 +12,7 @@
- (Bugfix) Fix Gateway Options
- (Feature) StorageV2 Integration Service Definition
- (Feature) AWS Client
- (Feature) (Platform) Storage V1Alpha1
## [1.2.43](https://github.com/arangodb/kube-arangodb/tree/1.2.43) (2024-10-14)
- (Feature) ArangoRoute CRD

View file

@ -927,14 +927,14 @@ sync: sync-crds
.PHONY: sync-charts
sync-charts:
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type d -not -name values.yaml -exec mkdir -p "$(ROOT)/chart/kube-arangodb-enterprise/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type f -not -name values.yaml -not -name Chart.yaml -exec cp "$(ROOT)/chart/kube-arangodb/{}" "$(ROOT)/chart/kube-arangodb-enterprise/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type d -not -name values.yaml -and -not -name README.md -exec mkdir -p "$(ROOT)/chart/kube-arangodb-enterprise/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type f -not -name values.yaml -and -not -name README.md -not -name Chart.yaml -exec cp "$(ROOT)/chart/kube-arangodb/{}" "$(ROOT)/chart/kube-arangodb-enterprise/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type d -not -name values.yaml -exec mkdir -p "$(ROOT)/chart/kube-arangodb-enterprise-arm64/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type f -not -name values.yaml -not -name Chart.yaml -exec cp "$(ROOT)/chart/kube-arangodb/{}" "$(ROOT)/chart/kube-arangodb-enterprise-arm64/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type d -not -name values.yaml -and -not -name README.md -exec mkdir -p "$(ROOT)/chart/kube-arangodb-enterprise-arm64/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type f -not -name values.yaml -and -not -name README.md -not -name Chart.yaml -exec cp "$(ROOT)/chart/kube-arangodb/{}" "$(ROOT)/chart/kube-arangodb-enterprise-arm64/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type d -not -name values.yaml -exec mkdir -p "$(ROOT)/chart/kube-arangodb-arm64/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type f -not -name values.yaml -not -name Chart.yaml -exec cp "$(ROOT)/chart/kube-arangodb/{}" "$(ROOT)/chart/kube-arangodb-arm64/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type d -not -name values.yaml -and -not -name README.md -exec mkdir -p "$(ROOT)/chart/kube-arangodb-arm64/{}" \;)
@(cd "$(ROOT)/chart/kube-arangodb"; find . -type f -not -name values.yaml -and -not -name README.md -not -name Chart.yaml -exec cp "$(ROOT)/chart/kube-arangodb/{}" "$(ROOT)/chart/kube-arangodb-arm64/{}" \;)
sync: sync-charts

View file

@ -16,9 +16,6 @@ rules:
- apiGroups: ["database.arangodb.com"]
resources: ["arangodeployments", "arangodeployments/status","arangomembers", "arangomembers/status"]
verbs: ["*"]
- apiGroups: ["networking.arangodb.com"]
resources: ["arangoroutes", "arangoroutes/status"]
verbs: ["*"]
{{- if .Values.rbac.extensions.acs }}
- apiGroups: ["database.arangodb.com"]
resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"]
@ -41,6 +38,9 @@ rules:
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["*"]
- apiGroups: ["platform.arangodb.com"]
resources: ["arangoplatformstorages", "arangoplatformstorages/status"]
verbs: ["get", "list", "watch"]
- apiGroups: ["backup.arangodb.com"]
resources: ["arangobackuppolicies", "arangobackups"]
verbs: ["get", "list", "watch"]

View file

@ -13,56 +13,11 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- "ml.arangodb.com"
resources:
- "arangomlextensions"
- "arangomlextensions/status"
- "arangomlbatchjobs"
- "arangomlbatchjobs/status"
- "arangomlcronjobs"
- "arangomlcronjobs/status"
- "arangomlstorages"
- "arangomlstorages/status"
verbs:
- "*"
- apiGroups:
- "scheduler.arangodb.com"
resources:
- "arangoprofiles"
- "arangoprofiles/status"
verbs:
- "*"
- apiGroups:
- "database.arangodb.com"
resources:
- "arangodeployments"
verbs:
- "get"
- "list"
- "watch"
- apiGroups:
- "rbac.authorization.k8s.io"
resources:
- "roles"
- "rolebindings"
verbs: ["*"]
- apiGroups:
- "batch"
resources:
- "cronjobs"
- "jobs"
verbs: ["*"]
- apiGroups: ["apps"]
resources:
- "statefulsets"
verbs: ["*"]
- apiGroups: [""]
resources:
- "pods"
- "secrets"
- "services"
- "serviceaccounts"
verbs: ["*"]
- apiGroups: ["networking.arangodb.com"]
resources: ["arangoroutes", "arangoroutes/status"]
verbs: ["*"]
- apiGroups: [""]
resources: ["pods", "services", "endpoints"]
verbs: ["get", "list", "watch"]
{{- end }}
{{- end }}

View file

@ -16,9 +16,6 @@ rules:
- apiGroups: ["database.arangodb.com"]
resources: ["arangodeployments", "arangodeployments/status","arangomembers", "arangomembers/status"]
verbs: ["*"]
- apiGroups: ["networking.arangodb.com"]
resources: ["arangoroutes", "arangoroutes/status"]
verbs: ["*"]
{{- if .Values.rbac.extensions.acs }}
- apiGroups: ["database.arangodb.com"]
resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"]
@ -41,6 +38,9 @@ rules:
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["*"]
- apiGroups: ["platform.arangodb.com"]
resources: ["arangoplatformstorages", "arangoplatformstorages/status"]
verbs: ["get", "list", "watch"]
- apiGroups: ["backup.arangodb.com"]
resources: ["arangobackuppolicies", "arangobackups"]
verbs: ["get", "list", "watch"]

View file

@ -13,56 +13,11 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- "ml.arangodb.com"
resources:
- "arangomlextensions"
- "arangomlextensions/status"
- "arangomlbatchjobs"
- "arangomlbatchjobs/status"
- "arangomlcronjobs"
- "arangomlcronjobs/status"
- "arangomlstorages"
- "arangomlstorages/status"
verbs:
- "*"
- apiGroups:
- "scheduler.arangodb.com"
resources:
- "arangoprofiles"
- "arangoprofiles/status"
verbs:
- "*"
- apiGroups:
- "database.arangodb.com"
resources:
- "arangodeployments"
verbs:
- "get"
- "list"
- "watch"
- apiGroups:
- "rbac.authorization.k8s.io"
resources:
- "roles"
- "rolebindings"
verbs: ["*"]
- apiGroups:
- "batch"
resources:
- "cronjobs"
- "jobs"
verbs: ["*"]
- apiGroups: ["apps"]
resources:
- "statefulsets"
verbs: ["*"]
- apiGroups: [""]
resources:
- "pods"
- "secrets"
- "services"
- "serviceaccounts"
verbs: ["*"]
- apiGroups: ["networking.arangodb.com"]
resources: ["arangoroutes", "arangoroutes/status"]
verbs: ["*"]
- apiGroups: [""]
resources: ["pods", "services", "endpoints"]
verbs: ["get", "list", "watch"]
{{- end }}
{{- end }}

View file

@ -16,9 +16,6 @@ rules:
- apiGroups: ["database.arangodb.com"]
resources: ["arangodeployments", "arangodeployments/status","arangomembers", "arangomembers/status"]
verbs: ["*"]
- apiGroups: ["networking.arangodb.com"]
resources: ["arangoroutes", "arangoroutes/status"]
verbs: ["*"]
{{- if .Values.rbac.extensions.acs }}
- apiGroups: ["database.arangodb.com"]
resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"]
@ -41,6 +38,9 @@ rules:
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["*"]
- apiGroups: ["platform.arangodb.com"]
resources: ["arangoplatformstorages", "arangoplatformstorages/status"]
verbs: ["get", "list", "watch"]
- apiGroups: ["backup.arangodb.com"]
resources: ["arangobackuppolicies", "arangobackups"]
verbs: ["get", "list", "watch"]

View file

@ -13,56 +13,11 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- "ml.arangodb.com"
resources:
- "arangomlextensions"
- "arangomlextensions/status"
- "arangomlbatchjobs"
- "arangomlbatchjobs/status"
- "arangomlcronjobs"
- "arangomlcronjobs/status"
- "arangomlstorages"
- "arangomlstorages/status"
verbs:
- "*"
- apiGroups:
- "scheduler.arangodb.com"
resources:
- "arangoprofiles"
- "arangoprofiles/status"
verbs:
- "*"
- apiGroups:
- "database.arangodb.com"
resources:
- "arangodeployments"
verbs:
- "get"
- "list"
- "watch"
- apiGroups:
- "rbac.authorization.k8s.io"
resources:
- "roles"
- "rolebindings"
verbs: ["*"]
- apiGroups:
- "batch"
resources:
- "cronjobs"
- "jobs"
verbs: ["*"]
- apiGroups: ["apps"]
resources:
- "statefulsets"
verbs: ["*"]
- apiGroups: [""]
resources:
- "pods"
- "secrets"
- "services"
- "serviceaccounts"
verbs: ["*"]
- apiGroups: ["networking.arangodb.com"]
resources: ["arangoroutes", "arangoroutes/status"]
verbs: ["*"]
- apiGroups: [""]
resources: ["pods", "services", "endpoints"]
verbs: ["get", "list", "watch"]
{{- end }}
{{- end }}

View file

@ -38,6 +38,9 @@ rules:
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["*"]
- apiGroups: ["platform.arangodb.com"]
resources: ["arangoplatformstorages", "arangoplatformstorages/status"]
verbs: ["get", "list", "watch"]
- apiGroups: ["backup.arangodb.com"]
resources: ["arangobackuppolicies", "arangobackups"]
verbs: ["get", "list", "watch"]

View file

@ -0,0 +1,126 @@
---
layout: page
parent: CRD reference
title: ArangoPlatformStorage V1Alpha1
---
# API Reference for ArangoPlatformStorage V1Alpha1
## Spec
### .spec.backend.s3.allowInsecure
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/platform/v1alpha1/storage_spec_backend_s3.go#L46)</sup>
AllowInsecure if set to true, the Endpoint certificates won't be checked
Default Value: `false`
***
### .spec.backend.s3.bucketName
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/platform/v1alpha1/storage_spec_backend_s3.go#L34)</sup>
BucketName specifies the name of the bucket
Required
***
### .spec.backend.s3.bucketPath
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/platform/v1alpha1/storage_spec_backend_s3.go#L37)</sup>
BucketPath specifies the Prefix within the bucket
***
### .spec.backend.s3.caSecret.checksum
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61)</sup>
UID keeps the information about object Checksum
***
### .spec.backend.s3.caSecret.name
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52)</sup>
Name of the object
***
### .spec.backend.s3.caSecret.namespace
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55)</sup>
Namespace of the object. Should default to the namespace of the parent object
***
### .spec.backend.s3.caSecret.uid
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58)</sup>
UID keeps the information about object UID
***
### .spec.backend.s3.credentialsSecret.checksum
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61)</sup>
UID keeps the information about object Checksum
***
### .spec.backend.s3.credentialsSecret.name
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52)</sup>
Name of the object
***
### .spec.backend.s3.credentialsSecret.namespace
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55)</sup>
Namespace of the object. Should default to the namespace of the parent object
***
### .spec.backend.s3.credentialsSecret.uid
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58)</sup>
UID keeps the information about object UID
***
### .spec.backend.s3.endpoint
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/platform/v1alpha1/storage_spec_backend_s3.go#L40)</sup>
Endpoint specifies the S3 API-compatible endpoint which implements storage
Required
***
### .spec.backend.s3.region
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/platform/v1alpha1/storage_spec_backend_s3.go#L55)</sup>
Region defines the availability zone name.
Default Value: `""`
***
### .spec.deployment
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/platform/v1alpha1/storage_spec.go#L29)</sup>
Deployment specifies the ArangoDeployment object name

6
go.mod
View file

@ -72,7 +72,10 @@ require (
sigs.k8s.io/yaml v1.4.0
)
require helm.sh/helm/v3 v3.16.2
require (
github.com/aws/aws-sdk-go v1.55.5
helm.sh/helm/v3 v3.16.2
)
require (
cel.dev/expr v0.15.0 // indirect
@ -88,7 +91,6 @@ require (
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go v1.55.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/bytedance/sonic v1.9.1 // indirect

View file

@ -41,11 +41,13 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Defines Object Path/Key
type StorageV2Path struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Defines Object Path/Key
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
}
@ -88,12 +90,15 @@ func (x *StorageV2Path) GetPath() string {
return ""
}
// Defines Object Details
type StorageV2Object struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Path *StorageV2Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
// Defines Object Path/Key
Path *StorageV2Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
// Defines Object Info
Info *StorageV2ObjectInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"`
}
@ -143,12 +148,15 @@ func (x *StorageV2Object) GetInfo() *StorageV2ObjectInfo {
return nil
}
// Defines Object Info
type StorageV2ObjectInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
// Size in bytes of the object
Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
// Timestamp of last update
LastUpdated *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
}
@ -198,11 +206,13 @@ func (x *StorageV2ObjectInfo) GetLastUpdated() *timestamppb.Timestamp {
return nil
}
// StorageV2 ReadObject Request
type StorageV2ReadObjectRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Defines Object Path/Key
Path *StorageV2Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
}
@ -245,11 +255,13 @@ func (x *StorageV2ReadObjectRequest) GetPath() *StorageV2Path {
return nil
}
// StorageV2 ReadObject Response
type StorageV2ReadObjectResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Bytes of the object
Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"`
}
@ -292,13 +304,16 @@ func (x *StorageV2ReadObjectResponse) GetChunk() []byte {
return nil
}
// StorageV2 WriteObject Request
type StorageV2WriteObjectRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Path *StorageV2Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"`
// Defines Object Path/Key
Path *StorageV2Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
// Bytes of the object
Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"`
}
func (x *StorageV2WriteObjectRequest) Reset() {
@ -347,12 +362,15 @@ func (x *StorageV2WriteObjectRequest) GetChunk() []byte {
return nil
}
// StorageV2 WriteObject Response
type StorageV2WriteObjectResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Bytes int64 `protobuf:"varint,1,opt,name=bytes,proto3" json:"bytes,omitempty"`
// Bytes Saved
Bytes int64 `protobuf:"varint,1,opt,name=bytes,proto3" json:"bytes,omitempty"`
// Checksum (sha256) of the object
Checksum string `protobuf:"bytes,2,opt,name=checksum,proto3" json:"checksum,omitempty"`
}
@ -402,11 +420,13 @@ func (x *StorageV2WriteObjectResponse) GetChecksum() string {
return ""
}
// StorageV2 HeadObject Request
type StorageV2HeadObjectRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Defines Object Path/Key
Path *StorageV2Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
}
@ -449,11 +469,13 @@ func (x *StorageV2HeadObjectRequest) GetPath() *StorageV2Path {
return nil
}
// StorageV2 HeadObject Response
type StorageV2HeadObjectResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Defines Object Info
Info *StorageV2ObjectInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
}
@ -496,11 +518,13 @@ func (x *StorageV2HeadObjectResponse) GetInfo() *StorageV2ObjectInfo {
return nil
}
// StorageV2 DeleteObject Request
type StorageV2DeleteObjectRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Defines Object Path/Key
Path *StorageV2Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
}
@ -543,6 +567,7 @@ func (x *StorageV2DeleteObjectRequest) GetPath() *StorageV2Path {
return nil
}
// StorageV2 DeleteObject Response
type StorageV2DeleteObjectResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -581,11 +606,13 @@ func (*StorageV2DeleteObjectResponse) Descriptor() ([]byte, []int) {
return file_integrations_storage_v2_definition_storage_proto_rawDescGZIP(), []int{10}
}
// StorageV2 ListObjects Request
type StorageV2ListObjectsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Defines Object Path/Key
Path *StorageV2Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
}
@ -628,11 +655,13 @@ func (x *StorageV2ListObjectsRequest) GetPath() *StorageV2Path {
return nil
}
// StorageV2 ListObjects Response
type StorageV2ListObjectsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// List of the objects
Files []*StorageV2Object `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"`
}

View file

@ -22,10 +22,15 @@ const _ = grpc.SupportPackageIsVersion7
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type StorageV2Client interface {
// Allows to Read Objects using stream
ReadObject(ctx context.Context, in *StorageV2ReadObjectRequest, opts ...grpc.CallOption) (StorageV2_ReadObjectClient, error)
// Allows to Write Objects using stream
WriteObject(ctx context.Context, opts ...grpc.CallOption) (StorageV2_WriteObjectClient, error)
// Gets basic info about object
HeadObject(ctx context.Context, in *StorageV2HeadObjectRequest, opts ...grpc.CallOption) (*StorageV2HeadObjectResponse, error)
// Deletes object
DeleteObject(ctx context.Context, in *StorageV2DeleteObjectRequest, opts ...grpc.CallOption) (*StorageV2DeleteObjectResponse, error)
// List all objects in batches
ListObjects(ctx context.Context, in *StorageV2ListObjectsRequest, opts ...grpc.CallOption) (StorageV2_ListObjectsClient, error)
}
@ -157,10 +162,15 @@ func (x *storageV2ListObjectsClient) Recv() (*StorageV2ListObjectsResponse, erro
// All implementations must embed UnimplementedStorageV2Server
// for forward compatibility
type StorageV2Server interface {
// Allows to Read Objects using stream
ReadObject(*StorageV2ReadObjectRequest, StorageV2_ReadObjectServer) error
// Allows to Write Objects using stream
WriteObject(StorageV2_WriteObjectServer) error
// Gets basic info about object
HeadObject(context.Context, *StorageV2HeadObjectRequest) (*StorageV2HeadObjectResponse, error)
// Deletes object
DeleteObject(context.Context, *StorageV2DeleteObjectRequest) (*StorageV2DeleteObjectResponse, error)
// List all objects in batches
ListObjects(*StorageV2ListObjectsRequest, StorageV2_ListObjectsServer) error
mustEmbedUnimplementedStorageV2Server()
}

View file

@ -41,6 +41,7 @@ import (
mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1"
mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1"
networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1"
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1"
replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1"
schedulerApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1"
@ -329,6 +330,15 @@ func Test_GenerateCRValidationSchemas(t *testing.T) {
},
},
},
"platform-storage": {
fmt.Sprintf("%s/pkg/apis/platform/v1alpha1", root): {
"v1alpha1": {
objects: map[string]interface{}{
"spec": platformApi.ArangoPlatformStorage{}.Spec,
},
},
},
},
}
for filePrefix, packagesToVersion := range input {

View file

@ -45,6 +45,7 @@ import (
mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1"
mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1"
networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1"
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
replicationApi "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1"
schedulerApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1"
schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1"
@ -347,6 +348,18 @@ func Test_GenerateAPIDocs(t *testing.T) {
},
},
},
"platform": map[string]inputPackage{
"v1alpha1": {
Types: inputPackageTypes{
"ArangoPlatformStorage.V1Alpha1": {
"Spec": platformApi.ArangoPlatformStorage{}.Spec,
},
},
Shared: []string{
"shared/v1",
},
},
},
}
for name, versions := range input {

View file

@ -0,0 +1,29 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package platform
const (
ArangoPlatformStorageCRDName = ArangoPlatformStorageResourcePlural + "." + ArangoPlatformGroupName
ArangoPlatformStorageResourceKind = "ArangoPlatformStorage"
ArangoPlatformStorageResourcePlural = "arangoplatformstorages"
ArangoPlatformGroupName = "platform.arangodb.com"
)

View file

@ -0,0 +1,28 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
const (
SpecValidCondition api.ConditionType = "SpecValid"
ReadyCondition api.ConditionType = "Ready"
)

View file

@ -0,0 +1,23 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// +k8s:deepcopy-gen=package
// +groupName=platform.arangodb.com
package v1alpha1

View file

@ -0,0 +1,55 @@
//
// DISCLAIMER
//
// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import (
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/arangodb/kube-arangodb/pkg/apis/networking"
)
const (
ArangoPlatformVersion = "v1alpha1"
)
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
SchemeGroupVersion = schema.GroupVersion{Group: networking.ArangoNetworkingGroupName, Version: ArangoPlatformVersion}
)
// Resource gets an ArangoCluster GroupResource for a specified resource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
// addKnownTypes adds the set of types defined in this package to the supplied scheme.
func addKnownTypes(s *runtime.Scheme) error {
s.AddKnownTypes(SchemeGroupVersion,
&ArangoPlatformStorage{},
&ArangoPlatformStorageList{},
)
meta.AddToGroupVersion(s, SchemeGroupVersion)
return nil
}

View file

@ -0,0 +1,69 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import (
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/arangodb/kube-arangodb/pkg/apis/networking"
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ArangoPlatformStorageList is a list of ArangoPlatform Storage.
type ArangoPlatformStorageList struct {
meta.TypeMeta `json:",inline"`
meta.ListMeta `json:"metadata,omitempty"`
Items []ArangoPlatformStorage `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ArangoPlatformStorage contains definition and status of the ArangoPlatform Storage.
type ArangoPlatformStorage struct {
meta.TypeMeta `json:",inline"`
meta.ObjectMeta `json:"metadata,omitempty"`
Spec ArangoPlatformStorageSpec `json:"spec"`
Status ArangoPlatformStorageStatus `json:"status"`
}
// AsOwner creates an OwnerReference for the given Extension
func (a *ArangoPlatformStorage) AsOwner() meta.OwnerReference {
trueVar := true
return meta.OwnerReference{
APIVersion: SchemeGroupVersion.String(),
Kind: networking.ArangoRouteResourceKind,
Name: a.Name,
UID: a.UID,
Controller: &trueVar,
}
}
func (a *ArangoPlatformStorage) GetStatus() ArangoPlatformStorageStatus {
return a.Status
}
func (a *ArangoPlatformStorage) SetStatus(status ArangoPlatformStorageStatus) {
a.Status = status
}

View file

@ -0,0 +1,62 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import (
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
)
type ArangoPlatformStorageSpec struct {
// Deployment specifies the ArangoDeployment object name
Deployment *string `json:"deployment,omitempty"`
// Backend defines how storage is implemented
Backend *ArangoPlatformStorageSpecBackend `json:"backend,omitempty"`
}
func (s *ArangoPlatformStorageSpec) GetDeployment() string {
if s == nil || s.Deployment == nil {
return ""
}
return *s.Deployment
}
func (s *ArangoPlatformStorageSpec) GetBackend() *ArangoPlatformStorageSpecBackend {
if s == nil || s.Backend == nil {
return nil
}
return s.Backend
}
func (s *ArangoPlatformStorageSpec) Validate() error {
if s == nil {
s = &ArangoPlatformStorageSpec{}
}
if err := shared.WithErrors(shared.PrefixResourceErrors("spec",
shared.PrefixResourceError("backend", s.Backend.Validate()),
)); err != nil {
return err
}
return nil
}

View file

@ -0,0 +1,50 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import (
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
"github.com/arangodb/kube-arangodb/pkg/util/errors"
)
type ArangoPlatformStorageSpecBackend struct {
// S3 backend implements storage as a proxy to the provided S3 API endpoint
S3 *ArangoPlatformStorageSpecBackendS3 `json:"s3,omitempty"`
}
func (s *ArangoPlatformStorageSpecBackend) GetS3() *ArangoPlatformStorageSpecBackendS3 {
if s == nil || s.S3 == nil {
return nil
}
return s.S3
}
func (s *ArangoPlatformStorageSpecBackend) Validate() error {
if s == nil {
return errors.Errorf("Backend is not specified")
}
if s.S3 == nil {
return errors.Errorf("At least one backend needs to be defined")
}
return shared.WithErrors(shared.PrefixResourceError("s3", s.S3.Validate()))
}

View file

@ -0,0 +1,132 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import (
"net/url"
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
"github.com/arangodb/kube-arangodb/pkg/util/errors"
)
type ArangoPlatformStorageSpecBackendS3 struct {
// BucketName specifies the name of the bucket
// Required
BucketName *string `json:"bucketName,omitempty"`
// BucketPath specifies the Prefix within the bucket
// +doc/default:
BucketPrefix *string `json:"bucketPath,omitempty"`
// Endpoint specifies the S3 API-compatible endpoint which implements storage
// Required
Endpoint *string `json:"endpoint"`
// CredentialsSecret specifies the Kubernetes Secret containing AccessKey and SecretKey for S3 API authorization
// Required
CredentialsSecret *sharedApi.Object `json:"credentialsSecret"`
// AllowInsecure if set to true, the Endpoint certificates won't be checked
// +doc/default: false
AllowInsecure *bool `json:"allowInsecure,omitempty"`
// CASecret if not empty, the given Kubernetes Secret will be used to check the authenticity of Endpoint
// The specified Secret, must contain the following data fields:
// - `ca.crt` PEM encoded public key of the CA certificate
// - `ca.key` PEM encoded private key of the CA certificate
// +doc/default: nil
CASecret *sharedApi.Object `json:"caSecret,omitempty"`
// Region defines the availability zone name.
// +doc/default: ""
Region *string `json:"region,omitempty"`
}
func (s *ArangoPlatformStorageSpecBackendS3) Validate() error {
if s == nil {
s = &ArangoPlatformStorageSpecBackendS3{}
}
var errs []error
if s.GetEndpoint() == "" {
errs = append(errs, shared.PrefixResourceErrors("endpoint", errors.New("must be not empty")))
}
if _, err := url.Parse(s.GetEndpoint()); err != nil {
errs = append(errs, shared.PrefixResourceErrors("endpoint", errors.Errorf("invalid URL: %s", err.Error())))
}
errs = append(errs,
shared.PrefixResourceErrors("credentialsSecret", s.GetCredentialsSecret().Validate()),
shared.PrefixResourceError("bucket", shared.ValidateRequired(s.BucketName, shared.ValidateResourceName)),
)
if caSecret := s.GetCASecret(); !caSecret.IsEmpty() {
errs = append(errs, shared.PrefixResourceErrors("caSecret", caSecret.Validate()))
}
return shared.WithErrors(errs...)
}
func (s *ArangoPlatformStorageSpecBackendS3) GetBucketName() string {
if s == nil || s.BucketName == nil {
return ""
}
return *s.BucketName
}
func (s *ArangoPlatformStorageSpecBackendS3) GetBucketPrefix() string {
if s == nil || s.BucketPrefix == nil {
return ""
}
return *s.BucketPrefix
}
func (s *ArangoPlatformStorageSpecBackendS3) GetEndpoint() string {
if s == nil || s.Endpoint == nil {
return ""
}
return *s.Endpoint
}
func (s *ArangoPlatformStorageSpecBackendS3) GetCredentialsSecret() *sharedApi.Object {
if s == nil || s.CredentialsSecret == nil {
return &sharedApi.Object{}
}
return s.CredentialsSecret
}
func (s *ArangoPlatformStorageSpecBackendS3) GetAllowInsecure() bool {
if s == nil || s.AllowInsecure == nil {
return false
}
return *s.AllowInsecure
}
func (s *ArangoPlatformStorageSpecBackendS3) GetCASecret() *sharedApi.Object {
if s == nil || s.CASecret == nil {
return &sharedApi.Object{}
}
return s.CASecret
}
func (s *ArangoPlatformStorageSpecBackendS3) GetRegion() string {
if s == nil || s.Region == nil {
return ""
}
return *s.Region
}

View file

@ -0,0 +1,60 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import (
"github.com/arangodb/kube-arangodb/pkg/util/errors"
)
type ArangoPlatformStorageSpecModeType int
const (
ArangoPlatformStorageSpecModeTypeUnknown ArangoPlatformStorageSpecModeType = iota
ArangoPlatformStorageSpecModeTypeSidecar
)
type ArangoPlatformStorageSpecMode struct {
// Sidecar mode runs the storage implementation as a sidecar
Sidecar *ArangoPlatformStorageSpecModeSidecar `json:"sidecar,omitempty"`
}
func (s *ArangoPlatformStorageSpecMode) GetSidecar() *ArangoPlatformStorageSpecModeSidecar {
if s == nil || s.Sidecar == nil {
return nil
}
return s.Sidecar
}
func (s *ArangoPlatformStorageSpecMode) GetType() ArangoPlatformStorageSpecModeType {
return ArangoPlatformStorageSpecModeTypeSidecar
}
func (s *ArangoPlatformStorageSpecMode) Validate() error {
if s == nil {
s = &ArangoPlatformStorageSpecMode{}
}
if s.GetType() == ArangoPlatformStorageSpecModeTypeUnknown {
return errors.Errorf("Unknown mode type")
}
return nil
}

View file

@ -0,0 +1,24 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
type ArangoPlatformStorageSpecModeSidecar struct {
}

View file

@ -0,0 +1,51 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import (
"testing"
"github.com/stretchr/testify/require"
sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
"github.com/arangodb/kube-arangodb/pkg/util"
)
func Test_ArangoPlatformStorageSpec(t *testing.T) {
s := ArangoPlatformStorageSpec{}
require.Nil(t, s.GetBackend())
require.Error(t, s.Validate())
s.Backend = &ArangoPlatformStorageSpecBackend{}
require.Nil(t, s.Backend.GetS3())
require.Error(t, s.Validate())
require.Error(t, s.Backend.S3.Validate())
s.Backend.S3 = &ArangoPlatformStorageSpecBackendS3{
Endpoint: util.NewType("http://test.s3.example.com"),
CredentialsSecret: &sharedApi.Object{
Name: "a-secret",
Namespace: nil,
},
BucketName: util.NewType("bucket"),
}
require.NoError(t, s.Validate())
}

View file

@ -0,0 +1,35 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import (
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
)
type ArangoPlatformStorageStatus struct {
// Conditions specific to the entire storage
// +doc/type: api.Conditions
Conditions api.ConditionList `json:"conditions,omitempty"`
// Deployment keeps the ArangoDeployment reference
Deployment *sharedApi.Object `json:"deployment,omitempty"`
}

View file

@ -0,0 +1,256 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
import (
deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
v1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoPlatformStorage) DeepCopyInto(out *ArangoPlatformStorage) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoPlatformStorage.
func (in *ArangoPlatformStorage) DeepCopy() *ArangoPlatformStorage {
if in == nil {
return nil
}
out := new(ArangoPlatformStorage)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ArangoPlatformStorage) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoPlatformStorageList) DeepCopyInto(out *ArangoPlatformStorageList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ArangoPlatformStorage, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoPlatformStorageList.
func (in *ArangoPlatformStorageList) DeepCopy() *ArangoPlatformStorageList {
if in == nil {
return nil
}
out := new(ArangoPlatformStorageList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ArangoPlatformStorageList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoPlatformStorageSpec) DeepCopyInto(out *ArangoPlatformStorageSpec) {
*out = *in
if in.Deployment != nil {
in, out := &in.Deployment, &out.Deployment
*out = new(string)
**out = **in
}
if in.Backend != nil {
in, out := &in.Backend, &out.Backend
*out = new(ArangoPlatformStorageSpecBackend)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoPlatformStorageSpec.
func (in *ArangoPlatformStorageSpec) DeepCopy() *ArangoPlatformStorageSpec {
if in == nil {
return nil
}
out := new(ArangoPlatformStorageSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoPlatformStorageSpecBackend) DeepCopyInto(out *ArangoPlatformStorageSpecBackend) {
*out = *in
if in.S3 != nil {
in, out := &in.S3, &out.S3
*out = new(ArangoPlatformStorageSpecBackendS3)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoPlatformStorageSpecBackend.
func (in *ArangoPlatformStorageSpecBackend) DeepCopy() *ArangoPlatformStorageSpecBackend {
if in == nil {
return nil
}
out := new(ArangoPlatformStorageSpecBackend)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoPlatformStorageSpecBackendS3) DeepCopyInto(out *ArangoPlatformStorageSpecBackendS3) {
*out = *in
if in.BucketName != nil {
in, out := &in.BucketName, &out.BucketName
*out = new(string)
**out = **in
}
if in.BucketPrefix != nil {
in, out := &in.BucketPrefix, &out.BucketPrefix
*out = new(string)
**out = **in
}
if in.Endpoint != nil {
in, out := &in.Endpoint, &out.Endpoint
*out = new(string)
**out = **in
}
if in.CredentialsSecret != nil {
in, out := &in.CredentialsSecret, &out.CredentialsSecret
*out = new(v1.Object)
(*in).DeepCopyInto(*out)
}
if in.AllowInsecure != nil {
in, out := &in.AllowInsecure, &out.AllowInsecure
*out = new(bool)
**out = **in
}
if in.CASecret != nil {
in, out := &in.CASecret, &out.CASecret
*out = new(v1.Object)
(*in).DeepCopyInto(*out)
}
if in.Region != nil {
in, out := &in.Region, &out.Region
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoPlatformStorageSpecBackendS3.
func (in *ArangoPlatformStorageSpecBackendS3) DeepCopy() *ArangoPlatformStorageSpecBackendS3 {
if in == nil {
return nil
}
out := new(ArangoPlatformStorageSpecBackendS3)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoPlatformStorageSpecMode) DeepCopyInto(out *ArangoPlatformStorageSpecMode) {
*out = *in
if in.Sidecar != nil {
in, out := &in.Sidecar, &out.Sidecar
*out = new(ArangoPlatformStorageSpecModeSidecar)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoPlatformStorageSpecMode.
func (in *ArangoPlatformStorageSpecMode) DeepCopy() *ArangoPlatformStorageSpecMode {
if in == nil {
return nil
}
out := new(ArangoPlatformStorageSpecMode)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoPlatformStorageSpecModeSidecar) DeepCopyInto(out *ArangoPlatformStorageSpecModeSidecar) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoPlatformStorageSpecModeSidecar.
func (in *ArangoPlatformStorageSpecModeSidecar) DeepCopy() *ArangoPlatformStorageSpecModeSidecar {
if in == nil {
return nil
}
out := new(ArangoPlatformStorageSpecModeSidecar)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoPlatformStorageStatus) DeepCopyInto(out *ArangoPlatformStorageStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make(deploymentv1.ConditionList, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Deployment != nil {
in, out := &in.Deployment, &out.Deployment
*out = new(v1.Object)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoPlatformStorageStatus.
func (in *ArangoPlatformStorageStatus) DeepCopy() *ArangoPlatformStorageStatus {
if in == nil {
return nil
}
out := new(ArangoPlatformStorageStatus)
in.DeepCopyInto(out)
return out
}

View file

@ -97,6 +97,9 @@ func AllDefinitions() []Definition {
// Networking
NetworkingRouteDefinitionWithOptions(),
// Platform
PlatformStorageDefinitionWithOptions(),
}
}

View file

@ -153,6 +153,7 @@ func Test_CRDGetters(t *testing.T) {
SchedulerCronJobWithOptions,
AnalyticsGAEWithOptions,
NetworkingRouteWithOptions,
PlatformStorageWithOptions,
}
require.Equal(t, len(AllDefinitions()), len(getters))

View file

@ -0,0 +1,51 @@
//
// DISCLAIMER
//
// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package crds
import (
_ "embed"
apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
func PlatformStorageWithOptions(opts ...func(*CRDOptions)) *apiextensions.CustomResourceDefinition {
return getCRD(PlatformStorageDefinitionData(), opts...)
}
func PlatformStorageDefinitionWithOptions(opts ...func(*CRDOptions)) Definition {
return Definition{
DefinitionData: PlatformStorageDefinitionData(),
CRD: PlatformStorageWithOptions(opts...),
}
}
func PlatformStorageDefinitionData() DefinitionData {
return DefinitionData{
definition: platformStorage,
schemaDefinition: platformStorageSchemaRaw,
}
}
//go:embed platform-storage.yaml
var platformStorage []byte
//go:embed platform-storage.schema.generated.yaml
var platformStorageSchemaRaw []byte

View file

@ -0,0 +1,79 @@
v1alpha1:
openAPIV3Schema:
properties:
spec:
properties:
backend:
description: Backend defines how storage is implemented
properties:
s3:
description: S3 backend implements storage as a proxy to the provided S3 API endpoint
properties:
allowInsecure:
description: AllowInsecure if set to true, the Endpoint certificates won't be checked
type: boolean
bucketName:
description: |-
BucketName specifies the name of the bucket
Required
type: string
bucketPath:
description: BucketPath specifies the Prefix within the bucket
type: string
caSecret:
description: |-
CASecret if not empty, the given Kubernetes Secret will be used to check the authenticity of Endpoint
The specified Secret, must contain the following data fields:
- `ca.crt` PEM encoded public key of the CA certificate
- `ca.key` PEM encoded private key of the CA certificate
properties:
checksum:
description: UID keeps the information about object Checksum
type: string
name:
description: Name of the object
type: string
namespace:
description: Namespace of the object. Should default to the namespace of the parent object
type: string
uid:
description: UID keeps the information about object UID
type: string
type: object
credentialsSecret:
description: |-
CredentialsSecret specifies the Kubernetes Secret containing AccessKey and SecretKey for S3 API authorization
Required
properties:
checksum:
description: UID keeps the information about object Checksum
type: string
name:
description: Name of the object
type: string
namespace:
description: Namespace of the object. Should default to the namespace of the parent object
type: string
uid:
description: UID keeps the information about object UID
type: string
type: object
endpoint:
description: |-
Endpoint specifies the S3 API-compatible endpoint which implements storage
Required
type: string
region:
description: Region defines the availability zone name.
type: string
type: object
type: object
deployment:
description: Deployment specifies the ArangoDeployment object name
type: string
type: object
status:
description: Object with preserved fields for backward compatibility
type: object
x-kubernetes-preserve-unknown-fields: true
type: object

View file

@ -0,0 +1,22 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: arangoplatformstorages.platform.arangodb.com
spec:
group: platform.arangodb.com
names:
kind: ArangoPlatformStorage
listKind: ArangoPlatformStorageList
plural: arangoplatformstorages
singular: arangoplatformstorage
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: true
subresources:
status: {}

40
pkg/crd/platform.go Normal file
View file

@ -0,0 +1,40 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package crd
import (
"github.com/arangodb/kube-arangodb/pkg/crd/crds"
)
func init() {
defs := []func(...func(options *crds.CRDOptions)) crds.Definition{
crds.PlatformStorageDefinitionWithOptions,
}
for _, getDef := range defs {
defFn := getDef // bring into scope
registerCRDWithPanic(func(opts *crds.CRDOptions) crds.Definition {
return defFn(opts.AsFunc())
}, &crds.CRDOptions{
WithSchema: true,
WithPreserve: false,
})
}
}

View file

@ -0,0 +1,126 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package inspector
import (
"context"
"time"
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
"github.com/arangodb/kube-arangodb/pkg/util/errors"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoplatformstorage"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/definitions"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/version"
)
func init() {
requireRegisterInspectorLoader(arangoPlatformStoragesInspectorLoaderObj)
}
var arangoPlatformStoragesInspectorLoaderObj = arangoPlatformStoragesInspectorLoader{}
type arangoPlatformStoragesInspectorLoader struct {
}
func (p arangoPlatformStoragesInspectorLoader) Component() definitions.Component {
return definitions.ArangoPlatformStorage
}
func (p arangoPlatformStoragesInspectorLoader) Load(ctx context.Context, i *inspectorState) {
var q arangoPlatformStoragesInspector
q.v1alpha1 = newInspectorVersion[*platformApi.ArangoPlatformStorageList, *platformApi.ArangoPlatformStorage](ctx,
constants.ArangoPlatformStorageGRv1(),
constants.ArangoPlatformStorageGKv1(),
i.client.Arango().PlatformV1alpha1().ArangoPlatformStorages(i.namespace),
arangoplatformstorage.List())
i.arangoPlatformStorages = &q
q.state = i
q.last = time.Now()
}
func (p arangoPlatformStoragesInspectorLoader) Verify(i *inspectorState) error {
return nil
}
func (p arangoPlatformStoragesInspectorLoader) Copy(from, to *inspectorState, override bool) {
if to.arangoPlatformStorages != nil {
if !override {
return
}
}
to.arangoPlatformStorages = from.arangoPlatformStorages
to.arangoPlatformStorages.state = to
}
func (p arangoPlatformStoragesInspectorLoader) Name() string {
return "arangoPlatformStorages"
}
type arangoPlatformStoragesInspector struct {
state *inspectorState
last time.Time
v1alpha1 *inspectorVersion[*platformApi.ArangoPlatformStorage]
}
func (p *arangoPlatformStoragesInspector) LastRefresh() time.Time {
return p.last
}
func (p *arangoPlatformStoragesInspector) Refresh(ctx context.Context) error {
p.Throttle(p.state.throttles).Invalidate()
return p.state.refresh(ctx, arangoPlatformStoragesInspectorLoaderObj)
}
func (p *arangoPlatformStoragesInspector) Version() version.Version {
return version.V1
}
func (p *arangoPlatformStoragesInspector) Throttle(c throttle.Components) throttle.Throttle {
return c.ArangoPlatformStorage()
}
func (p *arangoPlatformStoragesInspector) validate() error {
if p == nil {
return errors.Errorf("ArangoPlatformStorageInspector is nil")
}
if p.state == nil {
return errors.Errorf("Parent is nil")
}
return p.v1alpha1.validate()
}
func (p *arangoPlatformStoragesInspector) V1Alpha1() (generic.Inspector[*platformApi.ArangoPlatformStorage], error) {
if p.v1alpha1.err != nil {
return nil, p.v1alpha1.err
}
return p.v1alpha1, nil
}

View file

@ -0,0 +1,45 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package inspector
import (
"k8s.io/apimachinery/pkg/runtime/schema"
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants"
)
func (p *arangoPlatformStoragesInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) {
g := constants.ArangoPlatformStorageGKv1()
if g.Kind == gvk.Kind && g.Group == gvk.Group {
switch gvk.Version {
case constants.ArangoPlatformStorageVersionV1Beta1, DefaultVersion:
if p.v1alpha1 == nil || p.v1alpha1.err != nil {
return nil, false
}
return anonymous.NewAnonymous[*platformApi.ArangoPlatformStorage](g, p.state.arangoPlatformStorages.v1alpha1, p.state.ArangoPlatformStorageModInterface().V1Alpha1()), true
}
}
return nil, false
}

View file

@ -0,0 +1,35 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package inspector
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants"
)
func (p *arangoPlatformStoragesInspector) GroupKind() schema.GroupKind {
return constants.ArangoPlatformStorageGK()
}
func (p *arangoPlatformStoragesInspector) GroupResource() schema.GroupResource {
return constants.ArangoPlatformStorageGR()
}

View file

@ -0,0 +1,46 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package inspector
import (
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/definitions"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/mods"
)
func (i *inspectorState) ArangoPlatformStorageModInterface() mods.ArangoPlatformStorageMods {
return arangoPlatformStorageMod{
i: i,
}
}
type arangoPlatformStorageMod struct {
i *inspectorState
}
func (p arangoPlatformStorageMod) V1Alpha1() generic.ModStatusClient[*platformApi.ArangoPlatformStorage] {
return wrapMod[*platformApi.ArangoPlatformStorage](definitions.ArangoPlatformStorage, p.i.GetThrottles, p.clientv1beta1)
}
func (p arangoPlatformStorageMod) clientv1beta1() generic.ModStatusClient[*platformApi.ArangoPlatformStorage] {
return p.i.Client().Arango().PlatformV1alpha1().ArangoPlatformStorages(p.i.Namespace())
}

View file

@ -42,6 +42,7 @@ import (
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoclustersynchronization"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoplatformstorage"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoprofile"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask"
@ -139,6 +140,7 @@ type inspectorState struct {
arangoMembers *arangoMembersInspector
arangoTasks *arangoTasksInspector
arangoProfiles *arangoProfilesInspector
arangoPlatformStorages *arangoPlatformStoragesInspector
arangoRoutes *arangoRoutesInspector
arangoClusterSynchronizations *arangoClusterSynchronizationsInspector
endpoints *endpointsInspector
@ -178,6 +180,10 @@ func (i *inspectorState) RegisterInformers(k8s informers.SharedInformerFactory,
arango.Scheduler().V1beta1().ArangoProfiles().Informer().AddEventHandler(i.eventHandler(definitions.ArangoProfile))
}
if _, err := i.ArangoPlatformStorage().V1Alpha1(); err == nil {
arango.Platform().V1alpha1().ArangoPlatformStorages().Informer().AddEventHandler(i.eventHandler(definitions.ArangoPlatformStorage))
}
if _, err := i.ArangoRoute().V1Alpha1(); err == nil {
arango.Networking().V1alpha1().ArangoRoutes().Informer().AddEventHandler(i.eventHandler(definitions.ArangoRoute))
}
@ -346,6 +352,10 @@ func (i *inspectorState) ArangoProfile() arangoprofile.Definition {
return i.arangoProfiles
}
func (i *inspectorState) ArangoPlatformStorage() arangoplatformstorage.Definition {
return i.arangoPlatformStorages
}
func (i *inspectorState) Refresh(ctx context.Context) error {
return i.refresh(ctx, inspectorLoadersList...)
}
@ -505,6 +515,10 @@ func (i *inspectorState) validate() error {
return err
}
if err := i.arangoPlatformStorages.validate(); err != nil {
return err
}
if err := i.arangoTasks.validate(); err != nil {
return err
}
@ -539,6 +553,7 @@ func (i *inspectorState) copyCore() *inspectorState {
arangoTasks: i.arangoTasks,
arangoRoutes: i.arangoRoutes,
arangoProfiles: i.arangoProfiles,
arangoPlatformStorages: i.arangoPlatformStorages,
arangoClusterSynchronizations: i.arangoClusterSynchronizations,
throttles: i.throttles.Copy(),
versionInfo: i.versionInfo,

View file

@ -142,7 +142,7 @@ func getAllTypes() []string {
func Test_Inspector_RefreshMatrix(t *testing.T) {
c := kclient.NewFakeClient()
tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour)
tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour)
i := NewInspector(tc, c, "test", "test")
@ -302,7 +302,7 @@ func Test_Inspector_Load(t *testing.T) {
func Test_Inspector_Invalidate(t *testing.T) {
c := kclient.NewFakeClient()
tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour)
tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour)
i := NewInspector(tc, c, "test", "test")

View file

@ -52,7 +52,7 @@ func Test_PDB_Versions(t *testing.T) {
GitVersion: v,
})
tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour)
tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour)
i := NewInspector(tc, c, "test", "test")
require.NoError(t, i.Refresh(context.Background()))

View file

@ -33,6 +33,7 @@ func NewDefaultThrottle() throttle.Components {
30*time.Second, // ArangoTask
30*time.Second, // ArangoRoute
30*time.Second, // ArangoProfile
30*time.Second, // ArangoPlatformStorage
30*time.Second, // Node
30*time.Second, // PV
15*time.Second, // PVC

View file

@ -754,7 +754,6 @@ func (r *Resources) EnsurePods(ctx context.Context, cachedStatus inspectorInterf
iterator := r.context.GetServerGroupIterator()
deploymentStatus := r.context.GetStatus()
imageNotFoundOnce := &sync.Once{}
changed := false
log := r.log.Str("section", "member")
@ -784,19 +783,15 @@ func (r *Resources) EnsurePods(ctx context.Context, cachedStatus inspectorInterf
return errors.WithStack(err)
}
changed = true
if err := cachedStatus.Refresh(ctx); err != nil {
return err
}
}
return nil
}, &deploymentStatus); err != nil {
return errors.WithStack(err)
}
if changed {
if err := cachedStatus.Refresh(ctx); err != nil {
return err
}
}
return nil
}

View file

@ -34,6 +34,7 @@ import (
mlv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/ml/v1alpha1"
mlv1beta1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/ml/v1beta1"
networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/networking/v1alpha1"
platformv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/platform/v1alpha1"
replicationv1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v1"
replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v2alpha1"
schedulerv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/scheduler/v1alpha1"
@ -54,6 +55,7 @@ type Interface interface {
MlV1alpha1() mlv1alpha1.MlV1alpha1Interface
MlV1beta1() mlv1beta1.MlV1beta1Interface
NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface
PlatformV1alpha1() platformv1alpha1.PlatformV1alpha1Interface
ReplicationV1() replicationv1.ReplicationV1Interface
ReplicationV2alpha1() replicationv2alpha1.ReplicationV2alpha1Interface
SchedulerV1alpha1() schedulerv1alpha1.SchedulerV1alpha1Interface
@ -72,6 +74,7 @@ type Clientset struct {
mlV1alpha1 *mlv1alpha1.MlV1alpha1Client
mlV1beta1 *mlv1beta1.MlV1beta1Client
networkingV1alpha1 *networkingv1alpha1.NetworkingV1alpha1Client
platformV1alpha1 *platformv1alpha1.PlatformV1alpha1Client
replicationV1 *replicationv1.ReplicationV1Client
replicationV2alpha1 *replicationv2alpha1.ReplicationV2alpha1Client
schedulerV1alpha1 *schedulerv1alpha1.SchedulerV1alpha1Client
@ -119,6 +122,11 @@ func (c *Clientset) NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1In
return c.networkingV1alpha1
}
// PlatformV1alpha1 retrieves the PlatformV1alpha1Client
func (c *Clientset) PlatformV1alpha1() platformv1alpha1.PlatformV1alpha1Interface {
return c.platformV1alpha1
}
// ReplicationV1 retrieves the ReplicationV1Client
func (c *Clientset) ReplicationV1() replicationv1.ReplicationV1Interface {
return c.replicationV1
@ -220,6 +228,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
if err != nil {
return nil, err
}
cs.platformV1alpha1, err = platformv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.replicationV1, err = replicationv1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
@ -269,6 +281,7 @@ func New(c rest.Interface) *Clientset {
cs.mlV1alpha1 = mlv1alpha1.New(c)
cs.mlV1beta1 = mlv1beta1.New(c)
cs.networkingV1alpha1 = networkingv1alpha1.New(c)
cs.platformV1alpha1 = platformv1alpha1.New(c)
cs.replicationV1 = replicationv1.New(c)
cs.replicationV2alpha1 = replicationv2alpha1.New(c)
cs.schedulerV1alpha1 = schedulerv1alpha1.New(c)

View file

@ -40,6 +40,8 @@ import (
fakemlv1beta1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/ml/v1beta1/fake"
networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/networking/v1alpha1"
fakenetworkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake"
platformv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/platform/v1alpha1"
fakeplatformv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/platform/v1alpha1/fake"
replicationv1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v1"
fakereplicationv1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v1/fake"
replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v2alpha1"
@ -151,6 +153,11 @@ func (c *Clientset) NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1In
return &fakenetworkingv1alpha1.FakeNetworkingV1alpha1{Fake: &c.Fake}
}
// PlatformV1alpha1 retrieves the PlatformV1alpha1Client
func (c *Clientset) PlatformV1alpha1() platformv1alpha1.PlatformV1alpha1Interface {
return &fakeplatformv1alpha1.FakePlatformV1alpha1{Fake: &c.Fake}
}
// ReplicationV1 retrieves the ReplicationV1Client
func (c *Clientset) ReplicationV1() replicationv1.ReplicationV1Interface {
return &fakereplicationv1.FakeReplicationV1{Fake: &c.Fake}

View file

@ -31,6 +31,7 @@ import (
mlv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1"
mlv1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1"
networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1"
platformv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1"
replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1"
schedulerv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1"
@ -55,6 +56,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
mlv1alpha1.AddToScheme,
mlv1beta1.AddToScheme,
networkingv1alpha1.AddToScheme,
platformv1alpha1.AddToScheme,
replicationv1.AddToScheme,
replicationv2alpha1.AddToScheme,
schedulerv1alpha1.AddToScheme,

View file

@ -31,6 +31,7 @@ import (
mlv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1"
mlv1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1"
networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1"
platformv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1"
replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1"
schedulerv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1"
@ -55,6 +56,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
mlv1alpha1.AddToScheme,
mlv1beta1.AddToScheme,
networkingv1alpha1.AddToScheme,
platformv1alpha1.AddToScheme,
replicationv1.AddToScheme,
replicationv2alpha1.AddToScheme,
schedulerv1alpha1.AddToScheme,

View file

@ -0,0 +1,73 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
v1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
scheme "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
gentype "k8s.io/client-go/gentype"
)
// ArangoPlatformStoragesGetter has a method to return a ArangoPlatformStorageInterface.
// A group's client should implement this interface.
type ArangoPlatformStoragesGetter interface {
ArangoPlatformStorages(namespace string) ArangoPlatformStorageInterface
}
// ArangoPlatformStorageInterface has methods to work with ArangoPlatformStorage resources.
type ArangoPlatformStorageInterface interface {
Create(ctx context.Context, arangoPlatformStorage *v1alpha1.ArangoPlatformStorage, opts v1.CreateOptions) (*v1alpha1.ArangoPlatformStorage, error)
Update(ctx context.Context, arangoPlatformStorage *v1alpha1.ArangoPlatformStorage, opts v1.UpdateOptions) (*v1alpha1.ArangoPlatformStorage, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, arangoPlatformStorage *v1alpha1.ArangoPlatformStorage, opts v1.UpdateOptions) (*v1alpha1.ArangoPlatformStorage, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ArangoPlatformStorage, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ArangoPlatformStorageList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ArangoPlatformStorage, err error)
ArangoPlatformStorageExpansion
}
// arangoPlatformStorages implements ArangoPlatformStorageInterface
type arangoPlatformStorages struct {
*gentype.ClientWithList[*v1alpha1.ArangoPlatformStorage, *v1alpha1.ArangoPlatformStorageList]
}
// newArangoPlatformStorages returns a ArangoPlatformStorages
func newArangoPlatformStorages(c *PlatformV1alpha1Client, namespace string) *arangoPlatformStorages {
return &arangoPlatformStorages{
gentype.NewClientWithList[*v1alpha1.ArangoPlatformStorage, *v1alpha1.ArangoPlatformStorageList](
"arangoplatformstorages",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *v1alpha1.ArangoPlatformStorage { return &v1alpha1.ArangoPlatformStorage{} },
func() *v1alpha1.ArangoPlatformStorageList { return &v1alpha1.ArangoPlatformStorageList{} }),
}
}

View file

@ -0,0 +1,24 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1

View file

@ -0,0 +1,24 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake

View file

@ -0,0 +1,151 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeArangoPlatformStorages implements ArangoPlatformStorageInterface
type FakeArangoPlatformStorages struct {
Fake *FakePlatformV1alpha1
ns string
}
var arangoplatformstoragesResource = v1alpha1.SchemeGroupVersion.WithResource("arangoplatformstorages")
var arangoplatformstoragesKind = v1alpha1.SchemeGroupVersion.WithKind("ArangoPlatformStorage")
// Get takes name of the arangoPlatformStorage, and returns the corresponding arangoPlatformStorage object, and an error if there is any.
func (c *FakeArangoPlatformStorages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ArangoPlatformStorage, err error) {
emptyResult := &v1alpha1.ArangoPlatformStorage{}
obj, err := c.Fake.
Invokes(testing.NewGetActionWithOptions(arangoplatformstoragesResource, c.ns, name, options), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v1alpha1.ArangoPlatformStorage), err
}
// List takes label and field selectors, and returns the list of ArangoPlatformStorages that match those selectors.
func (c *FakeArangoPlatformStorages) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ArangoPlatformStorageList, err error) {
emptyResult := &v1alpha1.ArangoPlatformStorageList{}
obj, err := c.Fake.
Invokes(testing.NewListActionWithOptions(arangoplatformstoragesResource, arangoplatformstoragesKind, c.ns, opts), emptyResult)
if obj == nil {
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ArangoPlatformStorageList{ListMeta: obj.(*v1alpha1.ArangoPlatformStorageList).ListMeta}
for _, item := range obj.(*v1alpha1.ArangoPlatformStorageList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested arangoPlatformStorages.
func (c *FakeArangoPlatformStorages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchActionWithOptions(arangoplatformstoragesResource, c.ns, opts))
}
// Create takes the representation of a arangoPlatformStorage and creates it. Returns the server's representation of the arangoPlatformStorage, and an error, if there is any.
func (c *FakeArangoPlatformStorages) Create(ctx context.Context, arangoPlatformStorage *v1alpha1.ArangoPlatformStorage, opts v1.CreateOptions) (result *v1alpha1.ArangoPlatformStorage, err error) {
emptyResult := &v1alpha1.ArangoPlatformStorage{}
obj, err := c.Fake.
Invokes(testing.NewCreateActionWithOptions(arangoplatformstoragesResource, c.ns, arangoPlatformStorage, opts), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v1alpha1.ArangoPlatformStorage), err
}
// Update takes the representation of a arangoPlatformStorage and updates it. Returns the server's representation of the arangoPlatformStorage, and an error, if there is any.
func (c *FakeArangoPlatformStorages) Update(ctx context.Context, arangoPlatformStorage *v1alpha1.ArangoPlatformStorage, opts v1.UpdateOptions) (result *v1alpha1.ArangoPlatformStorage, err error) {
emptyResult := &v1alpha1.ArangoPlatformStorage{}
obj, err := c.Fake.
Invokes(testing.NewUpdateActionWithOptions(arangoplatformstoragesResource, c.ns, arangoPlatformStorage, opts), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v1alpha1.ArangoPlatformStorage), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeArangoPlatformStorages) UpdateStatus(ctx context.Context, arangoPlatformStorage *v1alpha1.ArangoPlatformStorage, opts v1.UpdateOptions) (result *v1alpha1.ArangoPlatformStorage, err error) {
emptyResult := &v1alpha1.ArangoPlatformStorage{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceActionWithOptions(arangoplatformstoragesResource, "status", c.ns, arangoPlatformStorage, opts), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v1alpha1.ArangoPlatformStorage), err
}
// Delete takes name of the arangoPlatformStorage and deletes it. Returns an error if one occurs.
func (c *FakeArangoPlatformStorages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(arangoplatformstoragesResource, c.ns, name, opts), &v1alpha1.ArangoPlatformStorage{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeArangoPlatformStorages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionActionWithOptions(arangoplatformstoragesResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ArangoPlatformStorageList{})
return err
}
// Patch applies the patch and returns the patched arangoPlatformStorage.
func (c *FakeArangoPlatformStorages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ArangoPlatformStorage, err error) {
emptyResult := &v1alpha1.ArangoPlatformStorage{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceActionWithOptions(arangoplatformstoragesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v1alpha1.ArangoPlatformStorage), err
}

View file

@ -0,0 +1,44 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/platform/v1alpha1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakePlatformV1alpha1 struct {
*testing.Fake
}
func (c *FakePlatformV1alpha1) ArangoPlatformStorages(namespace string) v1alpha1.ArangoPlatformStorageInterface {
return &FakeArangoPlatformStorages{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakePlatformV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View file

@ -0,0 +1,25 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
type ArangoPlatformStorageExpansion interface{}

View file

@ -0,0 +1,111 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"net/http"
v1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
"github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)
type PlatformV1alpha1Interface interface {
RESTClient() rest.Interface
ArangoPlatformStoragesGetter
}
// PlatformV1alpha1Client is used to interact with features provided by the platform.arangodb.com group.
type PlatformV1alpha1Client struct {
restClient rest.Interface
}
func (c *PlatformV1alpha1Client) ArangoPlatformStorages(namespace string) ArangoPlatformStorageInterface {
return newArangoPlatformStorages(c, namespace)
}
// NewForConfig creates a new PlatformV1alpha1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*PlatformV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new PlatformV1alpha1Client for the given config and http client.
// Note the http client provided takes precedence over the configured transport values.
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PlatformV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
return &PlatformV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new PlatformV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *PlatformV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new PlatformV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *PlatformV1alpha1Client {
return &PlatformV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *PlatformV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View file

@ -35,6 +35,7 @@ import (
internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces"
ml "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/ml"
networking "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/networking"
platform "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/platform"
replication "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/replication"
scheduler "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/scheduler"
storage "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/storage"
@ -272,6 +273,7 @@ type SharedInformerFactory interface {
Database() deployment.Interface
Ml() ml.Interface
Networking() networking.Interface
Platform() platform.Interface
Replication() replication.Interface
Scheduler() scheduler.Interface
Storage() storage.Interface
@ -301,6 +303,10 @@ func (f *sharedInformerFactory) Networking() networking.Interface {
return networking.New(f, f.namespace, f.tweakListOptions)
}
func (f *sharedInformerFactory) Platform() platform.Interface {
return platform.New(f, f.namespace, f.tweakListOptions)
}
func (f *sharedInformerFactory) Replication() replication.Interface {
return replication.New(f, f.namespace, f.tweakListOptions)
}

View file

@ -33,6 +33,7 @@ import (
mlv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1"
v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1"
networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1"
platformv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1"
replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1"
schedulerv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1"
@ -122,6 +123,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case networkingv1alpha1.SchemeGroupVersion.WithResource("arangoroutes"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().ArangoRoutes().Informer()}, nil
// Group=platform.arangodb.com, Version=v1alpha1
case platformv1alpha1.SchemeGroupVersion.WithResource("arangoplatformstorages"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Platform().V1alpha1().ArangoPlatformStorages().Informer()}, nil
// Group=replication.database.arangodb.com, Version=v1
case replicationv1.SchemeGroupVersion.WithResource("arangodeploymentreplications"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Replication().V1().ArangoDeploymentReplications().Informer()}, nil

View file

@ -0,0 +1,50 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by informer-gen. DO NOT EDIT.
package platform
import (
internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/platform/v1alpha1"
)
// Interface provides access to each of this group's versions.
type Interface interface {
// V1alpha1 provides access to shared informers for resources in V1alpha1.
V1alpha1() v1alpha1.Interface
}
type group struct {
factory internalinterfaces.SharedInformerFactory
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// New returns a new Interface.
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// V1alpha1 returns a new v1alpha1.Interface.
func (g *group) V1alpha1() v1alpha1.Interface {
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
}

View file

@ -0,0 +1,94 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
platformv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
versioned "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned"
internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/listers/platform/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// ArangoPlatformStorageInformer provides access to a shared informer and lister for
// ArangoPlatformStorages.
type ArangoPlatformStorageInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ArangoPlatformStorageLister
}
type arangoPlatformStorageInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewArangoPlatformStorageInformer constructs a new informer for ArangoPlatformStorage type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewArangoPlatformStorageInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredArangoPlatformStorageInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredArangoPlatformStorageInformer constructs a new informer for ArangoPlatformStorage type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredArangoPlatformStorageInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.PlatformV1alpha1().ArangoPlatformStorages(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.PlatformV1alpha1().ArangoPlatformStorages(namespace).Watch(context.TODO(), options)
},
},
&platformv1alpha1.ArangoPlatformStorage{},
resyncPeriod,
indexers,
)
}
func (f *arangoPlatformStorageInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredArangoPlatformStorageInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *arangoPlatformStorageInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&platformv1alpha1.ArangoPlatformStorage{}, f.defaultInformer)
}
func (f *arangoPlatformStorageInformer) Lister() v1alpha1.ArangoPlatformStorageLister {
return v1alpha1.NewArangoPlatformStorageLister(f.Informer().GetIndexer())
}

View file

@ -0,0 +1,49 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type Interface interface {
// ArangoPlatformStorages returns a ArangoPlatformStorageInformer.
ArangoPlatformStorages() ArangoPlatformStorageInformer
}
type version struct {
factory internalinterfaces.SharedInformerFactory
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// New returns a new Interface.
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// ArangoPlatformStorages returns a ArangoPlatformStorageInformer.
func (v *version) ArangoPlatformStorages() ArangoPlatformStorageInformer {
return &arangoPlatformStorageInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}

View file

@ -0,0 +1,74 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
// ArangoPlatformStorageLister helps list ArangoPlatformStorages.
// All objects returned here must be treated as read-only.
type ArangoPlatformStorageLister interface {
// List lists all ArangoPlatformStorages in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ArangoPlatformStorage, err error)
// ArangoPlatformStorages returns an object that can list and get ArangoPlatformStorages.
ArangoPlatformStorages(namespace string) ArangoPlatformStorageNamespaceLister
ArangoPlatformStorageListerExpansion
}
// arangoPlatformStorageLister implements the ArangoPlatformStorageLister interface.
type arangoPlatformStorageLister struct {
listers.ResourceIndexer[*v1alpha1.ArangoPlatformStorage]
}
// NewArangoPlatformStorageLister returns a new ArangoPlatformStorageLister.
func NewArangoPlatformStorageLister(indexer cache.Indexer) ArangoPlatformStorageLister {
return &arangoPlatformStorageLister{listers.New[*v1alpha1.ArangoPlatformStorage](indexer, v1alpha1.Resource("arangoplatformstorage"))}
}
// ArangoPlatformStorages returns an object that can list and get ArangoPlatformStorages.
func (s *arangoPlatformStorageLister) ArangoPlatformStorages(namespace string) ArangoPlatformStorageNamespaceLister {
return arangoPlatformStorageNamespaceLister{listers.NewNamespaced[*v1alpha1.ArangoPlatformStorage](s.ResourceIndexer, namespace)}
}
// ArangoPlatformStorageNamespaceLister helps list and get ArangoPlatformStorages.
// All objects returned here must be treated as read-only.
type ArangoPlatformStorageNamespaceLister interface {
// List lists all ArangoPlatformStorages in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ArangoPlatformStorage, err error)
// Get retrieves the ArangoPlatformStorage from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.ArangoPlatformStorage, error)
ArangoPlatformStorageNamespaceListerExpansion
}
// arangoPlatformStorageNamespaceLister implements the ArangoPlatformStorageNamespaceLister
// interface.
type arangoPlatformStorageNamespaceLister struct {
listers.ResourceIndexer[*v1alpha1.ArangoPlatformStorage]
}

View file

@ -0,0 +1,31 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
// ArangoPlatformStorageListerExpansion allows custom methods to be added to
// ArangoPlatformStorageLister.
type ArangoPlatformStorageListerExpansion interface{}
// ArangoPlatformStorageNamespaceListerExpansion allows custom methods to be added to
// ArangoPlatformStorageNamespaceLister.
type ArangoPlatformStorageNamespaceListerExpansion interface{}

View file

@ -0,0 +1,45 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package arangoplatformstorage
import (
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/refresh"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/version"
)
type Inspector interface {
ArangoPlatformStorage() Definition
}
type Definition interface {
refresh.Inspector
gvk.GK
anonymous.Impl
Version() version.Version
V1Alpha1() (generic.Inspector[*platformApi.ArangoPlatformStorage], error)
}

View file

@ -0,0 +1,43 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package arangoplatformstorage
import (
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic"
)
func List(filter ...generic.Filter[*platformApi.ArangoPlatformStorage]) generic.ExtractorList[*platformApi.ArangoPlatformStorageList, *platformApi.ArangoPlatformStorage] {
return func(in *platformApi.ArangoPlatformStorageList) []*platformApi.ArangoPlatformStorage {
ret := make([]*platformApi.ArangoPlatformStorage, 0, len(in.Items))
for _, el := range in.Items {
z := el.DeepCopy()
if !generic.FilterObject(z, filter...) {
continue
}
ret = append(ret, z)
}
return ret
}
}

View file

@ -0,0 +1,66 @@
//
// DISCLAIMER
//
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package constants
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/arangodb/kube-arangodb/pkg/apis/platform"
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
)
// ArangoPlatformStorage
const (
ArangoPlatformStorageGroup = platform.ArangoPlatformGroupName
ArangoPlatformStorageResource = platform.ArangoPlatformStorageResourcePlural
ArangoPlatformStorageKind = platform.ArangoPlatformStorageResourceKind
ArangoPlatformStorageVersionV1Beta1 = platformApi.ArangoPlatformVersion
)
func ArangoPlatformStorageGK() schema.GroupKind {
return schema.GroupKind{
Group: ArangoPlatformStorageGroup,
Kind: ArangoPlatformStorageKind,
}
}
func ArangoPlatformStorageGKv1() schema.GroupVersionKind {
return schema.GroupVersionKind{
Group: ArangoPlatformStorageGroup,
Kind: ArangoPlatformStorageKind,
Version: ArangoPlatformStorageVersionV1Beta1,
}
}
func ArangoPlatformStorageGR() schema.GroupResource {
return schema.GroupResource{
Group: ArangoPlatformStorageGroup,
Resource: ArangoPlatformStorageResource,
}
}
func ArangoPlatformStorageGRv1() schema.GroupVersionResource {
return schema.GroupVersionResource{
Group: ArangoPlatformStorageGroup,
Resource: ArangoPlatformStorageResource,
Version: ArangoPlatformStorageVersionV1Beta1,
}
}

View file

@ -30,6 +30,7 @@ const (
ArangoTask Component = "ArangoTask"
ArangoRoute Component = "ArangoRoute"
ArangoProfile Component = "ArangoProfile"
ArangoPlatformStorage Component = "ArangoPlatformStorage"
Node Component = "Node"
PersistentVolume Component = "PersistentVolume"
PersistentVolumeClaim Component = "PersistentVolumeClaim"
@ -50,6 +51,7 @@ func AllComponents() []Component {
ArangoTask,
ArangoRoute,
ArangoProfile,
ArangoPlatformStorage,
Node,
PersistentVolume,
PersistentVolumeClaim,

View file

@ -32,6 +32,7 @@ import (
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoclustersynchronization"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangodeployment"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoplatformstorage"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoprofile"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask"
@ -96,6 +97,7 @@ type Inspector interface {
arangotask.Inspector
arangoroute.Inspector
arangoprofile.Inspector
arangoplatformstorage.Inspector
mods.Mods

View file

@ -27,6 +27,7 @@ import (
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1"
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic"
)
@ -71,6 +72,10 @@ type ArangoMemberMods interface {
V1() generic.ModStatusClient[*api.ArangoMember]
}
type ArangoPlatformStorageMods interface {
V1Alpha1() generic.ModStatusClient[*platformApi.ArangoPlatformStorage]
}
type ArangoTaskMods interface {
V1() generic.ModStatusClient[*api.ArangoTask]
}
@ -103,4 +108,5 @@ type Mods interface {
ArangoClusterSynchronizationModInterface() ArangoClusterSynchronizationMods
ArangoRouteModInterface() ArangoRouteMods
ArangoProfileModInterface() ArangoProfileMods
ArangoPlatformStorageModInterface() ArangoPlatformStorageMods
}

View file

@ -32,16 +32,17 @@ type Inspector interface {
}
func NewAlwaysThrottleComponents() Components {
return NewThrottleComponents(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
return NewThrottleComponents(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
}
func NewThrottleComponents(acs, am, at, ar, ap, node, pvc, pod, pv, pdb, secret, cm, service, serviceAccount, sm, endpoints time.Duration) Components {
func NewThrottleComponents(acs, am, at, ar, ap, aps, node, pvc, pod, pv, pdb, secret, cm, service, serviceAccount, sm, endpoints time.Duration) Components {
return &throttleComponents{
arangoClusterSynchronization: NewThrottle(acs),
arangoMember: NewThrottle(am),
arangoTask: NewThrottle(at),
arangoRoute: NewThrottle(ar),
arangoProfile: NewThrottle(ap),
arangopPlatformStorage: NewThrottle(aps),
node: NewThrottle(node),
persistentVolume: NewThrottle(pv),
persistentVolumeClaim: NewThrottle(pvc),
@ -62,6 +63,7 @@ type Components interface {
ArangoTask() Throttle
ArangoRoute() Throttle
ArangoProfile() Throttle
ArangoPlatformStorage() Throttle
Node() Throttle
PersistentVolume() Throttle
PersistentVolumeClaim() Throttle
@ -87,6 +89,7 @@ type throttleComponents struct {
arangoTask Throttle
arangoRoute Throttle
arangoProfile Throttle
arangopPlatformStorage Throttle
node Throttle
persistentVolume Throttle
persistentVolumeClaim Throttle
@ -143,6 +146,8 @@ func (t *throttleComponents) Get(c definitions.Component) Throttle {
return t.arangoRoute
case definitions.ArangoProfile:
return t.arangoProfile
case definitions.ArangoPlatformStorage:
return t.arangopPlatformStorage
case definitions.Node:
return t.node
case definitions.PersistentVolume:
@ -177,6 +182,7 @@ func (t *throttleComponents) Copy() Components {
arangoTask: t.arangoTask.Copy(),
arangoRoute: t.arangoRoute.Copy(),
arangoProfile: t.arangoProfile.Copy(),
arangopPlatformStorage: t.arangopPlatformStorage.Copy(),
node: t.node.Copy(),
persistentVolume: t.persistentVolume.Copy(),
persistentVolumeClaim: t.persistentVolumeClaim.Copy(),
@ -211,6 +217,10 @@ func (t *throttleComponents) ArangoProfile() Throttle {
return t.arangoProfile
}
func (t *throttleComponents) ArangoPlatformStorage() Throttle {
return t.arangopPlatformStorage
}
func (t *throttleComponents) Node() Throttle {
return t.node
}

View file

@ -47,6 +47,8 @@ import (
mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1"
"github.com/arangodb/kube-arangodb/pkg/apis/networking"
networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1"
"github.com/arangodb/kube-arangodb/pkg/apis/platform"
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
"github.com/arangodb/kube-arangodb/pkg/apis/scheduler"
schedulerApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1"
schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1"
@ -299,6 +301,12 @@ func CreateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe
vl := *v
_, err := arango.NetworkingV1alpha1().ArangoRoutes(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{})
require.NoError(t, err)
case **platformApi.ArangoPlatformStorage:
require.NotNil(t, v)
vl := *v
_, err := arango.PlatformV1alpha1().ArangoPlatformStorages(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{})
require.NoError(t, err)
default:
require.Fail(t, fmt.Sprintf("Unable to create object: %s", reflect.TypeOf(v).String()))
}
@ -506,6 +514,12 @@ func UpdateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe
vl := *v
_, err := arango.NetworkingV1alpha1().ArangoRoutes(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{})
require.NoError(t, err)
case **platformApi.ArangoPlatformStorage:
require.NotNil(t, v)
vl := *v
_, err := arango.PlatformV1alpha1().ArangoPlatformStorages(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{})
require.NoError(t, err)
default:
require.Fail(t, fmt.Sprintf("Unable to create object: %s", reflect.TypeOf(v).String()))
}
@ -679,6 +693,11 @@ func DeleteObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe
vl := *v
require.NoError(t, arango.NetworkingV1alpha1().ArangoRoutes(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{}))
case **platformApi.ArangoPlatformStorage:
require.NotNil(t, v)
vl := *v
require.NoError(t, arango.PlatformV1alpha1().ArangoPlatformStorages(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{}))
default:
require.Fail(t, fmt.Sprintf("Unable to delete object: %s", reflect.TypeOf(v).String()))
}
@ -1170,6 +1189,21 @@ func RefreshObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientS
} else {
*v = vn
}
case **platformApi.ArangoPlatformStorage:
require.NotNil(t, v)
vl := *v
vn, err := arango.PlatformV1alpha1().ArangoPlatformStorages(vl.GetNamespace()).Get(context.Background(), vl.GetName(), meta.GetOptions{})
if err != nil {
if kerrors.IsNotFound(err) {
*v = nil
} else {
require.NoError(t, err)
}
} else {
*v = vn
}
default:
require.Fail(t, fmt.Sprintf("Unable to get object: %s", reflect.TypeOf(v).String()))
}
@ -1414,6 +1448,14 @@ func SetMetaBasedOnType(t *testing.T, object meta.Object) {
networking.ArangoRouteResourcePlural,
object.GetNamespace(),
object.GetName()))
case *platformApi.ArangoPlatformStorage:
v.Kind = platform.ArangoPlatformStorageResourceKind
v.APIVersion = networkingApi.SchemeGroupVersion.String()
v.SetSelfLink(fmt.Sprintf("/api/%s/%s/%s/%s",
platformApi.SchemeGroupVersion.String(),
platform.ArangoPlatformStorageResourcePlural,
object.GetNamespace(),
object.GetName()))
default:
require.Fail(t, fmt.Sprintf("Unable to create object: %s", reflect.TypeOf(v).String()))
}
@ -1643,6 +1685,12 @@ func GVK(t *testing.T, object meta.Object) schema.GroupVersionKind {
Version: networkingApi.ArangoNetworkingVersion,
Kind: networking.ArangoRouteResourceKind,
}
case *platformApi.ArangoPlatformStorage:
return schema.GroupVersionKind{
Group: platform.ArangoPlatformGroupName,
Version: platformApi.ArangoPlatformVersion,
Kind: platform.ArangoPlatformStorageResourceKind,
}
default:
require.Fail(t, fmt.Sprintf("Unable to create object: %s", reflect.TypeOf(v).String()))
return schema.GroupVersionKind{}

View file

@ -37,6 +37,7 @@ import (
mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1"
mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1"
networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1"
platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1"
schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1"
"github.com/arangodb/kube-arangodb/pkg/operatorV2/operation"
"github.com/arangodb/kube-arangodb/pkg/util/kclient"
@ -98,4 +99,5 @@ func Test_NewMetaObject(t *testing.T) {
NewMetaObjectRun[*schedulerApi.ArangoSchedulerCronJob](t)
NewMetaObjectRun[*analyticsApi.GraphAnalyticsEngine](t)
NewMetaObjectRun[*networkingApi.ArangoRoute](t)
NewMetaObjectRun[*platformApi.ArangoPlatformStorage](t)
}